diff --git a/.gitignore b/.gitignore
index ce92539..91290a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
/.idea/
/*.zip
-.idea
\ No newline at end of file
+.idea/
diff --git a/README.md b/README.md
index 8a54b63..2412bcc 100644
--- a/README.md
+++ b/README.md
@@ -87,6 +87,8 @@ https://github.com/greyby/hammerspoon
* ⌥⌘ + G JSON格式化
+自动复制选中的文本
+
### 自动同步时间
* ⌥⌘ + T 自动同步时间
@@ -101,10 +103,14 @@ https://github.com/greyby/hammerspoon
### 屏幕取色功能
+* ⌥⌘ + P 颜色拾取器
+
菜单栏点击屏幕取色,出现取色界面后点击颜色拾取器,就可以获取当前屏幕鼠标所在位置的颜色值
### 咖啡因
+* ⌥⌘ + C 咖啡因
+
菜单栏点击 咖啡因打开系统永不休眠功能,再点击一次就能关闭
### 状态栏显示输入法状态
diff --git a/README_en.md b/README_en.md
index ded2e9f..7ce1b07 100644
--- a/README_en.md
+++ b/README_en.md
@@ -100,10 +100,14 @@ Support baidu and youdao translation API. Baidu Translation can be used directly
### Screen color selection function
+* ⌥⌘ + P Screen color selection function
+
Click the screen color in the menu bar, click the color picker after the screen color picker interface appears, and the color value at the position of the mouse on the screen can be obtained
### caffeine
+* ⌥⌘ + C caffeine
+
On the menu bar, click caffeine to turn on the system's never sleep feature, and then click again to turn it off
### The status bar shows the status of the input method
diff --git a/data/history.json b/data/history.json
index 0e12a7a..0f951bd 100644
--- a/data/history.json
+++ b/data/history.json
@@ -47,6 +47,10 @@
"subText" : "cmd|diff file1 file2|比较并显示两个文件的差异",
"text" : "diff"
},
+ {
+ "subText" : "cmd|journalctl -f -u xx.service -n1000|显示日志",
+ "text" : "journalctl -f -u xx.service -n1000"
+ },
{
"subText" : "cmd|kill -9 pid|终止进程",
"text" : "kill"
@@ -148,8 +152,12 @@
"text" : "\/** \n* @Title: ${file_name} \n* @Package ${package_name} \n* @Description: ${todo}(用一句话描述该文件做什么) \n* @author sugood\n* @date ${date} ${time} \n* @version V1.0 \n*\/"
},
{
- "subText" : "flutter build apk --no-shrink",
- "text" : "flutter build apk --no-shrink"
+ "subText" : "flutter build apk --release",
+ "text" : "flutter build apk --release"
+ },
+ {
+ "subText" : "flutter build ios --release",
+ "text" : "flutter build ios --release"
},
{
"subText" : "flutter clean",
@@ -159,6 +167,14 @@
"subText" : "flutter packages pub run build_runner build --delete-conflicting-outputs",
"text" : "flutter packages pub run build_runner build --delete-conflicting-outputs"
},
+ {
+ "subText" : "flutter doctor",
+ "text" : "flutter doctor"
+ },
+ {
+ "subText" : "flutter run --debug",
+ "text" : "flutter run --debug"
+ },
{
"subText" : "ins|brew install node|安装node",
"text" : "brew install node"
diff --git a/modules/commons.lua b/modules/commons.lua
index f382e61..03b396c 100644
--- a/modules/commons.lua
+++ b/modules/commons.lua
@@ -124,7 +124,7 @@ function initMenu()
end },
{ title = "-" },
{ title = "屏幕取色", fn = function()
- openColorDilog()
+ openColorDialog()
end },
{ title = "-" },
{ title = "咖啡因:" .. config[1].caffeine, fn = function()
@@ -253,8 +253,7 @@ function isCopySuccess()
return numAfter > num
end
---打开取色器
-function openColorDilog()
+function openColorDialog()
hs.openConsole(true)
colorDialog.show()
colorDialog.mode("RGB")
@@ -266,13 +265,12 @@ function openColorDilog()
hs.closeConsole()
end
-
---设置取色器快捷键
+--设置颜色拾取快键键
hs.hotkey.bind(hyperCmd, "P", function ()
- openColorDilog()
+ openColorDialog()
end)
---设置咖啡因快捷键
+--设置颜色拾取快键键
hs.hotkey.bind(hyperCmd, "C", function ()
switchCaffeine()
end)
\ No newline at end of file
diff --git a/modules/jsonFormat.lua b/modules/jsonFormat.lua
index 7af95de..b432948 100644
--- a/modules/jsonFormat.lua
+++ b/modules/jsonFormat.lua
@@ -6,170 +6,6 @@
--
--
-local function generateHtml()
-
- local html = [[
-
-
-
-
-Json格式化高亮展示工具
-
-
-
-
-
-
-
-
- ]]
-
- return html
-end
-
-
--- KSheet:hide()
--- Method
--- Hide the cheatsheet view.
@@ -205,10 +41,11 @@ end
--- Method
--- Show current application's keybindings in a view.
function show(time)
- local webcontent = generateHtml()
+ bindCopyKey()
+ local str = hs.pasteboard.getContents()
+ -- local webcontent = generateHtml()
-- sheetView:html(webcontent, "http://localhost")
- -- sheetView:url("https://www.jsonin.com/")
- sheetView:url("https://c.runoob.com/front-end/53/")
+ sheetView:url("https://i.sugood.xyz/pages/jsonweb.html")
sheetView:show(time)
end
@@ -222,6 +59,10 @@ end
init()
+-- 按下添加快捷键时映射到复制快捷键
+function bindCopyKey()
+ hs.eventtap.keyStroke({ "cmd" }, "C")
+end
-- 添加片段(按下快捷键时做一个复制操作,并记录复制的内容到片段列表中)
hs.hotkey.bind(hyperCmd, "G", function ()
toggle()