From c64aa6e34faa6796dc72771e178ab3e0c4937ffd Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sat, 14 Feb 2026 17:45:00 -0500 Subject: [PATCH] feat(waybar): way better tooltips and interactions --- config/hypr/hyprland.conf | 4 ++-- home/modules/ui.nix | 11 +++++++---- scripts/ctl | 17 ++++++++++++++++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 9d0d1ae..37a7e59 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -72,7 +72,7 @@ bindul = , XF86AudioMute, exec, ctl volume toggle bindul = , XF86MonBrightnessUp, exec, ctl brightness up bindul = , XF86MonBrightnessDown, exec, ctl brightness down -bind = ALT, SPACE, exec, fuzzel --list-executables-in-path +bind = ALT, SPACE, exec, fuzzel bind = ALT, TAB, workspace, previous bind = ALT, A, cyclenext bind = ALT, B, exec, pkill -USR1 waybar || waybar @@ -104,7 +104,7 @@ bind = , XF86Tools, submap, scripts submap = scripts bind = , A, exec, ctl audio out -bind = , C, exec, sh -lc 'cliphist list | fuzzel --dmenu --prompt="clip: " --lines=15 | cliphist decode | wl-copy' +bind = , C, exec, sh -lc 'cliphist list | fuzzel --dmenu --prompt="clip: " | cliphist decode | wl-copy' bind = , K, exec, ctl keyboard toggle bind = , O, exec, ctl ocr bind = , P, exec, hypr pull diff --git a/home/modules/ui.nix b/home/modules/ui.nix index bd34a87..4738447 100644 --- a/home/modules/ui.nix +++ b/home/modules/ui.nix @@ -99,8 +99,9 @@ in "hyprland/language" = { format = "󰌌"; tooltip = true; - tooltip-format = "{long}"; + tooltip-format = "Keyboard Layout: {long}"; on-click = "ctl keyboard toggle"; + on-click-right = "ctl keyboard pick"; }; privacy = { @@ -133,8 +134,9 @@ in }; signal = 1; tooltip = true; - tooltip-format = "{volume}%"; + tooltip-format = "Sink: {desc}\nLevel: {volume}%"; on-click = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + on-click-right = "ctl audio out"; on-scroll-up = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ --limit 1.0"; on-scroll-down = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; }; @@ -146,9 +148,10 @@ in format-disabled = "󰖪"; interval = 10; tooltip = true; - tooltip-format-wifi = "{essid} · {signalStrength}%"; + tooltip-format-wifi = "SSID: {essid}\nStrength: {signalStrength}%\nIP: {ipaddr}"; tooltip-format-ethernet = "{ifname} · {ipaddr}"; tooltip-format-disconnected = "disconnected"; + on-click = "rfkill toggle wifi"; }; battery = { @@ -171,7 +174,7 @@ in }; interval = 30; tooltip = true; - tooltip-format = "{capacity}% · {timeTo}"; + tooltip-format = "Capacity: {capacity}%\n{timeTo}"; }; clock = { diff --git a/scripts/ctl b/scripts/ctl index 1f8c01e..ff8ec16 100755 --- a/scripts/ctl +++ b/scripts/ctl @@ -65,8 +65,23 @@ keyboard) fi fi ;; + pick) + require fuzzel + choice=$(printf 'QWERTY\nDvorak\nColemak' | fuzzel --dmenu --prompt="keyboard: " --lines=3 --no-icons) + [ -z "$choice" ] && exit 0 + case "$choice" in + QWERTY) variant="" ;; + Dvorak) variant="dvorak" ;; + Colemak) variant="colemak" ;; + esac + if [ "$XDG_CURRENT_DESKTOP" = "Hyprland" ]; then + hyprctl keyword input:kb_layout "us,us" + hyprctl keyword input:kb_variant ",$variant" + hyprctl switchxkblayout current 1 + fi + ;; *) - echo "Usage: ctl keyboard {toggle}" >&2 + echo "Usage: ctl keyboard {toggle|pick}" >&2 exit 1 ;; esac