From 880deccb7526d1ea4688ba6e2dfaac9b823b1a66 Mon Sep 17 00:00:00 2001 From: Myned Date: Sun, 15 Sep 2024 17:41:21 -0500 Subject: [PATCH] menu: switch to walker Signed-off-by: Myned --- options/custom/desktops/hyprland/binds.nix | 5 +- options/custom/desktops/hyprland/settings.nix | 5 +- options/custom/programs/walker/default.nix | 57 +++++++++++++++---- options/custom/programs/walker/style.css | 3 +- options/custom/scripts/menu.sh | 28 +++++---- 5 files changed, 71 insertions(+), 27 deletions(-) diff --git a/options/custom/desktops/hyprland/binds.nix b/options/custom/desktops/hyprland/binds.nix index 144e607..284a5d8 100644 --- a/options/custom/desktops/hyprland/binds.nix +++ b/options/custom/desktops/hyprland/binds.nix @@ -26,6 +26,7 @@ with lib; let pkill = "${pkgs.procps}/bin/pkill"; playerctl = "${pkgs.playerctl}/bin/playerctl"; rofi-rbw = "${pkgs.rofi-rbw}/bin/rofi-rbw"; + rm = "${pkgs.coreutils}/bin/rm"; sleep = "${pkgs.coreutils}/bin/sleep"; steam = "${config.programs.steam.package}/bin/steam"; swayosd-client = "${pkgs.swayosd}/bin/swayosd-client"; @@ -228,8 +229,8 @@ in { (key "T" "Super" "togglespecialworkspace" "terminal") (key "T" "Super+Shift" "movetoworkspacesilent" "terminal") (key "T" "Super+Shift" "exec" kitty) - (key "V" "Super" "exec" "${kitty} --app-id clipboard --override font_size=12 ${clipse}") - (key "V" "Super+Shift" "exec" "${clipse} -clear && ${notify-send} clipse 'Clipboard cleared' --urgency low") + (key "V" "Super" "exec" "${menu} --clipboard") + (key "V" "Super+Shift" "exec" "${rm} ~/.cache/walker/clipboard.gob; ${notify-send} walker 'Clipboard cleared' --urgency low") (key "W" "Super" "togglespecialworkspace" "vm") (key "W" "Super+Ctrl" "exec" "vm -x ${ if config.custom.hidpi diff --git a/options/custom/desktops/hyprland/settings.nix b/options/custom/desktops/hyprland/settings.nix index 1ec1151..77dfa3b 100644 --- a/options/custom/desktops/hyprland/settings.nix +++ b/options/custom/desktops/hyprland/settings.nix @@ -64,10 +64,9 @@ in { # https://wiki.hyprland.org/Configuring/Keywords/#executing exec-once = [ - "${rm} ~/.config/qalculate/qalc.dmenu.history" # Clear calc history - "${clipse} -clear" # Clear clipboard history - "${clipse} -listen" # Monitor clipboard + "${rm} ~/.cache/walker/clipboard.gob" # Clear clipboard sway-audio-idle-inhibit # Inhibit idle while audio is playing + left # Left-handed at boot # TODO: Remove when systemd service fixed # https://github.com/Alexays/Waybar/issues/2882 diff --git a/options/custom/programs/walker/default.nix b/options/custom/programs/walker/default.nix index 925fff6..b469f79 100644 --- a/options/custom/programs/walker/default.nix +++ b/options/custom/programs/walker/default.nix @@ -24,16 +24,50 @@ in { #?? systemctl --user restart walker.service runAsService = true; + # https://github.com/abenz1267/walker/wiki/Basic-Configuration # https://github.com/abenz1267/walker/blob/master/internal/config/config.default.json config = { - activation_mode.labels = ""; # Chord indicators + activation_mode.disabled = true; # Key chords + ignore_mouse = true; # Hover interrupts keyboard selections search.placeholder = ""; + # https://github.com/abenz1267/walker/wiki/Modules + # https://www.nerdfonts.com/cheat-sheet builtins = { + calculator.switcher_only = false; + clipboard.switcher_only = true; + commands.switcher_only = true; + custom_commands.switcher_only = true; + runner.switcher_only = true; + ssh.switcher_only = true; + windows.switcher_only = true; + applications = { - actions = false; # Desktop file actions - prioritize_new = false; - show_sub_when_single = false; # Subtext with one module + # BUG: Ghost entries are still visible + #// actions = false; # Desktop file actions + + switcher_only = false; + weight = 10; + }; + + dmenu = { + placeholder = "Input"; + switcher_only = true; + }; + + emojis = { + placeholder = "Unicode"; + switcher_only = false; + }; + + finder = { + placeholder = "Files"; + switcher_only = true; + }; + + websearch = { + placeholder = "Search"; + switcher_only = true; }; }; }; @@ -42,21 +76,24 @@ in { theme = { style = builtins.readFile ./style.css; - # https://github.com/abenz1267/walker/blob/master/internal/config/themes/bare.json + # https://github.com/abenz1267/walker/blob/master/internal/config/layout.default.json layout.ui.window.box = rec { - height = 500 / config.custom.scale; + height = 250 / config.custom.scale; width = 1000 / config.custom.scale; scroll.list = { - min_height = height; max_height = height; max_width = width; min_width = width; # Icon resolution - item.icon = { - icon_size = "largest"; # 128px - pixel_size = 32; + item = { + text.sub.hide = true; # Subtext + + icon = { + icon_size = "largest"; # 128px + pixel_size = 32; # Downscale + }; }; }; }; diff --git a/options/custom/programs/walker/style.css b/options/custom/programs/walker/style.css index 020dc16..c0d1a35 100644 --- a/options/custom/programs/walker/style.css +++ b/options/custom/programs/walker/style.css @@ -21,6 +21,7 @@ https://docs.gtk.org/gtk4/css-properties.html /* Input box */ #search entry { border-radius: 25px; + margin-bottom: 4px; padding: 4px; } @@ -37,7 +38,7 @@ https://docs.gtk.org/gtk4/css-properties.html /* List entry */ #list child { border-radius: 25px; - margin: 4px 0; + margin: 2px 8px; padding: 8px; } diff --git a/options/custom/scripts/menu.sh b/options/custom/scripts/menu.sh index 4c3f538..ddfb9fe 100644 --- a/options/custom/scripts/menu.sh +++ b/options/custom/scripts/menu.sh @@ -7,35 +7,41 @@ command=walker while (("$#" > 0)); do case "$1" in - -a | --applications) + --applications) command="walker --modules applications" ;; - -c | --calculator) + --calculator) command="walker --modules calc" ;; - -f | --files) + --clipboard) + command="walker --modules clipboard" + ;; + --files) command="walker --modules finder" ;; - -i | --input) + --input) command="walker --dmenu" ;; - -n | --networks) + --networks) command="networkmanager_dmenu" ;; - -p | --passwords) + --passwords) command="rofi-rbw" ;; - -r | --runner) + --runner) command="walker --modules runner" ;; - -s | --ssh) + --search) + command="walker --modules websearch" + ;; + --ssh) command="walker --modules ssh" ;; - -u | --unicode) + --unicode) command="walker --modules emojis" ;; - -w | --web) - command="walker --modules websearch" + --windows) + command="walker --modules windows" ;; --) shift