pipe=lirc-remote-control-$$ mkfifo -- "$pipe" xdotool - < "$pipe" & exec 9>"$pipe" rm -f -- "$pipe" sendkey() { printf 'key --clearmodifiers %s\n' "$*" >&9; } sudo stdbuf -oL -- ir-keytable -c -w "$keymap" -D 500 -P 125 -t | while IFS=' ' read -r _ _ _ _ state key; do if [ "$state" = key_down: ]; then case $key in KEY_POWER*) systemctl suspend ;;