Move scripts to community folder

This commit is contained in:
sriramsv
2022-08-26 22:27:22 -07:00
parent a5aae9185b
commit e6973abdae
2 changed files with 63 additions and 0 deletions

34
community/qr-code.lua Normal file
View File

@@ -0,0 +1,34 @@
-- name = "QR Code"
-- description = "Turn any text or url into QR code"
-- data_source = "https://api.qrserver.com/v1/"
-- type = "search"
-- author = "Sriram SV"
-- version = "1.0"
qr_code_url = "https://api.qrserver.com/v1"
text_from = ""
text_to = ""
local md_color = require "md_colors"
-- constants
local blue = md_colors.blue_500
function on_search(input)
text_to = ""
text_from = input
search:show({input},{blue})
end
function on_click()
if text_to == "" then
get_qr_code(text_from)
end
end
function get_qr_code(text)
url = qr_code_url.."/create-qr-code/?size=150x150&data="..text
system:open_browser(url)
end