feat: Add Touchpad toggle/on/off support (#5353)

* feat: add touchpad toggle keybinding and script

Binds XF86TouchpadToggle/On/Off to a new leenium-toggle-touchpad script
that enables/disables the touchpad via hyprctl and shows OSD feedback.

* fix: make XF86TouchpadOn/Off enforce state instead of toggling

Add on/off/toggle argument support to omarchy-toggle-touchpad.
XF86TouchpadOn now always enables and XF86TouchpadOff always disables,
so firmware that emits separate On/Off keysyms behaves correctly regardless
of current state. XF86TouchpadToggle retains the invert behavior.

* feat: add touchpad toggle to menu and persist state as hyprland config

- Show touchpad option in toggle menu only when a touchpad/trackpad device is detected
- Replace /tmp state file with a persistent hyprland device config at
~/.local/state/omarchy/toggles/hypr/touchpad-disabled.conf

* fix: avoid unsafe && || toggle logic for Touchpad state

Replace `[[ -f $STATE_CONF ]] && enable || disable` with an explicit if/else.
The previous logic was not a true ternary: if `enable` failed (e.g. OSD command error),
`disable` would run unintentionally, causing unreliable toggle behavior.
This commit is contained in:
DrunkLeen
2026-04-22 12:59:43 +02:00
committed by GitHub
parent 37189368fb
commit d00b3ea24b
3 changed files with 53 additions and 1 deletions
+3
View File
@@ -11,6 +11,9 @@ bindeld = ,XF86MonBrightnessDown, Brightness down, exec, omarchy-brightness-disp
bindeld = ,XF86KbdBrightnessUp, Keyboard brightness up, exec, omarchy-brightness-keyboard up
bindeld = ,XF86KbdBrightnessDown, Keyboard brightness down, exec, omarchy-brightness-keyboard down
bindld = ,XF86KbdLightOnOff, Keyboard backlight cycle, exec, omarchy-brightness-keyboard cycle
bindld = ,XF86TouchpadToggle, Toggle touchpad, exec, omarchy-toggle-touchpad
bindld = ,XF86TouchpadOn, Enable touchpad, exec, omarchy-toggle-touchpad on
bindld = ,XF86TouchpadOff, Disable touchpad, exec, omarchy-toggle-touchpad off
# Precise 1% multimedia adjustments with Alt modifier
bindeld = ALT, XF86AudioRaiseVolume, Volume up precise, exec, $osdclient --output-volume +1