added existing
This commit is contained in:
7
conf.d/omf.fish
Normal file
7
conf.d/omf.fish
Normal file
@@ -0,0 +1,7 @@
|
||||
# Path to Oh My Fish install.
|
||||
set -q XDG_DATA_HOME
|
||||
and set -gx OMF_PATH "$XDG_DATA_HOME/omf"
|
||||
or set -gx OMF_PATH "$HOME/.local/share/omf"
|
||||
|
||||
# Load Oh My Fish configuration.
|
||||
source $OMF_PATH/init.fish
|
||||
67
config.fish
Normal file
67
config.fish
Normal file
@@ -0,0 +1,67 @@
|
||||
# source ~/.config/fish/configs/aliases.fish
|
||||
|
||||
# if test -f $HOME/.config/fish/alias.fish ]
|
||||
# source $HOME/.config/fish/alias.fish
|
||||
# end
|
||||
|
||||
set distro (cat /etc/os-release | grep ^ID= | cut -d '=' -f 2 | tr -d '"')
|
||||
|
||||
if status is-interactive
|
||||
# Commands to run in interactive sessions can go here
|
||||
|
||||
# Load the theme
|
||||
if test -f $HOME/.config/fish/configs/theme.fish
|
||||
source $HOME/.config/fish/configs/theme.fish
|
||||
end
|
||||
|
||||
# Load the aliases
|
||||
if test -f $HOME/.config/fish/configs/alias_custom-script.fish
|
||||
source $HOME/.config/fish/configs/alias_custom-script.fish
|
||||
end
|
||||
if test -f $HOME/.config/fish/configs/alias_fixing.fish
|
||||
source $HOME/.config/fish/configs/alias_fixing.fish
|
||||
end
|
||||
if test -f $HOME/.config/fish/configs/alias_useful.fish
|
||||
source $HOME/.config/fish/configs/alias_useful.fish
|
||||
end
|
||||
if test -f $HOME/.config/fish/configs/function_usefull.fish
|
||||
source $HOME/.config/fish/configs/function_usefull.fish
|
||||
end
|
||||
|
||||
# ~/.config/fish/config.fish
|
||||
|
||||
# Get the distribution name and version
|
||||
|
||||
|
||||
switch $distro
|
||||
case 'fedora'
|
||||
if test -f $HOME/.config/fish/configs/fedora_config.fish
|
||||
source $HOME/.config/fish/configs/fedora_config.fish
|
||||
end
|
||||
case 'arch'
|
||||
if test -f $HOME/.config/fish/configs/arch_config.fish
|
||||
source $HOME/.config/fish/configs/arch_config.fish
|
||||
end
|
||||
case 'ubuntu'
|
||||
if test -f $HOME/.config/fish/configs/ubuntu_config.fish
|
||||
source $HOME/.config/fish/configs/ubuntu_config.fish
|
||||
end
|
||||
case '*'
|
||||
if test -f $HOME/.config/fish/configs/default_config.fish
|
||||
source $HOME/.config/fish/configs/default_config.fish
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
fastfetch
|
||||
end
|
||||
|
||||
set -x QT_QPA_PLATFORMTHEME qt6ct
|
||||
|
||||
# Fish done Configuration
|
||||
set -U __done_allow_nongraphical 1
|
||||
set -U __done_min_cmd_duration 5000 # 5000 # default: 5000 ms # 5 seconds
|
||||
set -U __done_notify_sound 1
|
||||
set -U __done_sway_ignore_visible 0
|
||||
|
||||
set -q GHCUP_INSTALL_BASE_PREFIX[1]; or set GHCUP_INSTALL_BASE_PREFIX $HOME ; set -gx PATH $HOME/.cabal/bin /home/honney/.ghcup/bin $PATH # ghcup-env
|
||||
2
configs/alias_custom-script.fish
Normal file
2
configs/alias_custom-script.fish
Normal file
@@ -0,0 +1,2 @@
|
||||
# Alias for different custom tools
|
||||
alias ff="simple_ffprobe_script"
|
||||
15
configs/alias_fixing.fish
Normal file
15
configs/alias_fixing.fish
Normal file
@@ -0,0 +1,15 @@
|
||||
# In ~/.config/fish/config.fish
|
||||
|
||||
# Fixing some Programs that do not know Kitty or Alacritty
|
||||
|
||||
# Check if the local terminal supports color (kitty, alacritty, etc.)
|
||||
if test "$TERM" = "xterm-kitty" -o "$TERM" = "alacritty"
|
||||
# If we're in a non-standard terminal, force TERM=xterm-256color for SSH
|
||||
alias ssh 'env TERM=xterm-256color ssh'
|
||||
end
|
||||
|
||||
if test -f $HOME/.config/fish/alias.fish
|
||||
source $HOME/.config/fish/alias.fish
|
||||
end
|
||||
zoxide init fish | source
|
||||
alias cd='z'
|
||||
105
configs/alias_useful.fish
Normal file
105
configs/alias_useful.fish
Normal file
@@ -0,0 +1,105 @@
|
||||
#
|
||||
# In ~/.config/fish/configs/alias_useful.fish
|
||||
#
|
||||
|
||||
if test "$TERM" = "xterm-kitty"
|
||||
alias icat='kitty +kitten icat'
|
||||
end
|
||||
|
||||
|
||||
alias fish_config='nano $HOME/.config/fish/config.fish' # Open the fish Config in Text editor
|
||||
|
||||
# Easier Ollama Commands
|
||||
alias llama_start='ollama serve' # Start the LLama server
|
||||
alias llama3='ollama run llama3' # Start the LLama Chat
|
||||
|
||||
alias force_delete='sudo rm -rf' # Delete Folder/Files with included Folder/Files
|
||||
|
||||
alias tasks='btop'
|
||||
|
||||
alias python='python3'
|
||||
alias py='python3'
|
||||
|
||||
alias uni_play='mpv --vo=tct' # Plays a video in terminal with Unicode
|
||||
alias asci_play='mpv --vo=caca' # Plays a video in terminal with ASCII
|
||||
|
||||
alias remount='sudo mount -a'
|
||||
|
||||
alias mount_config='sudo nano /etc/fstab'
|
||||
|
||||
function mkvenv
|
||||
if test (count $argv) -lt 1
|
||||
echo "Usage: mkvenv {folder name}"
|
||||
return 1
|
||||
end
|
||||
python3 -m venv $argv[1]
|
||||
source $argv[1]/bin/activate.fish
|
||||
end
|
||||
|
||||
alias own='sudo chown -R "$USER":"$USER" themes'
|
||||
alias right='sudo chmod -R 755'
|
||||
|
||||
alias reload='clear && omf reload'
|
||||
|
||||
# LS to eza Commands
|
||||
alias ls 'eza -a --color=always --group-directories-first --icons' # preferred listing
|
||||
alias lr 'eza -al --color=always --group-directories-first --icons' # all files and dirs
|
||||
alias ll 'eza -l --color=always --group-directories-first --icons' # long format
|
||||
alias lt 'eza -aT --color=always --group-directories-first --icons' # tree listing
|
||||
alias l. 'eza -ald --color=always --group-directories-first --icons .*' # show only dotfiles
|
||||
alias lf 'eza -aD --color=always --group-directories-first --icons' # show only folder
|
||||
|
||||
# Common use
|
||||
alias .. 'cd ..'
|
||||
alias ... 'cd ../..'
|
||||
alias .... 'cd ../../..'
|
||||
alias ..... 'cd ../../../..'
|
||||
alias ...... 'cd ../../../../..'
|
||||
|
||||
alias grep 'ugrep --color=auto'
|
||||
alias egrep 'ugrep -E --color=auto'
|
||||
alias fgrep 'ugrep -F --color=auto'
|
||||
|
||||
alias ip 'ip -color'
|
||||
|
||||
alias psmem 'ps auxf | sort -nr -k 4'
|
||||
alias psmem10 'ps auxf | sort -nr -k 4 | head -10'
|
||||
|
||||
alias tarnow 'tar -acf '
|
||||
alias untar 'tar -zxvf '
|
||||
|
||||
alias dir 'dir --color=auto'
|
||||
alias vdir 'vdir --color=auto'
|
||||
|
||||
alias wget 'wget -c '
|
||||
|
||||
alias jctl 'journalctl -p 3 -xb'
|
||||
|
||||
alias ocrmypdf 'ocrmypdf --deskew --clean --rotate-pages'
|
||||
|
||||
function rcp
|
||||
if test (count $argv) -lt 2
|
||||
echo "Usage: rcp SOURCE... DESTINATION"
|
||||
return 1
|
||||
end
|
||||
rsync -avh --progress $argv
|
||||
end
|
||||
|
||||
function rmv
|
||||
if test (count $argv) -lt 2
|
||||
echo "Usage: rmv SOURCE... DESTINATION"
|
||||
return 1
|
||||
end
|
||||
rsync -avh --progress --remove-source-files $arg
|
||||
end
|
||||
function nanorm
|
||||
if test (count $argv) -lt 1
|
||||
echo "Usage: nanorm {FILE}"
|
||||
return 1
|
||||
end
|
||||
set arg $argv[1]
|
||||
if test -f $arg
|
||||
rm $arg
|
||||
end
|
||||
nano $arg
|
||||
end
|
||||
71
configs/arch_config.fish
Normal file
71
configs/arch_config.fish
Normal file
@@ -0,0 +1,71 @@
|
||||
#
|
||||
# ~/.config/fish/configs/arch_config.fish
|
||||
#
|
||||
|
||||
alias sway_config='nano $HOME/.config/sway/config' # Open the fish Config in Text editor
|
||||
|
||||
alias git_update='$HOME/.config/fish/scripts/git-update.sh'
|
||||
|
||||
alias mount_all='$HOME/.config/fish/scripts/mount.sh'
|
||||
alias umount_all='$HOME/.config/fish/scripts/umount.sh'
|
||||
|
||||
alias print_cam='ssh honney@192.168.1.184'
|
||||
|
||||
function updateall
|
||||
# Get current Discord version (if installed)
|
||||
if pacman -Qq discord >/dev/null 2>&1
|
||||
set version_before (pacman -Qq discord)
|
||||
else
|
||||
set version_before ""
|
||||
end
|
||||
|
||||
# Run updates
|
||||
sudo pacman -Syu
|
||||
yay -Sua --sudoloop
|
||||
flatpak update
|
||||
|
||||
# Get new Discord version (if installed)
|
||||
if pacman -Qq discord >/dev/null 2>&1
|
||||
set version_after (pacman -Qq discord)
|
||||
else
|
||||
set version_after ""
|
||||
end
|
||||
|
||||
# Compare versions
|
||||
if test "$version_before" != "$version_after"
|
||||
echo "Discord version changed: $version_before -> $version_after"
|
||||
echo "Running extra command..."
|
||||
sh -c "$(curl -sS https://raw.githubusercontent.com/Vendicated/VencordInstaller/main/install.sh)"
|
||||
end
|
||||
end
|
||||
|
||||
alias mirror='sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist'
|
||||
alias mirrora='sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist'
|
||||
alias mirrord='sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist'
|
||||
alias mirrors='sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist'
|
||||
|
||||
alias big='expac -H M "%m\t%n" | sort -h | nl' # Sort installed packages according to size in MB (expac must be installed)
|
||||
alias fixpacman='sudo rm /var/lib/pacman/db.lck'
|
||||
alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # List amount of -git packages
|
||||
|
||||
alias rip 'expac --timefmt="%Y-%m-%d %T" "%l\t%n %v" | sort | tail -200 | nl'
|
||||
|
||||
function cleanup
|
||||
while pacman -Qdtq
|
||||
sudo pacman -R (pacman -Qdtq)
|
||||
end
|
||||
end
|
||||
|
||||
function scenedetectenv
|
||||
source ~/.venvs/scenedetect-env/bin/activate.fish
|
||||
set -gx PATH ~/.venvs/scenedetect-env/bin $PATH
|
||||
end
|
||||
|
||||
function y
|
||||
set tmp (mktemp -t "yazi-cwd.XXXXXX")
|
||||
yazi $argv --cwd-file="$tmp"
|
||||
if read -z cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
builtin cd -- "$cwd"
|
||||
end
|
||||
rm -f -- "$tmp"
|
||||
end
|
||||
1
configs/default_config.fish
Normal file
1
configs/default_config.fish
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
8
configs/fedora_config.fish
Normal file
8
configs/fedora_config.fish
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
# ~/.config/fish/configs/fedora_config.fish
|
||||
#
|
||||
alias ff='$HOME/.bin/simple_ffprobe_script'
|
||||
|
||||
alias ssh='env TERM=xterm-256color ssh'
|
||||
|
||||
alias updateall='sudo dnf upgrade --refresh && flatpak update'
|
||||
10
configs/function_usefull.fish
Normal file
10
configs/function_usefull.fish
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
# yazi file manager wrapper
|
||||
function y
|
||||
set tmp (mktemp -t "yazi-cwd.XXXXXX")
|
||||
yazi $argv --cwd-file="$tmp"
|
||||
if read -z cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
builtin cd -- "$cwd"
|
||||
end
|
||||
rm -f -- "$tmp"
|
||||
end
|
||||
41
configs/theme.fish
Normal file
41
configs/theme.fish
Normal file
@@ -0,0 +1,41 @@
|
||||
# OPTIONS FOR BOBTHEFISH (Theme)
|
||||
set -g theme_display_git yes
|
||||
set -g theme_display_git_dirty no
|
||||
set -g theme_display_git_untracked no
|
||||
set -g theme_display_git_ahead_verbose yes
|
||||
set -g theme_display_git_dirty_verbose yes
|
||||
set -g theme_display_git_stashed_verbose yes
|
||||
set -g theme_display_git_default_branch yes
|
||||
set -g theme_git_default_branches master main
|
||||
set -g theme_git_worktree_support yes
|
||||
set -g theme_use_abbreviated_branch_name yes
|
||||
set -g theme_display_vagrant yes
|
||||
set -g theme_display_docker_machine no
|
||||
set -g theme_display_k8s_context yes
|
||||
set -g theme_display_hg yes
|
||||
set -g theme_display_virtualenv no
|
||||
set -g theme_display_nix no
|
||||
set -g theme_display_ruby no
|
||||
set -g theme_display_node yes
|
||||
set -g theme_display_user ssh
|
||||
set -g theme_display_hostname ssh
|
||||
set -g theme_display_vi no
|
||||
set -g theme_display_date no
|
||||
set -g theme_display_cmd_duration yes
|
||||
set -g theme_title_display_process yes
|
||||
set -g theme_title_display_path no
|
||||
set -g theme_title_display_user yes
|
||||
set -g theme_title_use_abbreviated_path no
|
||||
set -g theme_date_format "+%a %H:%M"
|
||||
set -g theme_date_timezone America/Los_Angeles
|
||||
set -g theme_avoid_ambiguous_glyphs yes
|
||||
set -g theme_powerline_fonts no
|
||||
set -g theme_nerd_fonts yes
|
||||
set -g theme_show_exit_status yes
|
||||
set -g theme_display_jobs_verbose yes
|
||||
set -g default_user your_normal_user
|
||||
set -g theme_color_scheme dark
|
||||
set -g fish_prompt_pwd_dir_length 0
|
||||
set -g theme_project_dir_length 1
|
||||
set -g theme_newline_cursor yes
|
||||
set -g theme_newline_prompt '$ '
|
||||
1
configs/ubuntu_config.fish
Normal file
1
configs/ubuntu_config.fish
Normal file
@@ -0,0 +1 @@
|
||||
alias uninstall='sudo apt purge -y'
|
||||
37
fish_variables
Normal file
37
fish_variables
Normal file
@@ -0,0 +1,37 @@
|
||||
# This file contains fish universal variable definitions.
|
||||
# VERSION: 3.0
|
||||
SETUVAR --export EDITOR:/usr/bin/nvim
|
||||
SETUVAR __done_allow_nongraphical:1
|
||||
SETUVAR __done_min_cmd_duration:5000
|
||||
SETUVAR __done_notify_sound:1
|
||||
SETUVAR __done_sway_ignore_visible:0
|
||||
SETUVAR __fish_initialized:3800
|
||||
SETUVAR fish_color_autosuggestion:brblack
|
||||
SETUVAR fish_color_cancel:\x2dr
|
||||
SETUVAR fish_color_command:blue
|
||||
SETUVAR fish_color_comment:red
|
||||
SETUVAR fish_color_cwd:green
|
||||
SETUVAR fish_color_cwd_root:red
|
||||
SETUVAR fish_color_end:green
|
||||
SETUVAR fish_color_error:brred
|
||||
SETUVAR fish_color_escape:brcyan
|
||||
SETUVAR fish_color_history_current:\x2d\x2dbold
|
||||
SETUVAR fish_color_host:normal
|
||||
SETUVAR fish_color_host_remote:yellow
|
||||
SETUVAR fish_color_normal:normal
|
||||
SETUVAR fish_color_operator:brcyan
|
||||
SETUVAR fish_color_param:cyan
|
||||
SETUVAR fish_color_quote:yellow
|
||||
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
|
||||
SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack
|
||||
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
|
||||
SETUVAR fish_color_status:red
|
||||
SETUVAR fish_color_user:brgreen
|
||||
SETUVAR fish_color_valid_path:\x2d\x2dunderline
|
||||
SETUVAR fish_key_bindings:fish_default_key_bindings
|
||||
SETUVAR fish_pager_color_completion:normal
|
||||
SETUVAR fish_pager_color_description:yellow\x1e\x2di
|
||||
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
||||
SETUVAR fish_pager_color_selected_background:\x2dr
|
||||
SETUVAR fish_user_paths:/home/honney/Nextcloud/UNI/25\x2d26_TI/BSP/arm/bin\x1e/home/honney/\x2ebin\x1e/home/honney/\x2elocal/bin
|
||||
14
scripts/git-update.sh
Normal file
14
scripts/git-update.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
packages="installed-packages.txt"
|
||||
|
||||
echo "writing packages into $packages"
|
||||
pacman -Qqe > $packages
|
||||
paru -Qqe >> $packages
|
||||
echo "finished packages into $packages"
|
||||
echo "copying files outside of home"
|
||||
cp /etc/fstab $HOME/.root/etc/
|
||||
cp -r /boot/grub/themes/* $HOME/.root/boot/grub/themes/
|
||||
echo "finished copying files outside of home"
|
||||
git add -u
|
||||
git commit -m 'update'
|
||||
git push
|
||||
50
scripts/mount.sh
Normal file
50
scripts/mount.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source the functions file
|
||||
source "$HOME/.config/function_helper.sh"
|
||||
|
||||
# Configuration
|
||||
SERVER_IP="192.168.1.22"
|
||||
CRENDENTIALS="$HOME/.cred/.smbcred"
|
||||
MOUNT_POINT_RAID="$HOME/Raid/"
|
||||
MOUNT_POINT_SSD="$HOME/Server-SSD/"
|
||||
PASSWORD_FILE="$HOME/.cred/credentials.txt"
|
||||
|
||||
# Read the password from the file
|
||||
PASSWORD=$(<"$PASSWORD_FILE")
|
||||
|
||||
# Function to mount all shares
|
||||
function mount_all() {
|
||||
if ping -c 1 -W 2 $SERVER_IP > /dev/null 2>&1; then
|
||||
send_notification "low" "Ping Successful" "$SERVER_IP is Up and Running. Continuing to mount." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/connect_established.svg"
|
||||
# Mount RAID
|
||||
if ! is_mounted "$MOUNT_POINT_RAID"; then
|
||||
if echo "$PASSWORD" | sudo -S mount -t cifs -o credentials="$CRENDENTIALS",uid=1000,gid=1000 //$SERVER_IP/RAID "$MOUNT_POINT_RAID"; then
|
||||
send_notification "low" "Mount Successful" "Mounted RAID at $MOUNT_POINT_RAID successfully." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk-encrypted-symbolic.svg"
|
||||
else
|
||||
send_notification "high" "Mount Failed" "Failed to mount RAID at $MOUNT_POINT_RAID." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk-symbolic.svg"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
send_notification "low" "Already Mounted" "RAID is already mounted at $MOUNT_POINT_RAID." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk.svg"
|
||||
fi
|
||||
|
||||
# Mount SSD
|
||||
if ! is_mounted "$MOUNT_POINT_SSD"; then
|
||||
if echo "$PASSWORD" | sudo -S mount -t cifs -o credentials="$CRENDENTIALS",uid=1000,gid=1000 //$SERVER_IP/Server-SSD "$MOUNT_POINT_SSD"; then
|
||||
send_notification "low" "Mount Successful" "Mounted SSD at $MOUNT_POINT_SSD successfully." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk-encrypted-symbolic.svg"
|
||||
else
|
||||
send_notification "high" "Mount Failed" "Failed to mount SSD at $MOUNT_POINT_SSD." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk-symbolic.svg"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
send_notification "low" "Already Mounted" "SSD is already mounted at $MOUNT_POINT_SSD." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk.svg"
|
||||
fi
|
||||
else
|
||||
send_notification "normal" "Connection Failed" "Could not connect to IP: $SERVER_IP." "$HOME/.icons/BeautyLine-Garuda/actions/scalable/network-disconnect.svg"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Call the mount_all function
|
||||
mount_all
|
||||
11
scripts/shutdown-server.sh
Normal file
11
scripts/shutdown-server.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
PASSWORD_FILE="$HOME/.cred/credentials_s.txt"
|
||||
PASSWORD=$(<"$PASSWORD_FILE")
|
||||
SERVERIP="192.168.0.1"
|
||||
USERNAME="Honney"
|
||||
COMMAND="shutdown /s /t 0"
|
||||
|
||||
send_notification "normal" "Shutingdown 2nd PC" "$SERVERIP" "$HOME/.icons/BeautyLine-Garuda/devices/scalable/server.svg"
|
||||
|
||||
sshpass\
|
||||
-p "$PASSWORD" ssh "$USERNAME"@"$SERVERIP" "$COMMAND"
|
||||
35
scripts/umount.sh
Normal file
35
scripts/umount.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source the functions file
|
||||
source "$HOME/.config/function_helper.sh"
|
||||
|
||||
# Define mount points
|
||||
MOUNT_POINT_RAID="$HOME/Raid/"
|
||||
MOUNT_POINT_SSD="$HOME/Server-SSD/"
|
||||
|
||||
PASSWORD_FILE="$HOME/.cred/credentials.txt"
|
||||
PASSWORD=$(<"$PASSWORD_FILE")
|
||||
|
||||
# Unmount RAID
|
||||
if is_mounted "$MOUNT_POINT_RAID"; then
|
||||
if echo "$PASSWORD" | sudo -S umount "$MOUNT_POINT_RAID"; then
|
||||
send_notification "low" "Unmount Successful" "Unmounted $MOUNT_POINT_RAID successfully." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk-encrypted-symbolic.svg"
|
||||
else
|
||||
send_notification "high" "Unmount Failed" "Failed to unmount $MOUNT_POINT_RAID." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk-symbolic.svg"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
send_notification "low" "Not Mounted" "$MOUNT_POINT_RAID is not mounted." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk.svg"
|
||||
fi
|
||||
|
||||
# Unmount SSD
|
||||
if is_mounted "$MOUNT_POINT_SSD"; then
|
||||
if echo "$PASSWORD" | sudo -S umount "$MOUNT_POINT_SSD"; then
|
||||
send_notification "low" "Unmount Successful" "Unmounted $MOUNT_POINT_SSD successfully." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk-encrypted-symbolic.svg"
|
||||
else
|
||||
send_notification "high" "Unmount Failed" "Failed to unmount $MOUNT_POINT_SSD." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk-symbolic.svg"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
send_notification "low" "Not Mounted" "$MOUNT_POINT_SSD is not mounted." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk.svg"
|
||||
fi
|
||||
Reference in New Issue
Block a user