diff options
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 |