Created
November 16, 2023 01:49
-
-
Save skammer/ed6609d9b0083ca63afef579410c2a81 to your computer and use it in GitHub Desktop.
Aurora OS flashlight toggle script. Watches over the unused orange button on the R570E phone.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
COUNTER=0 | |
cat /dev/input/event1 | \ | |
while IFS= read -s -d '' -r -n1 foo ; do | |
if [ "$foo" == "<" ] | |
then | |
let COUNTER=COUNTER+1 | |
if [ $((COUNTER%2)) -eq 0 ]; | |
then | |
dbus-send --type=method_call --dest=com.jolla.settings.system.flashlight /com/jolla/settings/system/flashlight com.jolla.settings.system.flashlight.toggleFlashlight; | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment