From b03a14ba635a8351d9b54cebad2967d26bf2da82 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 17 Jul 2019 17:41:46 +0200 Subject: [PATCH] [ADD][I3] Touchpad toggle & display settings keys --- i3/.config/i3/config | 4 ++++ scripts/toggle_touchpad | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100755 scripts/toggle_touchpad diff --git a/i3/.config/i3/config b/i3/.config/i3/config index b67fb65..bff6db9 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -209,6 +209,10 @@ bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks bindsym XF86AudioRaiseVolume exec amixer -q -D pulse sset Master 5%+ && pkill -RTMIN+10 i3blocks bindsym XF86AudioLowerVolume exec amixer -q -D pulse sset Master 5%- && pkill -RTMIN+10 i3blocks bindsym XF86AudioMute exec amixer -q -D pulse sset Master toggle && pkill -RTMIN+10 i3blocks +# Bind keyboard settings key to toggle touchpad +bindsym XF86Tools exec toggle_touchpad +# Bind display control to launch arandr +bindsym XF86Display exec arandr # Bind sreen brightness controls bindsym XF86MonBrightnessUp exec xbacklight -inc 10 diff --git a/scripts/toggle_touchpad b/scripts/toggle_touchpad new file mode 100755 index 0000000..657f325 --- /dev/null +++ b/scripts/toggle_touchpad @@ -0,0 +1,11 @@ +#! /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" +else + xinput --enable "$device" +fi