Skip to content

Instantly share code, notes, and snippets.

@skammer
Created November 16, 2023 01:49
Show Gist options
  • Save skammer/ed6609d9b0083ca63afef579410c2a81 to your computer and use it in GitHub Desktop.
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.
#!/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