diff options
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/dmlog | 15 | ||||
| -rwxr-xr-x | .local/bin/hddmnt | 16 | ||||
| -rwxr-xr-x | .local/bin/hddumnt | 12 |
3 files changed, 18 insertions, 25 deletions
diff --git a/.local/bin/dmlog b/.local/bin/dmlog index c31a270..a5f9b15 100755 --- a/.local/bin/dmlog +++ b/.local/bin/dmlog @@ -27,13 +27,6 @@ use constant CONFIRM => [ "yes" ]; -my $icon; - -$icon = ""; -$icon = " " if HOSTNAME eq 'mother'; -$icon = " " if HOSTNAME eq 'po-rbo'; -$icon = " " if HOSTNAME eq 'mars'; - sub notify { my ($str) = @_; @@ -82,7 +75,7 @@ sub action "-fail-color", "0xcc241d"); } else { - exec(SLOCK_PATH . " && exec herbe '$icon welcome back, partner!'"); + exec(SLOCK_PATH . " && exec herbe 'welcome back, partner!'"); } } elsif ($var eq ${+LIST}[1]) { @@ -99,7 +92,7 @@ sub action } } else { - notify("$icon g'night, partner!"); + notify("g'night, partner!"); sleep 2; if (HOSTNAME eq 'mother') { system('umount', '-f', '/var/dev/ceres'); @@ -128,13 +121,13 @@ sub action elsif (HOSTNAME eq 'po-rbo') { exec('doas', 'systemctl', 'reboot'); } - notify("$icon rebootin', partner!"); + notify("rebootin', partner!"); exec(SHUTDOWN_PATH, '-r', 'now'); } } elsif ($var eq ${+LIST}[4]) { if (confirm($var, $color) == 1) { - notify("$icon farewell, partner!"); + notify("farewell, partner!"); sleep 2; if (HOSTNAME eq 'mother') { exec(LOGINCTL_PATH, 'poweroff'); diff --git a/.local/bin/hddmnt b/.local/bin/hddmnt index c3b73d3..d7115f1 100755 --- a/.local/bin/hddmnt +++ b/.local/bin/hddmnt @@ -7,38 +7,38 @@ case "$(hostname -s)" in mother|po-rbo) dev=$(find /dev/sd* -type b -exec bash -c 'doas cryptsetup isLuks {} && echo {}' \; | head -n1) if [ -z "$dev" ]; then - herbe ' crypt dev not detected' & + herbe 'crypt dev not detected' & exit 1 fi if ! doas cryptsetup open "$dev" "$devname"; then - herbe " failed to uncrypt dev $dev" & + herbe "failed to uncrypt dev $dev" & exit 1 fi mkdir -p "$mountpoint" if ! doas mount /dev/mapper/"$devname" "$mountpoint"; then - herbe " failed to mount dev $dev" & + herbe "failed to mount dev $dev" & exit 1 fi - herbe " crypt dev mounted to $mountpoint" & + herbe "crypt dev mounted to $mountpoint" & ;; mars) if ! diskinfo da0 >/dev/null; then - herbe ' HDD not detected' & + herbe 'hdd not detected' & exit 1 fi if mount | grep -F /dev/da0p1; then herbe \ - " HDD already mounted to \ + "hdd already mounted to \ $(mount | grep -F '/dev/da0p1' | awk '{print $3}')" exit 1 fi if ! dmenu -m 0 -p 'Enter password: ' -P | geli attach -k /root/geli_keys/fathdd_ext.key -j - da0p1; then - herbe ' Failed to mount HDD' & + herbe 'failed to mount hdd' & exit 1 fi mkdir -p "$HOME"/hdd mount /dev/da0p1.eli "$HOME"/hdd - herbe ' HDD mounted to ~/hdd' & + herbe 'hdd mounted to ~/hdd' & ;; esac diff --git a/.local/bin/hddumnt b/.local/bin/hddumnt index 1b5da66..d4034ae 100755 --- a/.local/bin/hddumnt +++ b/.local/bin/hddumnt @@ -6,25 +6,25 @@ mountpoint="$HOME/$devname" case "$(hostname -s)" in mother|po-rbo) if ! doas umount "$mountpoint"; then - herbe " failed to dismount $mountpoint" & + herbe "failed to dismount $mountpoint" & fi if ! doas cryptsetup close "$devname"; then - herbe " failed to close crypt dev $devname" & + herbe "failed to close crypt dev $devname" & fi rmdir "$mountpoint" - herbe " crypt dev dismounted from $mountpoint" & + herbe "crypt dev dismounted from $mountpoint" & ;; mars) if ! mount | grep -F /dev/da0p1; then - herbe ' HDD not mounted' & + herbe 'hdd not mounted' & exit 1 fi if ! umount /dev/da0p1.eli; then - herbe ' failed to dismount hdd' & + herbe 'failed to dismount hdd' & exit 1 fi geli detach da0p1.eli rmdir "$HOME"/hdd - herbe ' hdd dismounted from ~/hdd' & + herbe 'hdd dismounted from ~/hdd' & ;; esac |
