From 074aed7b80993eff9ac9d7a8572392a61773ba73 Mon Sep 17 00:00:00 2001 From: sriramsv Date: Sat, 27 Aug 2022 12:08:36 -0700 Subject: [PATCH] Add Tasker Widget control script --- community/tasker-widget-control.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 community/tasker-widget-control.lua diff --git a/community/tasker-widget-control.lua b/community/tasker-widget-control.lua new file mode 100644 index 0000000..91de2dd --- /dev/null +++ b/community/tasker-widget-control.lua @@ -0,0 +1,26 @@ +-- name = "Tasker Widget Control" +-- description = "Add or Remove widgets from Tasker" +-- data_source = "internal" +-- type = "widget" +-- author = "Sriram SV" +-- version = "1.0" + +-- command structure +-- cmd:script:*:add=:= +-- cmd:script:*:remove=:= +-- adb shell am broadcast -a ru.execbit.aiolauncher.COMMAND --es cmd "script:tasker widget control:add=:=" --es password +-- adb shell am broadcast -a ru.execbit.aiolauncher.COMMAND --es cmd "script:tasker widget control:remove=:=" --es password +function on_command(cmd) + data = cmd:split("=:=") + command = data[1] + widget_name = data[2] + if command == "add" then + aio:add_widget(widget_name) + elseif command == "remove" then + aio:remove_widget(widget_name) + end +end + +function on_alarm() + ui:show_text("Use tasker tasks to add/remove widgets") +end \ No newline at end of file