mirror of
https://github.com/vanilla-wiiu/vanilla.git
synced 2026-10-28 09:43:51 +00:00
16 lines
383 B
Bash
Executable File
16 lines
383 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Listen for power button presses, in which case quit Vanilla (which should in turn reboot the Switch)
|
|
|
|
DEV=/dev/input/event0
|
|
APP=vanilla
|
|
|
|
evtest "$DEV" 2>/dev/null | while read -r line; do
|
|
case "$line" in
|
|
*KEY_SLEEP*,\ value\ 1*)
|
|
pid="$(pidof "$APP" | awk '{print $1}')"
|
|
[ -n "$pid" ] && kill -TERM "$pid"
|
|
;;
|
|
esac
|
|
done
|