hammerspoon adjustments

This commit is contained in:
Kacper Marzecki 2025-03-20 20:47:18 +01:00
parent 8db95ade26
commit f0695e2160
2 changed files with 15 additions and 3 deletions

11
hammerspoon/init.lua Normal file
View File

@ -0,0 +1,11 @@
hs.hotkey.bind({ "cmd" }, "\\", function()
hs.application.launchOrFocus("Terminal")
hs.timer.doAfter(0.1, function()
hs.osascript.applescript([[
tell application "Terminal"
do script "tmux" in front window
do script "tmux-td" in front window
end tell
]])
end)
end)

View File

@ -16,13 +16,14 @@ end tell
if frontApp is "Terminal" then if frontApp is "Terminal" then
tell application "Terminal" tell application "Terminal"
activate activate
delay 0.1 delay 0.3
tell application "System Events" tell application "System Events"
keystroke "x" using control down -- Send Ctrl + x (tmux prefix) keystroke "x" using control down -- Send Ctrl + x (tmux prefix)
delay 0.1 delay 0.3
keystroke ":kill-session" keystroke ":kill-session"
delay 0.3
key code 36 -- Press Enter to execute :detach key code 36 -- Press Enter to execute :detach
delay 0.2 delay 0.3
keystroke "exit" keystroke "exit"
key code 36 -- Press Enter to execute exit key code 36 -- Press Enter to execute exit
end tell end tell