Bruno BELANYI
28f5adcebe
Using a Dunst feature, a notification of the same type can override one that is currently being displayed.
16 lines
498 B
Bash
Executable file
16 lines
498 B
Bash
Executable file
#! /bin/sh
|
|
|
|
# Device id according to xinput list
|
|
device=11
|
|
state=$(xinput list-props "$device" | grep "Device Enabled" | grep -o "[01]$")
|
|
|
|
if [ "$state" = "1" ];then
|
|
xinput --disable "$device"
|
|
notify-send -u low "Toggled touchpad (disabled)" \
|
|
-h string:x-canonical-private-synchronous:touchpad # Override previous one
|
|
else
|
|
xinput --enable "$device"
|
|
notify-send -u low "Toggled touchpad (enabled)" \
|
|
-h string:x-canonical-private-synchronous:touchpad # Override previous one
|
|
fi
|