Can a Tasker app change it's icon?

352 views
Skip to first unread message

Dale Smith

unread,
Dec 2, 2017, 1:41:34 AM12/2/17
to Tasker
I created a simple flashlight app with Tasker. I would like to change the app's icon based on the state of the light. Is this possible?

Jimmy Jimmy

unread,
Dec 2, 2017, 3:55:23 AM12/2/17
to Tasker
You could use Widget. Use a widget to run your task/app. And use set widget icon to change its icon based on different scenario.

Dale Smith

unread,
Dec 3, 2017, 3:31:04 AM12/3/17
to Tasker
Good idea but it didn't really answer my question. I tried both Task and Shortcut widgets but can't get the icon to change. Here's my export. Maybe someone can tell me what I'm doing wrong.

Flashlight (2)
<Initialize variable only runs first time app is usef>
A1: Variable Set [ Name:%FLclick To:off Recurse Variables:Off Do Maths:Off Append:Off ] If [ %FLclick !Set ]
A2: If [ %FLclick ~ off ]
A3: Variable Set [ Name:%FLclick To:on Recurse Variables:Off Do Maths:Off Append:Off ]
A4: Set Widget Icon [ Name:On Icon:content://com.android.externalstorage.documents/document/primary%3ATasker%2F.icn%2FlightbulbON.png ]
<On>
A5: Music Play [ File:Tasker/sounds/Click On.mp3 Start:0 Loop:Off Stream:3 Continue Task Immediately:Off Continue Task After Error:On ]
A6: Else
A7: Variable Set [ Name:%FLclick To:off Recurse Variables:Off Do Maths:Off Append:Off ]
A8: Set Widget Icon [ Name:Off Icon:content://com.android.externalstorage.documents/document/primary%3ATasker%2F.icn%2FlightbulbOFF.png ]
<Off>
A9: Music Play [ File:Tasker/sounds/Click Off.mp3 Start:0 Loop:Off Stream:3 Continue Task Immediately:Off Continue Task After Error:On ]
<End>
A10: End If
A11: Torch [ Set:Toggle ]

Rich D

unread,
Dec 3, 2017, 8:39:46 AM12/3/17
to Tasker Google Groups Post



I created a simple flashlight app with Tasker.  I would like to change the app's icon based on the state of the light. Is this possible?


I believe that is done when the app is compiled so I do not believe you can change a app icon on the home screen and tasker apps cannot create a widget so I think this is unlikely.  I believe the best you could do is change the icon in the notify bar. 

Dale Smith

unread,
Dec 4, 2017, 12:55:36 AM12/4/17
to Tasker
Thanks Rich I think you're under appreciated on this group. You help so many of us. However, I did get it working as a widget. The task had been assigned an icon because I had created an app from the Task. I created another copy of the Task renamed it and didn't assign an icon. The Tasker Task widget worked just fine. Thanks again. Dale

Rich D

unread,
Dec 4, 2017, 4:36:20 AM12/4/17
to Tasker Google Groups Post

Thanks Rich I think you're under appreciated on this group. You help so many of us. However, I did get it working as a widget. The task had been assigned an icon because I had created an app from the Task. I created another copy of the Task renamed it and didn't assign an icon. The Tasker Task widget worked just fine. Thanks again. Dale

Hi Dale, 
I guess I should have clarified your question. I had assumed since you created a app you wanted it to run on a device without tasker. I am still confused on how you got it to  work. You can't create a app without a icon and you can't create a widget without assigning a widget to the task. Are you just using a Tasker task with a widget or are you still somehow using the created app?

Dale Smith

unread,
Dec 5, 2017, 10:41:52 AM12/5/17
to Tasker
To clarify I'm just using the app/widget now only the widget on my Tasker installed phone. I created the app just as an exercise for myself. Thanks again, Dale.

Øystein M

unread,
Dec 19, 2017, 11:00:38 AM12/19/17
to Tasker
For Set Widget Icon the name should be the same as the task name. If your task name is Flashy both A4 and A8 should have that icon name:


On Sunday, December 3, 2017 at 2:31:04 AM UTC-6, Dale Smith wrote:
Good idea but it didn't really answer my question. I tried both Task and Shortcut widgets but can't get the icon to change. Here's my export. Maybe someone can tell me what I'm doing wrong.

Flashlight (2)
        <Initialize variable only runs first time app is usef>
A1: Variable Set [ Name:%FLclick To:off Recurse Variables:Off Do Maths:Off Append:Off ] If [ %FLclick !Set ]
A2: If [ %FLclick ~ off ]
A3: Variable Set [ Name:%FLclick To:on Recurse Variables:Off Do Maths:Off Append:Off ]

A4: Set Widget Icon [ Name:Flashy Icon:content://com.android.externalstorage.documents/document/primary%3ATasker%2F.icn%2FlightbulbON.png ]

        <On>
A5: Music Play [ File:Tasker/sounds/Click On.mp3 Start:0 Loop:Off Stream:3 Continue Task Immediately:Off Continue Task After Error:On ]
A6: Else
A7: Variable Set [ Name:%FLclick To:off Recurse Variables:Off Do Maths:Off Append:Off ]

A8: Set Widget Icon [ Name:Flashy Icon:content://com.android.externalstorage.documents/document/primary%3ATasker%2F.icn%2FlightbulbOFF.png ]

Reply all
Reply to author
Forward
Message has been deleted
0 new messages