diff --git a/sway/icons/touchpad_disabled.png b/sway/icons/touchpad_disabled.png new file mode 100644 index 0000000..c54cfb9 Binary files /dev/null and b/sway/icons/touchpad_disabled.png differ diff --git a/sway/icons/touchpad_disabled.svg b/sway/icons/touchpad_disabled.svg new file mode 100644 index 0000000..ccd0178 --- /dev/null +++ b/sway/icons/touchpad_disabled.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + diff --git a/sway/icons/touchpad_enabled.png b/sway/icons/touchpad_enabled.png new file mode 100644 index 0000000..82ef6dd Binary files /dev/null and b/sway/icons/touchpad_enabled.png differ diff --git a/sway/icons/touchpad_enabled.svg b/sway/icons/touchpad_enabled.svg new file mode 100644 index 0000000..3273094 --- /dev/null +++ b/sway/icons/touchpad_enabled.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + diff --git a/sway/toggle_touchpad b/sway/toggle_touchpad index 17ab6a6..9d1f059 100755 --- a/sway/toggle_touchpad +++ b/sway/toggle_touchpad @@ -1,5 +1,7 @@ #!/bin/sh +cd "$(dirname "$0")" + current_state() { swaymsg -t get_inputs | jq -r 'map(select(.type == "touchpad")) | .[0].libinput.send_events' } @@ -12,3 +14,11 @@ if [ "$(current_state)" == disabled_on_external_mouse ]; then else set_state toggle enabled disabled fi + +state=$(current_state) +case $state in + enabled) image=icons/touchpad_enabled.png; ;; + disabled) image=icons/touchpad_disabled.png; ;; + *) image=""; ;; +esac +wl-overlay --time=1000 "$image" "Touchpad $state"