community scripts refactoring and cleanup

This commit is contained in:
Evgeny
2022-08-27 08:49:29 +03:00
parent 521c6852e0
commit 93990298e8
15 changed files with 72 additions and 42 deletions

View File

@@ -0,0 +1,29 @@
-- name = "Share Text"
-- description = "Share text with other apps"
-- data_source = "internal"
-- type = "search"
-- author = "Sriram SV"
-- version = "1.0"
local md_color = require "md_colors"
-- constants
local blue = md_colors.blue_500
local red = md_colors.red_500
-- variables
text_from = ""
text_to=""
function on_search(input)
text_from = input
text_to = ""
search:show({"Share \""..input.."\""}, {blue})
end
function on_click()
if text_to == "" then
system:share_text(text_from)
end
end