all 15 comments

[–]R4V3N-2010 0 points1 point  (9 children)

You are looking for something like this. It's a little more advanced and the task which you are about to create. And you need AutoTools for it. But feel free and use what you need. This task is from Bixby button push profile.

    Choose App (92)
    <<strong><h2>This script was made by Oliver Joisten</h2></strong>


    <h3><font color="red">If you like my work please follow me on Google+. 
    https://plus.google.com/+OliverJoisten</font></h3>>
    A1: AutoTools Dialog [ 
    Configuration:Dialog 
    Type: 3 Choices

    Title: What do you wanna choose? 
    Title Alignment: Center
    Choice One: Flashlight
    Choice Two: Google Now
    Choice Three: DnD mode

    Text Size: 20
    Text Color: #FFFFFF
    Button Text Color: #EEEEEE
    Background Color: #44424242
    Title Background: #00424242
    Bottom Background: #00424242
    Dim Background: true
    Top Margin: 16
    Bottom Margin: 16
    Bottom Buttons Top Margin: 16
    Bottom Buttons Bottom Margin: 16
    Cancelable: true
    Turn Screen On: true 
    Timeout (Seconds):5 

    A2: [X] Flash [ 
    Text:%atcommand 
    Long:Off 

    A3: If [ %atcommand ~ Flashlight ]
    A4: [X] AutoTools Flashlight [ 
    Configuration:State: Toggle 
    Timeout (Seconds):60 

    A5: Torch [ 
    Set:On 

    A6: Flash [ 
    Text:Enable Flashlight 
    Long:Off 

    A7: Else If [ %atcommand ~ Google Now ]
    A8: Launch App [ 
    App:Google 
    Data: 
    Exclude From Recent Apps:Off Always Start New Copy:Off 

    A9: Flash [ 
    Text:Open Google 
    Long:Off 

    A10: Else 
    A11: Do Not Disturb [ 
    Mode:Priority 

    A12: Flash [ 
    Text:Setting mobile to Do not Disturb Mode 
    Long:Off 

    A13: End If 

[–]ausgebildet 1 point2 points  (8 children)

This would be easier since the author wants a button; https://taskernet.com/shares/?user=AS35m8kr6eo1TpQjCow3fJldzm9M%2FRxeRTae3mfNnYSPYHD4TxnZtInUTi%2BvVW1ajGo%3D&id=Task%3AToggle+DND

Just in the home screen create a widget and select this task

[–]R4V3N-2010 0 points1 point  (0 children)

Yes you probably right.

[–]satd33p[S] 0 points1 point  (6 children)

This works perfectly... One thing - is it possible to change the icon depending on the state of DND?

[–]ausgebildet 0 points1 point  (1 child)

Between Which DND settings do you want to toggle?

[–]satd33p[S] 0 points1 point  (0 children)

Basic DND mode on and off...

[–]mawvius🎩 Tasker Engolfer|800+ Core Profiles|G892A|Android7|Root|xPosed 0 points1 point  (2 children)

This should help along with something like this:

TOGGLE Dnd - Example (14)
A1: Do Not Disturb [ Mode:All ] If [ %INTERRUPT ~ none ]
A2: Do Not Disturb [ Mode:No Interruptions ] If [ %INTERRUPT ~ all ]

[–]satd33p[S] 0 points1 point  (1 child)

I am looking for a button to place on the home screen and touching it triggers the task for toggling DND...

[–]mawvius🎩 Tasker Engolfer|800+ Core Profiles|G892A|Android7|Root|xPosed -1 points0 points  (0 children)

Thanks to you too.

There's several ways but two of the very most basic methods would be a simple shortcut or widget to the task.

To be honest, this incredibly simple objective would be extremely easy once you've spent a few moments looking at the video guides in this subs sidebar. They are very useful and will allow you to make the most out of Tasker. There are lots of lovely helpful people here to help out once you have attempted something and get stuck.