From ef592e426799cd46ab9a90d838f2509d42a224f4 Mon Sep 17 00:00:00 2001 From: sugood <15820258199@163.com> Date: Sun, 9 Jan 2022 13:14:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?v0.1.3=201=E3=80=81=E5=B1=8F=E5=B9=95?= =?UTF-8?q?=E5=8F=96=E8=89=B2=E8=AE=BE=E7=BD=AE=E5=BF=AB=E6=8D=B7=E9=94=AE?= =?UTF-8?q?alt+cmd+p=202=E3=80=81=E5=92=96=E5=95=A1=E5=9B=A0=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=BF=AB=E6=8D=B7=E9=94=AEalt+cmd+c=203=E3=80=81json?= =?UTF-8?q?=20=E8=A7=A3=E6=9E=90=E7=95=8C=E9=9D=A2=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E8=A7=A6=E5=8F=91=E5=BF=AB=E6=8D=B7=E9=94=AE=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E5=A4=8D=E5=88=B6=E9=80=89=E4=B8=AD=E7=9A=84=E6=96=87?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- .idea/.hammerspoon.iml | 9 - .idea/modules.xml | 8 - .idea/vcs.xml | 6 - .idea/workspace.xml | 860 ----------------------------------------- README.md | 4 + README_en.md | 4 + data/history.json | 24 ++ init.lua | 2 +- modules/commons.lua | 36 +- modules/jsonFormat.lua | 159 +------- 11 files changed, 69 insertions(+), 1046 deletions(-) delete mode 100644 .idea/.hammerspoon.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.gitignore b/.gitignore index 48dc859..bf2d64c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /.idea/ -/*.zip \ No newline at end of file +/*.zip +.idea/ \ No newline at end of file diff --git a/.idea/.hammerspoon.iml b/.idea/.hammerspoon.iml deleted file mode 100644 index d6ebd48..0000000 --- a/.idea/.hammerspoon.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index e632461..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 03b4004..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,860 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - console.clearConsole() - menubar - config - menubar.new(true) - searchResult - keywords - hs.hotkey.bind - hs.hotkey - displayIdle - syntaxHighlight - hs.alert.show - 切换 - isSyncTime - hs.dialog - else if - elseif - colorDialog - appid - mChooser - baiduAppSecret - baiduAppid - hs.dialog.blockAlert - ydAppKey - hyperCmd - stringIsEmpty - listenerEvent - config.json - greyby - destinationfile - sourcefile - - - self.menubar - macMenubar - sugood - - - - - - - - - - - - - - true - DEFINITION_ORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-                
-            
-        
-        
-        
- -
- - - - - ]] - - return html -end - - --- KSheet:hide() --- Method --- Hide the cheatsheet view. @@ -187,8 +39,11 @@ end --- Method --- Show current application's keybindings in a view. function show(time) - local webcontent = generateHtml() - sheetView:html(webcontent, "http://localhost") + bindCopyKey() + local str = hs.pasteboard.getContents() + -- local webcontent = generateHtml() + -- sheetView:html(webcontent, "http://localhost") + sheetView:url("https://i.sugood.xyz/pages/jsonweb.html") sheetView:show(time) end @@ -202,6 +57,10 @@ end init() +-- 按下添加快捷键时映射到复制快捷键 +function bindCopyKey() + hs.eventtap.keyStroke({ "cmd" }, "C") +end -- 添加片段(按下快捷键时做一个复制操作,并记录复制的内容到片段列表中) hs.hotkey.bind(hyperCmd, "G", function () toggle() From 5fb1619ebca6be11b0357b1b1d621d27402a4a60 Mon Sep 17 00:00:00 2001 From: sugood <15820258199@163.com> Date: Sun, 9 Jan 2022 13:24:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?v0.1.3=20=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8d0122d..2412bcc 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ https://github.com/greyby/hammerspoon * + G JSON格式化 +自动复制选中的文本 + ### 自动同步时间 * + T 自动同步时间