]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/blobdiff - contrib/listen_lid.sh
account for occasional dash prefix, use sh
[deb_pkgs/autorandr.git] / contrib / listen_lid.sh
index 8283d374e3d2563ab1d095c9e6ea82dda98f69d7..7288490d05c94064c22eaec5995ef18ea23c5ddf 100755 (executable)
@@ -3,6 +3,8 @@
 # /!\ You must be part of the input group
 # sudo gpasswd -a $USER input
 
-stdbuf -oL libinput debug-events | grep --line-buffered SWITCH_TOGGLE | while read line; do
+stdbuf -oL libinput debug-events | \
+    egrep --line-buffered '^ event[0-9]+\s+SWITCH_TOGGLE\s' | \
+    while read line; do
     autorandr --change --default default
 done