Files
arthur-os/bin/omarchy-toggle-touchpad
T
d2a4cc0c4d Add omarchy CLI (#5477)
* Add omarchy CLI

* Remove outdated or internal

* Add bash completions for command

* Add omarchy command documentation

* Add missing docs

* Correct to what's now right

* Fix tests

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
2026-05-01 17:40:22 +02:00

33 lines
919 B
Bash
Executable File

#!/bin/bash
# omarchy:summary=Enable, disable, or toggle the touchpad
# omarchy:args=[on|off|toggle]
STATE_CONF="$HOME/.local/state/omarchy/toggles/hypr/touchpad-disabled.conf"
device="$(omarchy-hw-touchpad)"
if [[ -z $device ]]; then
echo "No touchpad device found" >&2
exit 1
fi
enable() {
hyprctl keyword "device[$device]:enabled" true >/dev/null
rm -f "$STATE_CONF"
omarchy-swayosd-client --custom-icon input-touchpad-symbolic --custom-message "Touchpad enabled"
}
disable() {
hyprctl keyword "device[$device]:enabled" false >/dev/null
mkdir -p "$(dirname "$STATE_CONF")"
printf 'device {\n name = %s\n enabled = false\n}\n' "$device" > "$STATE_CONF"
omarchy-swayosd-client --custom-icon touchpad-disabled-symbolic --custom-message "Touchpad disabled"
}
case "${1:-toggle}" in
on) enable ;;
off) disable ;;
toggle) if [[ -f $STATE_CONF ]]; then enable; else disable; fi ;;
esac