Are you disappointed with the OP5 alert slider? Have you ever wished you could expand it's functionality? Well now you can!
I wanted to share a project I've been working on that reacts to the alert slider position. This REQUIRES root as the profile is triggered when the following file has been modified:
/sys/class/switch/tri-state-key/state
This file contains a single integer which coincides to the slider position:
1 (up)
2 (middle)
3 (down)
Isn't there a simpler way (no root)?
I don't think so. As I understand, the alert slider does not send traditional key events (as most buttons do), and although you could monitor the DND status through the %INTERRUPT variable, DND can be triggered independently of the slider position so is not robust.
Fine, I'm rooted and can see the file. How does that help?
When the slider is moved, the following events happen:
1. The file is opened
2. The file is modified (example, change from 1 to 2)
3. The file is closed.
The 'Slider Position' profile is triggered by the 'File Closed' event, then the 'slider' task reads the file to assign the global variable %Slider based on the file's value. From here, you're free to use the variable value to trigger any task when %Slider matches up, mid, or down.
Splendid! So this gives me ABSOLUTE POWER over the slider?!
Not quite. I haven't found a way to replace the stock functions as much as expand on them. For example, the top position natively puts the phone into silent mode. If you create a task to take it out of silent mode, the OOS overrides it, and keeps the phone in silent. So you'll have to work within the confines of the native function, hence enhancement
Lame. So what's it good for?
Here's how the profile is setup now. I'd love to see what your clever minds come up with!
UP: Asleep (all radios off, mobile data off, sync off, battery saver on). Basically dead to the world except calls.
MID: Nothing yet, maybe I'll do some intermediate between the two extremes.
DOWN: Awake (all radios on, data on, sync on, battery saver off). Typical setting for standard usage.
Other ideas:
Coma mode: sleep mode + airplane with or without periodic check in.
Autovoice continuous on/off
Home/work/night profiles
Reading/night modes, invert colors
Auto brightness/rotate
Flashlight
Hotspot
Since I'm a dork and can't figure out how to attach a project zip or thumbnails, here's some screenshots.
I wanted to share a project I've been working on that reacts to the alert slider position. This REQUIRES root as the profile is triggered when the following file has been modified:
/sys/class/switch/tri-state-key/state
This file contains a single integer which coincides to the slider position:
1 (up)
2 (middle)
3 (down)
Isn't there a simpler way (no root)?
I don't think so. As I understand, the alert slider does not send traditional key events (as most buttons do), and although you could monitor the DND status through the %INTERRUPT variable, DND can be triggered independently of the slider position so is not robust.
Fine, I'm rooted and can see the file. How does that help?
When the slider is moved, the following events happen:
1. The file is opened
2. The file is modified (example, change from 1 to 2)
3. The file is closed.
The 'Slider Position' profile is triggered by the 'File Closed' event, then the 'slider' task reads the file to assign the global variable %Slider based on the file's value. From here, you're free to use the variable value to trigger any task when %Slider matches up, mid, or down.
Splendid! So this gives me ABSOLUTE POWER over the slider?!
Not quite. I haven't found a way to replace the stock functions as much as expand on them. For example, the top position natively puts the phone into silent mode. If you create a task to take it out of silent mode, the OOS overrides it, and keeps the phone in silent. So you'll have to work within the confines of the native function, hence enhancement
Lame. So what's it good for?
Here's how the profile is setup now. I'd love to see what your clever minds come up with!
UP: Asleep (all radios off, mobile data off, sync off, battery saver on). Basically dead to the world except calls.
MID: Nothing yet, maybe I'll do some intermediate between the two extremes.
DOWN: Awake (all radios on, data on, sync on, battery saver off). Typical setting for standard usage.
Other ideas:
Coma mode: sleep mode + airplane with or without periodic check in.
Autovoice continuous on/off
Home/work/night profiles
Reading/night modes, invert colors
Auto brightness/rotate
Flashlight
Hotspot
Since I'm a dork and can't figure out how to attach a project zip or thumbnails, here's some screenshots.
Last edited: