-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom_debug.lua
30 lines (23 loc) · 888 Bytes
/
custom_debug.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--
-- Functions and keybindings for debugging.
--
local pasteboard = require("hs.pasteboard")
hs.hotkey.bind({'ctrl', 'shift', 'cmd', 'alt'}, 'h', function()
hs.reload()
-- It seems hs.alert doesn't work before or after hs.reload()
-- and the notification often doesn't disappear automatically.
no.notify('Reloading config...')
end)
---@diagnostic disable-next-line: lowercase-global
function copy(text)
pasteboard.setContents(text)
end
hs.hotkey.bind({"ctrl", "shift", "cmd", "alt"}, "p", function()
---@diagnostic disable-next-line: lowercase-global
app = hs.window.focusedWindow():application()
---@diagnostic disable-next-line: lowercase-global
win = hs.window.focusedWindow()
print('Current app name: ' .. app:name())
print('The current app is accessible via the variable `app`.')
print('The current window is accessible via the variable `win`.')
end)