diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2022-05-17 06:10:02 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2022-05-17 06:10:02 +0300 |
commit | 484181c25cba61469254e24bff578cff5189c8a7 (patch) | |
tree | 6bb3b33b3c710467a6f0463912b929f2e039cd90 /dotfiles/.local/bin/swaysession | |
parent | 0b065dc2c0cae46c4f6151483249a682db122eb6 (diff) | |
download | swayrice-484181c25cba61469254e24bff578cff5189c8a7.tar.gz swayrice-484181c25cba61469254e24bff578cff5189c8a7.zip |
WIP: move to rofi
Diffstat (limited to 'dotfiles/.local/bin/swaysession')
-rwxr-xr-x | dotfiles/.local/bin/swaysession | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/dotfiles/.local/bin/swaysession b/dotfiles/.local/bin/swaysession index c4fa4db..2234c11 100755 --- a/dotfiles/.local/bin/swaysession +++ b/dotfiles/.local/bin/swaysession @@ -1,8 +1,6 @@ #!/bin/sh -# /usr/bin/i3exit -# on void just sudo -[[ $(cat /proc/1/comm) == "systemd" ]] && logind=systemctl || logind=loginctl +[ "$(cat /proc/1/comm)" = "systemd" ] && logind=systemctl || logind=loginctl case "$1" in lock) @@ -29,8 +27,11 @@ case "$1" in $logind poweroff ;; *) - echo "== ! i3exit: missing or invalid argument ! ==" - echo "Try again with: lock | logout | switch_user | suspend | hibernate | reboot | shutdown" + if [ "$SWAYSESSION_GUI" = 1 ]; then + notify-send "🖥 swaysession" "Invalid option" + else + echo "swaysession: missing or invalid argument" + fi exit 2 esac |