summaryrefslogtreecommitdiffstats
path: root/.local/bin/powercmd
diff options
context:
space:
mode:
authorjoe <rbo@gmx.us>2025-10-01 18:04:18 +0200
committerjoe <rbo@gmx.us>2025-10-01 18:04:18 +0200
commit74ecc98e528eac979e0820c9fa48955a186c0cc1 (patch)
treebe754babad6341d504daa4fe8c8433ca428fa595 /.local/bin/powercmd
parentup (diff)
downloaddotfiles-bsd-74ecc98e528eac979e0820c9fa48955a186c0cc1.tar.gz
dotfiles-bsd-74ecc98e528eac979e0820c9fa48955a186c0cc1.tar.bz2
dotfiles-bsd-74ecc98e528eac979e0820c9fa48955a186c0cc1.tar.xz
dotfiles-bsd-74ecc98e528eac979e0820c9fa48955a186c0cc1.tar.zst
dotfiles-bsd-74ecc98e528eac979e0820c9fa48955a186c0cc1.zip
up
Diffstat (limited to '')
-rwxr-xr-x.local/bin/powercmd49
1 files changed, 0 insertions, 49 deletions
diff --git a/.local/bin/powercmd b/.local/bin/powercmd
deleted file mode 100755
index 6e6c613..0000000
--- a/.local/bin/powercmd
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-
-[ -z "$1" ] && echo "no arg" && exit 1
-
-host="$(hostname -s)"
-case $host in
- mother) icon=" " ;;
- po-rbo) icon=" " ;;
- mars) icon=" " ;;
-esac
-
-case $1 in
- "lock") xscreensaver-command -lock ;;
- "sleep")
- notify-send -u normal "sleep" "$icon G'night, partner!"
- sleep 1
- xscreensaver-command -lock
- sleep 5
- case $host in
- mother) loginctl suspend ;;
- po-rbo) systemctl suspend ;;
- mars) acpiconf -s 3 ;;
- esac
- ;;
- "reboot")
- emacsclient -e '"(save-buffers-kill-emacs)"' >/dev/null 2>&1
- notify-send -u normal reboot "$icon Rebootin' now!"
- sleep 2
- case $host in
- mother) loginctl reboot ;;
- po-rbo) systemctl reboot ;;
- mars) shutdown -r now ;;
- esac
- ;;
- "poweroff")
- emacsclient -e '"(save-buffers-kill-emacs)"' >/dev/null 2>&1
- notify-send -u normal poweroff "$icon Farewell, partner!"
- sleep 2
- case $host in
- mother) loginctl poweroff ;;
- po-rbo) systemctl poweroff ;;
- mars) shutdown -p now ;;
- esac
- ;;
- *)
- echo "wrong arg"
- exit 1
- ;;
-esac