]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/blobdiff - contrib/listen_lid.sh
Add a leading slash to Debian conffiles paths
[deb_pkgs/autorandr.git] / contrib / listen_lid.sh
index 8283d374e3d2563ab1d095c9e6ea82dda98f69d7..8de7eb64e8dfc1ab9c4b4c0d0205f60d4769a8da 100755 (executable)
@@ -1,8 +1,10 @@
-#!/bin/bash
+#!/bin/sh
 #
 # /!\ 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 | \
+    grep -E --line-buffered '^[[:space:]-]+event[0-9]+[[:space:]]+SWITCH_TOGGLE[[:space:]]' | \
+    while read line; do
     autorandr --change --default default
 done