feat(script): remove redundant session checks and fix bug with polybar + pipewire after suspend

This commit is contained in:
doryan 2024-10-04 00:56:28 +04:00
parent 48f391908a
commit f80fa0607b

View File

@ -63,17 +63,9 @@ run_cmd() {
elif [[ $1 == '--reboot' ]]; then
loginctl reboot
elif [[ $1 == '--suspend' ]]; then
loginctl suspend && betterlockscreen -l blur
loginctl suspend
elif [[ $1 == '--logout' ]]; then
if [[ "$DESKTOP_SESSION" == 'openbox' ]]; then
openbox --exit
elif [[ "$DESKTOP_SESSION" == 'bspwm' ]]; then
bspc quit
elif [[ "$DESKTOP_SESSION" == 'i3' ]]; then
i3-msg exit
elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
fi
bspc quit & pkill pipewire & pkill pipewire-pulse & pkill polybar
fi
else
exit 0
@ -98,8 +90,9 @@ case ${chosen} in
;;
$suspend)
run_cmd --suspend
betterlockscreen -l blur
;;
$logout)
run_cmd --logout & pkill pipewire & pkill pipewire-pulse
run_cmd --logout
;;
esac