diff options
Diffstat (limited to 'scripts/rofi-powermenu')
| -rwxr-xr-x | scripts/rofi-powermenu | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/rofi-powermenu b/scripts/rofi-powermenu index 6209944..57d3fe8 100755 --- a/scripts/rofi-powermenu +++ b/scripts/rofi-powermenu @@ -1,18 +1,18 @@ #!/usr/bin/env bash power_args=$(printf '%b' ' Lock\nLogout\n Restart\n Suspend\n Hibernate\n Shutdown' | - rofi -dmenu -p " " -i -theme-str 'window {width: 12em; padding: 2px; height: 16em;}') + rofi -dmenu -p "" -i -theme-str 'window {width: 12em; padding: 2px; height: 16em;}') case "$power_args" in *Lock) - if [[ "$XDG_CURRENT_DESKTOP" == "niri" ]]; then + if [[ -n "$NIRI_SOCKET" ]]; then command -v swaylock &>/dev/null && swaylock elif [[ "$XDG_CURRENT_DESKTOP" == "Hyprland" ]]; then hyprlock fi ;; *Logout) - if [[ "$XDG_CURRENT_DESKTOP" == "niri" ]]; then + if [[ -n "$NIRI_SOCKET" ]]; then niri msg action quit elif [[ "$XDG_CURRENT_DESKTOP" == "Hyprland" ]]; then hyprctl dispatch exit @@ -28,7 +28,7 @@ case "$power_args" in systemctl hibernate ;; *Shutdown) - if [[ "$XDG_CURRENT_DESKTOP" == "niri" ]]; then + if [[ -n "$NIRI_SOCKET" ]]; then systemctl poweroff elif [[ "$XDG_CURRENT_DESKTOP" == "Hyprland" ]]; then hyprctl dispatch killactive && sleep 0.1 && hyprctl dispatch killactive && sleep 0.1 && systemctl poweroff |
