[Tasker] Alert Slider Enhancement

One92

Member
Aug 10, 2017
10
27
0
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 :p

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:

One92

Member
Aug 10, 2017
10
27
0
I paraphrased my issue. I can export the project from Tasker without issue, but I can't attach it to the OP. Maybe it's because of my low post count. I've been lurking for years :)
 

Wisiwyg

Senior Member
Can convert this to a 'Quiet Hours' Tasker macro to provide the old functionality of the Quiet Hours settings in LOS? Would be really nice to have a Quiet Hours option, overridden by a change event in the button position. Otherwise, Quiet Hours runs as normal. I sometimes forget to slide up when going to bed, only to have 'dings' wake me.
 

One92

Member
Aug 10, 2017
10
27
0
@jakvettjak when the slider will be down, notifications will also stop pushing I guess ?

Sent from my ONEPLUS A5000 using Tapatalk
Nope, as it's shown the down position is "awake" so fully connected, sound/vibrate, all radios on, sync on, etc. This is intended to mimic typical phone usage and reset all of the "sleep" settings which turned everything off.

I'm working on a "coma" mode for the up position that will put the phone into airplane mode, then disable it every so often to check in, before going back into airplane. Of course, when airplane mode is enabled you wouldn't get push notifications, but they should get pushed as soon as the phone checks in.

As "sleep" mode is shown, with mobile data, wifi, sync off you won't get push notifications, but SMS/call will still work. This mode would work well for the middle slider position where priority DND mode is enabled by default.
 

drose6102

Senior Member
Oct 27, 2010
190
46
0
The alert slider options to customize are kinda strange, it would be nice if it they were more like the stock Android do not disturb. Trying to use some of my Tasker profiles to mute notifications when connected to Bluetooth speakers but Tasker uses the Android stock do not disturb which conflicts with Oxygen os alerts. Looks like am making new profiles from the ground up.

Sent from my ONEPLUS A5000 using Tapatalk
 

One92

Member
Aug 10, 2017
10
27
0
The alert slider options to customize are kinda strange, it would be nice if it they were more like the stock Android do not disturb. Trying to use some of my Tasker profiles to mute notifications when connected to Bluetooth speakers but Tasker uses the Android stock do not disturb which conflicts with Oxygen os alerts. Looks like am making new profiles from the ground up.

Sent from my ONEPLUS A5000 using Tapatalk
I agree it's pretty limiting in stock form. Hopefully future updates will give us more control. I wonder if any ROMs on here have been able to modify the slider function.
 

Bewildered Wolf

Recognized Contributor
Sep 25, 2012
3,230
2,241
253
NEW DELHI
www.youtube.com
Alright everyone here is the download link to the xml file

Right Here
Hey there. Wanted to try your file but
1. I've copy pasted the profile on Tasker/profiles but it doesn't shows up in selector menu.
2. I've tried adding it manuklay with the "open with" feature of mixplorer but still it doesn't loads up and it says that can open this file with Tasker. Bad intend or something.


So how do I set it up to change to reading & gaming mode. I just bought Tasker but I'm not to familiar with Tasker, how do I apply your xml file to get reading mode? Thanks
Long press in the profiles tab.
And then find your file. Done.