Merge branch 'master' of https://github.com/zobnin/aiolauncher_scripts
This commit is contained in:
25
community/sunrise-sunset-widget.lua
Normal file
25
community/sunrise-sunset-widget.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
-- name = "Sunrise/Sunset"
|
||||
-- description = "Shows Sunrise Sunset at your location"
|
||||
-- data_source = "https://api.sunrise-sunset.org/"
|
||||
-- type = "widget"
|
||||
-- author = "Sriram S V"
|
||||
-- version = "1.0"
|
||||
-- foldable = "false"
|
||||
|
||||
local json = require "json"
|
||||
local date = require "date"
|
||||
function on_alarm()
|
||||
local location=system:location()
|
||||
url="https://api.sunrise-sunset.org/json?lat="..location[1].."&lng="..location[2].."&date=today&formatted=1"
|
||||
http:get(url)
|
||||
end
|
||||
|
||||
|
||||
function on_network_result(result)
|
||||
local t = json.decode(result)
|
||||
local table = {
|
||||
{ "sunrise:", date(t.results.sunrise):tolocal():fmt("%r") },
|
||||
{ "sunset:", date(t.results.sunset):tolocal():fmt("%r") },
|
||||
}
|
||||
ui:show_table(table, 2)
|
||||
end
|
||||
25
community/tasker-command-search.lua
Normal file
25
community/tasker-command-search.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
-- name = "Tasker Command Search"
|
||||
-- description = "Sends tasker command from search bar"
|
||||
-- data_source = "tasker"
|
||||
-- type = "search"
|
||||
-- author = "Sriram SV"
|
||||
-- version = "1.0"
|
||||
-- prefix = "tasker | Tasker | command"
|
||||
|
||||
local md_color = require "md_colors"
|
||||
local orange = md_colors.orange_500
|
||||
|
||||
text_from = ""
|
||||
text_to = ""
|
||||
|
||||
function on_search(input)
|
||||
text_from = input
|
||||
text_to = ""
|
||||
search:show({input},{orange})
|
||||
end
|
||||
|
||||
function on_click(idx)
|
||||
text_from = string.lower(text_from)
|
||||
text_from=text_from:replace(" ", "=:=")
|
||||
tasker:send_command(text_from)
|
||||
end
|
||||
Reference in New Issue
Block a user