Skip to content

Instantly share code, notes, and snippets.

@kimmoli
Created January 30, 2016 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimmoli/69f15b7fc387152eca4e to your computer and use it in GitHub Desktop.
Save kimmoli/69f15b7fc387152eca4e to your computer and use it in GitHub Desktop.
onyx tristate-switch ambience switcher p.o.c.
#!/bin/bash
evdev_trace -t 0 | while read -r line;
do
if echo $line | grep "0x258.*1" > /dev/null
then
dbus-send --type=method_call --dest=com.jolla.ambienced /com/jolla/ambienced com.jolla.ambienced.setAmbience string:"file:///usr/share/ambience/silent/silent.ambience"
fi
if echo $line | grep "0x259.*1" > /dev/null
then
dbus-send --type=method_call --dest=com.jolla.ambienced /com/jolla/ambienced com.jolla.ambienced.setAmbience string:"file:///usr/share/ambience/sailing/sailing.ambience"
fi
if echo $line | grep "0x25a.*1" > /dev/null
then
dbus-send --type=method_call --dest=com.jolla.ambienced /com/jolla/ambienced com.jolla.ambienced.setAmbience string:"file:///usr/share/ambience/origami/origami.ambience"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment