From 061b86795c7120610b7ce40a2f2192773eb8fec8 Mon Sep 17 00:00:00 2001 From: sugood <15820258199@163.com> Date: Sat, 8 Jan 2022 18:38:39 +0800 Subject: [PATCH] =?UTF-8?q?v0.1.3=20=E8=A1=A5=E5=85=85=201=E3=80=81?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E5=BF=AB=E6=8D=B7=E9=94=AE=E6=89=93=E5=BC=80?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E5=8F=96=E8=89=B2=E5=99=A8=202=E3=80=81?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E5=BF=AB=E6=8D=B7=E9=94=AE=E6=89=93=E5=BC=80?= =?UTF-8?q?=E5=92=96=E5=95=A1=E5=9B=A0=203=E3=80=81json=20=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E5=99=A8=E5=B7=A5=E5=85=B7=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E5=B7=A5=E5=85=B7=E7=9A=84=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E5=99=A8=204=E3=80=81=E4=BC=98=E5=8C=96=E4=B8=80=E4=BA=9BBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- data/history.json | 42 +++++++++++++++++++++++++++++++++++- init.lua | 2 +- modules/commons.lua | 40 ++++++++++++++++++++++++----------- modules/inputstat.lua | 4 ++-- modules/jsonFormat.lua | 48 ++++++++++++++++++++++++++++++------------ 6 files changed, 108 insertions(+), 31 deletions(-) diff --git a/.gitignore b/.gitignore index 48dc859..ce92539 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/data/history.json b/data/history.json index 0ffe9e4..0e12a7a 100644 --- a/data/history.json +++ b/data/history.json @@ -120,7 +120,7 @@ "text" : "source ~\/.bash_profile" }, { - "subText" : "cmd|ssh username@ip|ssh远程登录", + "subText" : "cmd|ssh -p username@ip|ssh远程登录", "text" : "ssh" }, { @@ -147,10 +147,30 @@ "subText" : "code|java|author注释模板", "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 clean", + "text" : "flutter clean" + }, + { + "subText" : "flutter packages pub run build_runner build --delete-conflicting-outputs", + "text" : "flutter packages pub run build_runner build --delete-conflicting-outputs" + }, { "subText" : "ins|brew install node|安装node", "text" : "brew install node" }, + { + "subText" : "keytool -genkey -v -keystore myKey.jks -keyalg RSA -keysize 2048 -validity 36500 -alias myAlias", + "text" : "keytool -genkey -v -keystore myKey.jks -keyalg RSA -keysize 2048 -validity 36500 -alias myAlias" + }, + { + "subText" : "keytool|keytool -list -v -keystore xx.jks|生成kjs", + "text" : "keytool -list -v -keystore" + }, { "subText" : "key|Command+Option+C|复制路径", "text" : "Command+Option+C" @@ -162,5 +182,25 @@ { "subText" : "key|Command+Shift+.|显示隐藏文件", "text" : "Command+Shift+." + }, + { + "subText" : "md | link", + "text" : "[超链接显示名](超链接地址 \"超链接title\")" + }, + { + "subText" : "md | more ", + "text" : "" + }, + { + "subText" : "md | system info", + "text" : "- System version: MacOS 12\n- Flutter version: 1.22.5\n- Dart version: 2.10.4\n- Android Studio version: 4.1.1" + }, + { + "subText" : "sudo smartctl -H \/dev\/sda | 硬盘是否健康", + "text" : "sudo smartctl -H \/dev\/sda" + }, + { + "subText" : "sudo smartctl -i \/dev\/sda | 硬盘是否支持健康检查", + "text" : "sudo smartctl -i \/dev\/sda" } ] \ No newline at end of file diff --git a/init.lua b/init.lua index 68e7a4b..466028b 100644 --- a/init.lua +++ b/init.lua @@ -2,8 +2,8 @@ hs.configdir = os.getenv('HOME') .. '/.hammerspoon' package.path = hs.configdir .. '/?.lua;' .. hs.configdir .. '/?/init.lua;' .. hs.configdir .. '/Spoons/?.spoon/init.lua;' .. package.path require "modules/reload" -require "modules/commons" require "modules/hotkey" +require "modules/commons" require "modules/system" require "modules/windows" require "modules/launcher" diff --git a/modules/commons.lua b/modules/commons.lua index 5df8408..f382e61 100644 --- a/modules/commons.lua +++ b/modules/commons.lua @@ -4,7 +4,7 @@ --- DateTime: 2020/10/24 14:13 --- local console = require("hs.console") -version = "v0.1.2" +version = "v0.1.3" configPath= "~/.hammerspoon/data/config.json" initConfigPath= "~/.hammerspoon/data/initConfig.json" config = {} @@ -124,15 +124,7 @@ function initMenu() end }, { title = "-" }, { title = "屏幕取色", fn = function() - hs.openConsole(true) - colorDialog.show() - colorDialog.mode("RGB") - colorDialog.callback(function(a,b) - if b then - hs.closeConsole() - end - end) - hs.closeConsole() + openColorDilog() end }, { title = "-" }, { title = "咖啡因:" .. config[1].caffeine, fn = function() @@ -170,7 +162,7 @@ function initData() initMenu() -- 修改全局alert样式 hs.alert.defaultStyle.strokeColor = {white = 1, alpha = 0} - hs.alert.defaultStyle.fillColor = {white = 0.05, alpha = 0.75} + hs.alert.defaultStyle.fillColor = {white = 0.05, alpha = 0.50} hs.alert.defaultStyle.radius = 10 --清空打印信息 console.clearConsole() @@ -259,4 +251,28 @@ function isCopySuccess() local numAfter = hs.pasteboard.changeCount() print("复制后数量:"..numAfter) return numAfter > num -end \ No newline at end of file +end + +--打开取色器 +function openColorDilog() + hs.openConsole(true) + colorDialog.show() + colorDialog.mode("RGB") + colorDialog.callback(function(a,b) + if b then + hs.closeConsole() + end + end) + hs.closeConsole() +end + + +--设置取色器快捷键 +hs.hotkey.bind(hyperCmd, "P", function () + openColorDilog() +end) + +--设置咖啡因快捷键 +hs.hotkey.bind(hyperCmd, "C", function () + switchCaffeine() +end) \ No newline at end of file diff --git a/modules/inputstat.lua b/modules/inputstat.lua index f342d89..67d844b 100644 --- a/modules/inputstat.lua +++ b/modules/inputstat.lua @@ -71,7 +71,7 @@ function initData() else hs.hid.led.set('caps',false) hs.alert.closeAll(0) - hs.alert.show("键盘小写 🔤- OFF") + hs.alert.show("键盘小写 🔤- OFF", 0.5) if(isChinese()) then if(reverse) then macMenubar:setIcon(imgInputCn) @@ -86,7 +86,7 @@ function initData() if hs.hid.capslock.get() then hs.hid.led.set('caps',true) hs.alert.closeAll(0) - hs.alert.show("键盘大写 🅰️- ON") + hs.alert.show("键盘大写 🅰️- ON", 0.5) macMenubar:setIcon(imgInputU) else --print("小写2") diff --git a/modules/jsonFormat.lua b/modules/jsonFormat.lua index 4cb3290..7af95de 100644 --- a/modules/jsonFormat.lua +++ b/modules/jsonFormat.lua @@ -18,12 +18,16 @@ local function generateHtml()