From edc5ccb848cf115bed425f0b1426daa2ac930bf1 Mon Sep 17 00:00:00 2001 From: Myned Date: Mon, 2 Dec 2024 13:43:33 -0600 Subject: [PATCH] walker: use key to close menu instead of service restart Signed-off-by: Myned --- options/custom/desktops/hyprland/plugins.nix | 1 + options/custom/desktops/hyprland/rules.nix | 1 + options/custom/programs/walker/default.nix | 3 +++ options/custom/scripts/menu.sh | 6 +++--- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/options/custom/desktops/hyprland/plugins.nix b/options/custom/desktops/hyprland/plugins.nix index 23a7aa5..df3033f 100644 --- a/options/custom/desktops/hyprland/plugins.nix +++ b/options/custom/desktops/hyprland/plugins.nix @@ -26,6 +26,7 @@ in { "plugin:hyprbars:nobar, floating:0" "plugin:hyprbars:nobar, class:^1Password$, title:^1Password$" "plugin:hyprbars:nobar, class:^clipboard$" + "plugin:hyprbars:nobar, class:^dev\\.benz\\.walker$" "plugin:hyprbars:nobar, class:^discord$, title:^Discord Updater$" "plugin:hyprbars:nobar, class:^dropdown$" "plugin:hyprbars:nobar, class:^moe\\.launcher\\..+$" diff --git a/options/custom/desktops/hyprland/rules.nix b/options/custom/desktops/hyprland/rules.nix index 7b91b90..b4d5d1e 100644 --- a/options/custom/desktops/hyprland/rules.nix +++ b/options/custom/desktops/hyprland/rules.nix @@ -281,6 +281,7 @@ in { (tag.wine ["noborder" "noshadow"]) ### Overrides + (class "dev\\.benz\\.walker" ["noanim" "noshadow" "pin" "stayfocused"]) # Imitate layer (class "org\\.gnome\\.NautilusPreviewer" ["stayfocused"]) # Sushi (class "signal" ["group override new" "tile"]) # Initial window in social group (class "steam_app_1473350" ["workspace 0"]) # (the) Gnorp Apologue diff --git a/options/custom/programs/walker/default.nix b/options/custom/programs/walker/default.nix index 9f4b9c4..ec998c2 100644 --- a/options/custom/programs/walker/default.nix +++ b/options/custom/programs/walker/default.nix @@ -29,6 +29,9 @@ in { activation_mode.disabled = true; # Key chords force_keyboard_focus = true; + # HACK: Window client required to send Esc key on Hyprland + as_window = true; # Disable layer + list = { placeholder = ""; #// show_initial_entries = false; diff --git a/options/custom/scripts/menu.sh b/options/custom/scripts/menu.sh index 57b58ae..b3d53e9 100644 --- a/options/custom/scripts/menu.sh +++ b/options/custom/scripts/menu.sh @@ -6,9 +6,9 @@ # @meta combine-shorts -# HACK: Restart service to close existing menu -if hyprctl -j layers | jq -e '.[][][][] | select(.namespace == "walker")'; then - systemctl --user restart walker.service +# HACK: Send Esc to close menu, requires window instead of layer +if hyprctl -j clients | jq -e '.[] | select(.class == "dev.benz.walker")'; then + hyprctl dispatch sendshortcut ', Escape, class:^dev\.benz\.walker$' exit fi