From f80fa0607bb4ce23cd20cf9ad2a7d761289964f6 Mon Sep 17 00:00:00 2001 From: doryan Date: Fri, 4 Oct 2024 00:56:28 +0400 Subject: [PATCH] feat(script): remove redundant session checks and fix bug with polybar + pipewire after suspend --- rofi/power/launch.sh | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/rofi/power/launch.sh b/rofi/power/launch.sh index d2c0aa2..fac181f 100755 --- a/rofi/power/launch.sh +++ b/rofi/power/launch.sh @@ -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