From b3111c1ecdb3553656bab95ef5741c14e24417a0 Mon Sep 17 00:00:00 2001 From: Myned Date: Sat, 14 Sep 2024 16:06:18 -0500 Subject: [PATCH] menu: switch to menu.sh wrapper Signed-off-by: Myned --- options/custom/desktops/hyprland/binds.nix | 11 ++--- options/custom/scripts/default.nix | 5 +++ options/custom/scripts/menu.sh | 49 ++++++++++++++++++++++ 3 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 options/custom/scripts/menu.sh diff --git a/options/custom/desktops/hyprland/binds.nix b/options/custom/desktops/hyprland/binds.nix index dbd9dd7..144e607 100644 --- a/options/custom/desktops/hyprland/binds.nix +++ b/options/custom/desktops/hyprland/binds.nix @@ -17,6 +17,7 @@ with lib; let kill = "${pkgs.procps}/bin/kill"; kitty = "${config.home-manager.users.${config.custom.username}.programs.kitty.package}/bin/kitty"; loginctl = "${pkgs.systemd}/bin/loginctl"; + menu = "~/.local/bin/menu"; nautilus = "${pkgs.nautilus}/bin/nautilus"; networkmanager_dmenu = "${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu"; notify-send = "${pkgs.libnotify}/bin/notify-send"; @@ -98,11 +99,11 @@ in { (key "Control_L" "Super+Ctrl+Alt+Shift" "layoutmsg" "removemaster") (key "Control_L" "Super+Ctrl+Shift" "layoutmsg" "addmaster") (key "Shift_L" "Super+Shift" "workspace" "previous") - (key "Super_L" "Super" "exec" "${pkill} wofi || ${wofi} --show drun") - (key "Super_L" "Super+Alt" "exec" "${pkill} wofi || ${rofi-rbw}") - (key "Super_L" "Super+Ctrl" "exec" "${pkill} wofi || calc") - (key "Super_L" "Super+Ctrl+Shift" "exec" "${pkill} wofi || ${networkmanager_dmenu}") - (key "Super_L" "Super+Shift" "exec" "${pkill} wofi || ${wofi} --show run") + (key "Super_L" "Super" "exec" "${menu}") + (key "Super_L" "Super+Alt" "exec" "${menu} --passwords") + (key "Super_L" "Super+Ctrl" "exec" "${menu} --calculator") + (key "Super_L" "Super+Ctrl+Shift" "exec" "${menu} --networks") + (key "Super_L" "Super+Shift" "exec" "${menu} --runner") ]; # Regular binds diff --git a/options/custom/scripts/default.nix b/options/custom/scripts/default.nix index f726943..b81f5b7 100644 --- a/options/custom/scripts/default.nix +++ b/options/custom/scripts/default.nix @@ -97,6 +97,11 @@ in { jq libnotify ]) + (bash "menu" [ + networkmanager_dmenu + rofi-rbw + walker + ]) (bash "minimize" [ hyprland jq diff --git a/options/custom/scripts/menu.sh b/options/custom/scripts/menu.sh new file mode 100644 index 0000000..4c3f538 --- /dev/null +++ b/options/custom/scripts/menu.sh @@ -0,0 +1,49 @@ +#! /usr/bin/env bash + +# Menu wrapper +#?? menu + +command=walker + +while (("$#" > 0)); do + case "$1" in + -a | --applications) + command="walker --modules applications" + ;; + -c | --calculator) + command="walker --modules calc" + ;; + -f | --files) + command="walker --modules finder" + ;; + -i | --input) + command="walker --dmenu" + ;; + -n | --networks) + command="networkmanager_dmenu" + ;; + -p | --passwords) + command="rofi-rbw" + ;; + -r | --runner) + command="walker --modules runner" + ;; + -s | --ssh) + command="walker --modules ssh" + ;; + -u | --unicode) + command="walker --modules emojis" + ;; + -w | --web) + command="walker --modules websearch" + ;; + --) + shift + command+=" $*" + break + ;; + esac + shift +done + +$command