In this example we're going to create an all black screen whenever music is playing.
On this screen you can swipe down to stop playing music.
You can add more commands to skip to the next or previous track if you want, but for now this'll be the flow:
This is how it'll look like in the end:
- If music starts playing your screen will be pitch black, great for AMOLED devices
- if you swipe down on the screen music will stop and the screen will go away
STEP 1 - PROFILE THAT SETS MUSICPLAYING VARIABLE
Most music apps will update a notification whenever music stops or starts playing so this is a great event to check if music is playing or not and set a global variable with the value
Now every time a music app's notification is updated the %MusicPlaying variable will be updated with the music playing status
- Create a new profile with the AutoNotification Intercept event condition
- Select the music apps you're interested in knowing if they're playing music or not. In this example I selected Google Play Music
- Accept and create an entry task
- In the task add an AutoTools System State action and check the Audio option
- Accept and add a Variable Set action that sets %MusicPlaying to %atmusicplaying
STEP 2 - PROFILE THAT ENABLES WHEN MUSIC IS PLAYING
If you want you can add more conditions like for example, only do this if you're connected to your car bluetooth radio so that this only happens when in your car
- Create a new profile with the Variable Value state condition
- Set the Condition to %MusicPlaying matches true
- Create an entry task and add a Flash action with the text Music is playing!
STEP 3 - SHOW GESTURES SCREEN
This will make the stopplaying command be sent whenever you swipe down on the screen more than 100 dip.
- Add an AutoTools Gestures Screen action
- Set the AutoApps commands -> Swipes -> Down -> Distances field to 100 and the Commands field to stopplaying
You can add other commands here like playnext on right swipe and swipeleft on left swipe for example. You'd need other profiles to handle these commands like the one we're creating next.
If you want you can add a Status Bar -> Collapsed action to make sure that the notification tray goes away when music starts playing
- Set the Background Color to black
- Accept and go back to the task
STEP 4 - STOP PLAYING ON COMMAND
Whenever the stopplaying command is issued Tasker will now stop whatever music app is playing
- Create a new profile with the AutoApps Command condition
- Set the Command Filter to stopplaying
- Accept and create the entry task
- Add a Media Control action with the Stop command
STEP 5 - CLOSE GESTURES SCREEN IF MUSIC STOPS
- Go back to the profile with the Variable Value condition and add an Exit Task
- Add a Flash action with the text Music stopped!
- Add an AutoTools Gestures Screen and select the Close Screen option.
- Back out of Tasker to save
STEP 6 - TEST
If you now start playing music in any of the apps selected in the AutoNotification Intercept profile the screen will show up.
If you swipe down on the screen music will stop and the screen will go away.
Don't forget to only make this screen show up when you really need it, like in your car or when you're going to sleep, etc.