Skip to content

Instantly share code, notes, and snippets.

@mibli
Created May 6, 2021 10:36
Show Gist options
  • Save mibli/89c02bf6fcd4283e6369fb0124ad7a1b to your computer and use it in GitHub Desktop.
Save mibli/89c02bf6fcd4283e6369fb0124ad7a1b to your computer and use it in GitHub Desktop.
XBox Controller notifications on connect/disconnect
[Unit]
Description=Mopidy
[Service]
ExecStart=sh -c 'journalctl -ft xow | sed -nue "s/.*\s-\s//" -e "/Controller .* \(dis\)\?connected/p;/Battery level:/p" | xargs -I{} notify-send "{}"'
Restart=on-failure
RestartPreventExitStatus=1
SuccessExitStatus=2
RestartForceExitStatus=3 4
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment