-#!/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
[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