From 28f5adcebe208e9961cfff3b2d94fadee3b64b5e Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 16 Jan 2020 16:12:45 +0100 Subject: [PATCH] [UPDATE][SCRIPT] Better notification for touchpad Using a Dunst feature, a notification of the same type can override one that is currently being displayed. --- scripts/toggle-touchpad | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/toggle-touchpad b/scripts/toggle-touchpad index be6175e..e06ee67 100755 --- a/scripts/toggle-touchpad +++ b/scripts/toggle-touchpad @@ -4,10 +4,12 @@ device=11 state=$(xinput list-props "$device" | grep "Device Enabled" | grep -o "[01]$") -if [ "$state" == "1" ];then +if [ "$state" = "1" ];then xinput --disable "$device" - notify-send -t 500 -u low "Toggled touchpad (disabled)" + notify-send -u low "Toggled touchpad (disabled)" \ + -h string:x-canonical-private-synchronous:touchpad # Override previous one else xinput --enable "$device" - notify-send -t 500 -u low "Toggled touchpad (enabled)" + notify-send -u low "Toggled touchpad (enabled)" \ + -h string:x-canonical-private-synchronous:touchpad # Override previous one fi