From: Phillip Berndt Date: Wed, 13 Nov 2019 21:22:20 +0000 (+0100) Subject: Merge pull request #170 from Vladimir-csp/patch-2 X-Git-Tag: 1.9~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2a121899d48fb1cce06986f7fd86b7ea3128d28b;hp=381ec8516b4641defd4789445e68a30ef5ffee05;p=deb_pkgs%2Fautorandr.git Merge pull request #170 from Vladimir-csp/patch-2 regexp and shell --- diff --git a/contrib/listen_lid.sh b/contrib/listen_lid.sh index 7288490..6daad53 100755 --- a/contrib/listen_lid.sh +++ b/contrib/listen_lid.sh @@ -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 diff --git a/contrib/systemd/autorandr-lid-listener.service b/contrib/systemd/autorandr-lid-listener.service index a6776ee..1d8b60d 100644 --- a/contrib/systemd/autorandr-lid-listener.service +++ b/contrib/systemd/autorandr-lid-listener.service @@ -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