diff options
author | Joe <bousset.rudy@gmail.com> | 2022-05-21 01:29:54 +0200 |
---|---|---|
committer | Joe <bousset.rudy@gmail.com> | 2022-05-21 01:29:54 +0200 |
commit | ff3ac54b6a212c1bad572fd318acc4f378fa0302 (patch) | |
tree | 88f09af226f3626a240a09cfccdce385608fc126 | |
parent | update (diff) | |
download | dotfiles-bsd-ff3ac54b6a212c1bad572fd318acc4f378fa0302.tar.gz dotfiles-bsd-ff3ac54b6a212c1bad572fd318acc4f378fa0302.tar.bz2 dotfiles-bsd-ff3ac54b6a212c1bad572fd318acc4f378fa0302.tar.xz dotfiles-bsd-ff3ac54b6a212c1bad572fd318acc4f378fa0302.tar.zst dotfiles-bsd-ff3ac54b6a212c1bad572fd318acc4f378fa0302.zip |
cool updates
-rw-r--r-- | .config/dunst/dunstrc | 12 | ||||
-rwxr-xr-x | .local/bin/fathddmnt | 22 | ||||
-rwxr-xr-x | .local/bin/fathddumnt | 10 |
3 files changed, 32 insertions, 12 deletions
diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index d49a8e1..f7bcd41 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -12,6 +12,9 @@ padding = 2 horizontal_padding = 10 frame_width = 2 + close = ctrl+space + history = ctrl+grave + context = ctrl+shift+period # Define a color for the separator. # possible values are: @@ -67,10 +70,7 @@ per_monitor_dpi = false # [shortcuts] -# close = ctrl+space # close_all = ctrl+shift+space -# history = ctrl+grave -# context = ctrl+shift+period [urgency_low] # IMPORTANT: colors have to be defined in quotation marks. @@ -113,9 +113,9 @@ # NOTE: It might be helpful to run dunst -print in a terminal in order # to find fitting options for rules. -#[espeak] # >shutup -# summary = "*" # >shutup -# script = /home/jozan/.local/bin/dunst_espeak.sh # >shutup +[espeak] # >shutup + summary = "*" # >shutup + script = /home/jozan/.local/bin/dunst_espeak.sh # >shutup #[script-test] # summary = "*script*" diff --git a/.local/bin/fathddmnt b/.local/bin/fathddmnt index 27278d9..62bfff6 100755 --- a/.local/bin/fathddmnt +++ b/.local/bin/fathddmnt @@ -1,9 +1,21 @@ #!/bin/sh -e -tmp=$(mktemp) - -dmenu -p "Enter password: " -nb '#1d2021' -nf '#1d2021' <&- >"$tmp" -geli attach -k /root/geli_keys/fathdd_ext.key -j "$tmp" /dev/da0p1 +if ! diskinfo da0 >/dev/null; then + notify-send -u critical 'fathdd' ' HDD not detected' + exit 1 +fi +if mount | grep -F /dev/da0p1; then + notify-send -u critical \ + 'fathdd' \ + " HDD already mounted to \ +<b>$(mount | grep -F '/dev/da0p1' | awk '{print $3}')</b>" + exit 1 +fi +if ! dmenu -p 'Enter password: ' -P | + geli attach -k /root/geli_keys/fathdd_ext.key -j - da0p1; then + notify-send -u critical 'fathdd' ' Failed to mount HDD' + exit 1 +fi mkdir -p "$HOME"/hdd -rm "$tmp" mount /dev/da0p1.eli "$HOME"/hdd +notify-send -t 5000 'fathdd' ' HDD mounted to <b>~/hdd</b>' diff --git a/.local/bin/fathddumnt b/.local/bin/fathddumnt index 8944ae1..241a00a 100755 --- a/.local/bin/fathddumnt +++ b/.local/bin/fathddumnt @@ -1,5 +1,13 @@ #!/bin/sh -e -umount /dev/da0p1.eli +if ! mount | grep -F /dev/da0p1; then + notify-send -u critical 'fathdd' ' HDD not mounted' + exit 1 +fi +if ! umount /dev/da0p1.eli; then + notify-send -u critical 'fathdd' ' Failed to dismount HDD' + exit 1 +fi geli detach da0p1.eli rmdir "$HOME"/hdd +notify-send -t 5000 'fathdd' ' HDD dismounted from <b>~/hdd</b>' |