]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Merge pull request #170 from Vladimir-csp/patch-2
authorPhillip Berndt <phillip.berndt@googlemail.com>
Wed, 13 Nov 2019 21:22:20 +0000 (22:22 +0100)
committerGitHub <noreply@github.com>
Wed, 13 Nov 2019 21:22:20 +0000 (22:22 +0100)
regexp and shell

contrib/listen_lid.sh
contrib/systemd/autorandr-lid-listener.service

index 7288490d05c94064c22eaec5995ef18ea23c5ddf..6daad5375feb5b9804a44bb8194c68a988577ef3 100755 (executable)
@@ -1,10 +1,10 @@
-#!/bin/bash
+#!/bin/sh
 #
 # /!\ You must be part of the input group
 # sudo gpasswd -a $USER input
 
 stdbuf -oL libinput debug-events | \
-    egrep --line-buffered '^ event[0-9]+\s+SWITCH_TOGGLE\s' | \
+    egrep --line-buffered '^[\s-]+event[0-9]+\s+SWITCH_TOGGLE\s' | \
     while read line; do
     autorandr --change --default default
 done
index a6776ee887a93201b61996dc55cf109cbcfa3b2f..1d8b60d9c1ee276d8c8eb782cfb53baa0eda4627 100644 (file)
@@ -3,7 +3,7 @@ Description=Runs autorandr whenever the lid state changes
 
 [Service]
 Type=simple
-ExecStart=bash -c "stdbuf -oL libinput debug-events | egrep --line-buffered '^ event[0-9]+\s+SWITCH_TOGGLE\s' | while read line; do autorandr --batch --change --default default; done"
+ExecStart=sh -c "stdbuf -oL libinput debug-events | egrep --line-buffered '^[\s-]+event[0-9]+\s+SWITCH_TOGGLE\s' | while read line; do autorandr --batch --change --default default; done"
 Restart=always
 RestartSec=30
 SyslogIdentifier=autorandr