From a5aae9185b2257cb1b0f2759defaa9d0761e49d4 Mon Sep 17 00:00:00 2001 From: sriramsv Date: Fri, 26 Aug 2022 19:15:49 -0700 Subject: [PATCH 1/3] QR code and share menu search scripts --- self/qr-code.lua | 34 ++++++++++++++++++++++++++++++++++ self/share-menu.lua | 29 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 self/qr-code.lua create mode 100644 self/share-menu.lua diff --git a/self/qr-code.lua b/self/qr-code.lua new file mode 100644 index 0000000..e59f4de --- /dev/null +++ b/self/qr-code.lua @@ -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 \ No newline at end of file diff --git a/self/share-menu.lua b/self/share-menu.lua new file mode 100644 index 0000000..28762f1 --- /dev/null +++ b/self/share-menu.lua @@ -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 + -- 2.43.0 From e6973abdae83f4987a5560036bf6239a2384e6b0 Mon Sep 17 00:00:00 2001 From: sriramsv Date: Fri, 26 Aug 2022 22:27:22 -0700 Subject: [PATCH 2/3] Move scripts to community folder --- community/qr-code.lua | 34 ++++++++++++++++++++++++++++++++++ community/share-menu.lua | 29 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 community/qr-code.lua create mode 100644 community/share-menu.lua diff --git a/community/qr-code.lua b/community/qr-code.lua new file mode 100644 index 0000000..e59f4de --- /dev/null +++ b/community/qr-code.lua @@ -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 \ No newline at end of file diff --git a/community/share-menu.lua b/community/share-menu.lua new file mode 100644 index 0000000..28762f1 --- /dev/null +++ b/community/share-menu.lua @@ -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 + -- 2.43.0 From 5f48b99bb89dcdcf03247d6241339196da505932 Mon Sep 17 00:00:00 2001 From: sriramsv Date: Fri, 26 Aug 2022 22:38:13 -0700 Subject: [PATCH 3/3] Remove self folder --- self/qr-code.lua | 34 ---------------------------------- self/share-menu.lua | 29 ----------------------------- 2 files changed, 63 deletions(-) delete mode 100644 self/qr-code.lua delete mode 100644 self/share-menu.lua diff --git a/self/qr-code.lua b/self/qr-code.lua deleted file mode 100644 index e59f4de..0000000 --- a/self/qr-code.lua +++ /dev/null @@ -1,34 +0,0 @@ --- 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 \ No newline at end of file diff --git a/self/share-menu.lua b/self/share-menu.lua deleted file mode 100644 index 28762f1..0000000 --- a/self/share-menu.lua +++ /dev/null @@ -1,29 +0,0 @@ --- 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 - -- 2.43.0