From 025b243c4845c8e23a777ece3bc1ec7727710a16 Mon Sep 17 00:00:00 2001 From: Oleksandr Smirnov Date: Mon, 9 Jun 2025 20:53:27 +0300 Subject: [PATCH] bin: update power menu script to handle both and hypr and niri --- bin/wofi-power-menu | 7 ++++++- config/hypr/hyprland.conf | 2 +- config/niri/config.kdl | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/wofi-power-menu b/bin/wofi-power-menu index ec66790..168521c 100755 --- a/bin/wofi-power-menu +++ b/bin/wofi-power-menu @@ -18,7 +18,12 @@ shall_continue() { } case $selected in -logout) shall_continue hyprctl dispatch exit ;; +logout) + case $1 in + "niri") shall_continue niri msg action quit ;; + "hypr") shall_continue hyprctl dispatch exit ;; + esac + ;; suspend) shall_continue systemctl suspend ;; reboot) shall_continue systemctl reboot ;; poweroff) shall_continue systemctl poweroff ;; diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 25ef55f..a47c4c9 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -150,7 +150,7 @@ windowrulev2 = rounding 0, floating:0, onworkspace:f[1] bind = $mod, Return, exec, $terminal bind = $mod SHIFT, Return, exec, wofi --show drun --allow-images - bind = $mod SHIFT, Escape, exec, ~/bin/wofi-power-menu + bind = $mod SHIFT, Escape, exec, ~/bin/wofi-power-menu,hypr bind = $mod, f, fullscreen bind = $mod Ctrl, f, togglefloating diff --git a/config/niri/config.kdl b/config/niri/config.kdl index f7eba18..14f32c2 100644 --- a/config/niri/config.kdl +++ b/config/niri/config.kdl @@ -165,7 +165,7 @@ binds { Mod+Q { close-window; } Mod+Return { spawn "kitty"; } Mod+Shift+Return { spawn "wofi" "--show" "drun"; } - Mod+Shift+Escape { spawn "~/bin/wofi-power-menu"; } + Mod+Shift+Escape { spawn "~/bin/wofi-power-menu" "niri";} Super+Alt+L { spawn "swaylock"; } // TODO: change to hyprlock // programs {{{