国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Mac高效使用 -- hammerspoon介紹,自動切換輸入法與應(yīng)用快速...

2023-02-19 19:29 作者:風(fēng)流陣里的急先瘋  | 我要投稿

感謝 UP 的分享,我使用你給的啟動器配置有點問題,只有已經(jīng)啟動一次在 dock 欄中的的應(yīng)用才能打開,我根據(jù)官方文檔改了改,字母映射的時候最好獲取 ID,獲取名字在沒打開過的時候會獲取不到

local hotkey = require 'hs.hotkey'

local window = require 'hs.window'

local application = require 'hs.application'

local hyper = {"ctrl", "alt", "cmd","shift"}



local key2App = {

??d = 'com.alibaba.DingTalkMac',

??f = 'com.apple.finder',

??h = 'com.apple.ActivityMonitor',

??w = 'com.tencent.xinWeChat',

??c = 'com.google.Chrome',

??i = 'com.jetbrains.intellij',

??s = 'com.apple.Safari',

??t = 'org.tabby',

??n = 'notion.id'

}


for key, app in pairs(key2App) do

hotkey.bind(

??hyper,

??key,

??function()

????--application.launchOrFocus(app)

????toggle_application(app)

????--hs.grid.set(hs.window.focusedWindow(), gomiddle)

??end

)

end


-- Toggle application focus

function toggle_application(_app)

-- finds a running applications

local app = application.find(_app)


if app == nil then

??hs.application.open(_app,0,false)

??print("處于沒有打開過的狀態(tài)下啟動")

??return

end


if not app then

??-- application not running, launch app

??application.launchOrFocus(_app)

??return

end

-- application running, toggle hide/unhide

local mainwin = app:mainWindow()

if mainwin then

??if true == app:isFrontmost() then

????mainwin:application():hide()

??else

????mainwin:application():activate(true)

????mainwin:application():unhide()

????mainwin:focus()

??end

else

??--print("非主窗口打開")

??hs.application.open(_app,0,false)

end

end



---獲取當(dāng)前使用應(yīng)用的 id的方法

-- hotkey.bind(hyper,"m", function()

--???local app = hs.application.frontmostApplication()

--???print("-------------------")

--???print(app:bundleID())

--???print(app:name())

-- end)

Mac高效使用 -- hammerspoon介紹,自動切換輸入法與應(yīng)用快速...的評論 (共 條)

分享到微博請遵守國家法律
乌拉特后旗| 赞皇县| 沙田区| 东莞市| 阿拉善右旗| 哈密市| 桐庐县| 犍为县| 尼勒克县| 崇明县| 蒙山县| 醴陵市| 临澧县| 浮梁县| 滨州市| 盱眙县| 韶山市| 黑河市| 安仁县| 新田县| 渝中区| 郯城县| 田林县| 阿鲁科尔沁旗| 巴里| 贵州省| 民和| 武陟县| 沙田区| 恭城| 开平市| 泗水县| 弋阳县| 同德县| 嘉善县| 盐山县| 宁国市| 柏乡县| 三明市| 汉沽区| 和硕县|