diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-20 21:55:13 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-20 21:55:13 -0400 |
| commit | b7e6728082ce9a5a010736cb08ca7f8bb64c7a58 (patch) | |
| tree | 1e19795b9adced6f1fb962b86ef99722a9e44b2a /dotfiles/hyprland/.config/waybar | |
| parent | 0051671d0cff859ad3a67a21714005714ae1f752 (diff) | |
| download | archsetup-b7e6728082ce9a5a010736cb08ca7f8bb64c7a58.tar.gz archsetup-b7e6728082ce9a5a010736cb08ca7f8bb64c7a58.zip | |
feat(hyprland): add touchpad state indicator to waybar
The $mod+F9 toggle and the toggle-touchpad / touchpad-auto scripts already worked, but the scripts lived only in ~/.local/bin and were never committed, and there was no way to see the touchpad's state at a glance.
I committed both scripts into the repo so stow installs them, and added a waybar indicator: a waybar-touchpad status script and a custom/touchpad module that shows a mouse glyph when the touchpad is on and a mouse-off glyph (in the dupre orange) when it's off. The scripts signal the module with pkill -RTMIN+9 waybar after each state change, so the icon updates the moment the touchpad toggles. touchpad-auto now runs at login via exec-once.
The waybar-touchpad script has unit tests under tests/waybar-touchpad/ covering the enabled, disabled, and missing-state-file cases.
Diffstat (limited to 'dotfiles/hyprland/.config/waybar')
| -rw-r--r-- | dotfiles/hyprland/.config/waybar/config | 8 | ||||
| -rw-r--r-- | dotfiles/hyprland/.config/waybar/style.css | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/dotfiles/hyprland/.config/waybar/config b/dotfiles/hyprland/.config/waybar/config index 55ca359..2ae43fe 100644 --- a/dotfiles/hyprland/.config/waybar/config +++ b/dotfiles/hyprland/.config/waybar/config @@ -17,6 +17,7 @@ "group/sysmonitor", "custom/netspeed", "pulseaudio", + "custom/touchpad", "idle_inhibitor", "custom/pocketbook", "tray", @@ -141,6 +142,13 @@ "on-scroll-down": "pactl set-sink-volume @DEFAULT_SINK@ -5%" }, + "custom/touchpad": { + "exec": "waybar-touchpad", + "return-type": "json", + "signal": 9, + "on-click": "toggle-touchpad" + }, + "idle_inhibitor": { "format": "<span size='large'>{icon}</span>", "format-icons": { diff --git a/dotfiles/hyprland/.config/waybar/style.css b/dotfiles/hyprland/.config/waybar/style.css index 3f7814b..3a849c5 100644 --- a/dotfiles/hyprland/.config/waybar/style.css +++ b/dotfiles/hyprland/.config/waybar/style.css @@ -76,6 +76,7 @@ window#waybar { #custom-date, #custom-worldclock, #custom-layout, +#custom-touchpad, #window { padding: 0.45rem; margin: 0.3rem; @@ -96,6 +97,7 @@ window#waybar { #custom-netspeed:hover, #pulseaudio:hover, #sysmonitor:hover, +#custom-touchpad:hover, #custom-layout:hover { background-color: #474544; border-radius: 1rem; @@ -106,6 +108,10 @@ window#waybar { color: #d47c59; } +#custom-touchpad.disabled { + color: #d47c59; +} + #temperature.warning { color: #d7af5f; } |
