mirror of https://github.com/turtlebasket/env
update hs, kitty
parent
0caf67dcb9
commit
81483cffbf
|
@ -1,9 +1,10 @@
|
||||||
wf=hs.window.filter
|
wf=hs.window.filter
|
||||||
browser = "Brave Browser"
|
browser = "Brave Browser"
|
||||||
|
-- browser = "Chromium"
|
||||||
|
|
||||||
-- Open new / focus existing Finder window in current desktop space
|
-- Open new / focus existing Finder window in current desktop space
|
||||||
|
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "A", function()
|
hs.hotkey.bind({"cmd", "ctrl"}, "X", function()
|
||||||
local app = "Finder"
|
local app = "Finder"
|
||||||
|
|
||||||
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true})
|
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true})
|
||||||
|
@ -28,6 +29,24 @@ end)
|
||||||
|
|
||||||
-- Open new / focus existing terminal window in current desktop space
|
-- Open new / focus existing terminal window in current desktop space
|
||||||
|
|
||||||
|
-- hs.hotkey.bind({"cmd", "ctrl"}, "T", function()
|
||||||
|
-- wf_kitty = wf.new(false):setAppFilter("kitty", {currentSpace=true, visible=true})
|
||||||
|
-- local wins = wf_kitty:getWindows()
|
||||||
|
-- local count = 0
|
||||||
|
-- for _ in pairs(wins) do count = count + 1 end
|
||||||
|
--
|
||||||
|
-- if (count > 0)
|
||||||
|
-- then
|
||||||
|
-- wf_kitty:getWindows()[1]:focus()
|
||||||
|
-- else
|
||||||
|
-- hs.osascript.applescript([[
|
||||||
|
-- tell application "System Events" to tell process "kitty"
|
||||||
|
-- click menu item "New OS Window" of menu "Shell" of menu bar 1
|
||||||
|
-- end tell
|
||||||
|
-- ]])
|
||||||
|
-- end
|
||||||
|
-- end)
|
||||||
|
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "T", function()
|
hs.hotkey.bind({"cmd", "ctrl"}, "T", function()
|
||||||
wf_iterm2 = wf.new(false):setAppFilter("iTerm2", {currentSpace=true, visible=true})
|
wf_iterm2 = wf.new(false):setAppFilter("iTerm2", {currentSpace=true, visible=true})
|
||||||
|
|
||||||
|
@ -122,7 +141,7 @@ end)
|
||||||
-- Open new / focus existing g/n/mac/vim(r) window in current desktop space
|
-- Open new / focus existing g/n/mac/vim(r) window in current desktop space
|
||||||
|
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "E", function()
|
hs.hotkey.bind({"cmd", "ctrl"}, "E", function()
|
||||||
local app = "MacVim"
|
local app = "VimR"
|
||||||
|
|
||||||
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
|
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
|
||||||
|
|
||||||
|
@ -147,34 +166,9 @@ end)
|
||||||
|
|
||||||
-- APP-AGNOSTIC GLOBAL OPEN/FOCUS BINDINGS
|
-- APP-AGNOSTIC GLOBAL OPEN/FOCUS BINDINGS
|
||||||
|
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "I", function() hs.application.open("Insomnia") end)
|
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "D", function() hs.application.open("Discord") end)
|
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "O", function() hs.application.open("Obsidian") end)
|
hs.hotkey.bind({"cmd", "ctrl"}, "O", function() hs.application.open("Obsidian") end)
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "C", function() hs.application.open("Numi") end)
|
hs.hotkey.bind({"cmd", "ctrl"}, "C", function() hs.application.open("Numi") end)
|
||||||
|
hs.hotkey.bind({"cmd", "ctrl"}, "S", function() hs.application.open("Signal") end)
|
||||||
|
|
||||||
-- Show Desktop (like windows or KDE)
|
|
||||||
|
|
||||||
hs.hotkey.bind({"alt"}, "d", function()
|
|
||||||
hs.eventtap.keyStroke({"fn"}, "f11")
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Switch Desktops (like windows or KDE)
|
|
||||||
|
|
||||||
hs.hotkey.bind({"ctrl", "alt"}, "left", function()
|
|
||||||
hs.eventtap.keyStroke({"ctrl"}, "left")
|
|
||||||
end)
|
|
||||||
|
|
||||||
hs.hotkey.bind({"ctrl", "alt"}, "right", function()
|
|
||||||
hs.eventtap.keyStroke({"ctrl"}, "right")
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
-- Expose Windows (Mission Control)
|
|
||||||
|
|
||||||
hs.hotkey.bind({"alt"}, "tab", function()
|
|
||||||
hs.application.open("Mission Control"):activate()
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Clear clipboard
|
-- Clear clipboard
|
||||||
|
|
||||||
|
@ -183,29 +177,71 @@ hs.hotkey.bind({"cmd", "shift", "ctrl"}, "C", function()
|
||||||
hs.notify.new({title="Cleared clipboard."}):send()
|
hs.notify.new({title="Cleared clipboard."}):send()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- The ShiftIt Alternative
|
|
||||||
|
|
||||||
units = {
|
-------------------
|
||||||
right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 },
|
-- A R C H I V E --
|
||||||
right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 },
|
-------------------
|
||||||
left50 = { x = 0.00, y = 0.00, w = 0.50, h = 1.00 },
|
|
||||||
left50 = { x = 0.00, y = 0.00, w = 0.50, h = 1.00 },
|
|
||||||
top50 = { x = 0.00, y = 0.00, w = 1.00, h = 0.50 },
|
|
||||||
bot50 = { x = 0.00, y = 0.50, w = 1.00, h = 0.50 },
|
|
||||||
upright50 = { x = 0.50, y = 0.00, w = 0.50, h = 0.50 },
|
|
||||||
botright50 = { x = 0.50, y = 0.50, w = 0.50, h = 0.50 },
|
|
||||||
upleft50 = { x = 0.00, y = 0.00, w = 0.50, h = 0.50 },
|
|
||||||
botleft50 = { x = 0.00, y = 0.50, w = 0.50, h = 0.50 },
|
|
||||||
maximum = { x = 0.00, y = 0.00, w = 1.00, h = 1.00 }
|
|
||||||
}
|
|
||||||
|
|
||||||
mash = { 'shift', 'ctrl', 'cmd' }
|
-- Desktop Action Hotkeys (MOVED TO SYSTEM SETTINGS)
|
||||||
hs.hotkey.bind(mash, 'l', function() hs.window.focusedWindow():move(units.right50, nil, true) end)
|
|
||||||
hs.hotkey.bind(mash, 'h', function() hs.window.focusedWindow():move(units.left50, nil, true) end)
|
-- -- Show Desktop (like windows or KDE)
|
||||||
hs.hotkey.bind(mash, 'k', function() hs.window.focusedWindow():move(units.top50, nil, true) end)
|
--
|
||||||
hs.hotkey.bind(mash, 'j', function() hs.window.focusedWindow():move(units.bot50, nil, true) end)
|
-- hs.hotkey.bind({"alt"}, "d", function()
|
||||||
hs.hotkey.bind(mash, ']', function() hs.window.focusedWindow():move(units.upright50, nil, true) end)
|
-- hs.eventtap.keyStroke({"fn"}, "f11")
|
||||||
hs.hotkey.bind(mash, '[', function() hs.window.focusedWindow():move(units.upleft50, nil, true) end)
|
-- end)
|
||||||
hs.hotkey.bind(mash, ';', function() hs.window.focusedWindow():move(units.botleft50, nil, true) end)
|
--
|
||||||
hs.hotkey.bind(mash, "'", function() hs.window.focusedWindow():move(units.botright50, nil, true) end)
|
-- -- Switch Desktops (like windows or KDE)
|
||||||
hs.hotkey.bind(mash, 'm', function() hs.window.focusedWindow():move(units.maximum, nil, true) end)
|
--
|
||||||
|
-- hs.hotkey.bind({"ctrl", "alt"}, "left", function()
|
||||||
|
-- hs.eventtap.keyStroke({"ctrl"}, "left")
|
||||||
|
-- end)
|
||||||
|
--
|
||||||
|
-- hs.hotkey.bind({"ctrl", "alt"}, "right", function()
|
||||||
|
-- hs.eventtap.keyStroke({"ctrl"}, "right")
|
||||||
|
-- end)
|
||||||
|
--
|
||||||
|
--
|
||||||
|
-- -- Expose Windows (Mission Control)
|
||||||
|
--
|
||||||
|
-- hs.hotkey.bind({"alt"}, "tab", function()
|
||||||
|
-- hs.application.open("Mission Control"):activate()
|
||||||
|
-- end)
|
||||||
|
|
||||||
|
|
||||||
|
-- Move windows between displays
|
||||||
|
|
||||||
|
-- hs.hotkey.bind({"ctrl", "shift"}, "right", function()
|
||||||
|
-- hs.window.focusedWindow():moveToScreen(hs.screen:next())
|
||||||
|
-- end)
|
||||||
|
--
|
||||||
|
-- hs.hotkey.bind({"ctrl", "shift"}, "left", function()
|
||||||
|
-- hs.window.focusedWindow():moveToScreen(hs.screen:previous())
|
||||||
|
-- end)
|
||||||
|
|
||||||
|
|
||||||
|
-- The ShiftIt Alternative (MOVED TO RECTANGLE)
|
||||||
|
|
||||||
|
-- units = {
|
||||||
|
-- right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 },
|
||||||
|
-- right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 },
|
||||||
|
-- left50 = { x = 0.00, y = 0.00, w = 0.50, h = 1.00 },
|
||||||
|
-- left50 = { x = 0.00, y = 0.00, w = 0.50, h = 1.00 },
|
||||||
|
-- top50 = { x = 0.00, y = 0.00, w = 1.00, h = 0.50 },
|
||||||
|
-- bot50 = { x = 0.00, y = 0.50, w = 1.00, h = 0.50 },
|
||||||
|
-- upright50 = { x = 0.50, y = 0.00, w = 0.50, h = 0.50 },
|
||||||
|
-- botright50 = { x = 0.50, y = 0.50, w = 0.50, h = 0.50 },
|
||||||
|
-- upleft50 = { x = 0.00, y = 0.00, w = 0.50, h = 0.50 },
|
||||||
|
-- botleft50 = { x = 0.00, y = 0.50, w = 0.50, h = 0.50 },
|
||||||
|
-- maximum = { x = 0.00, y = 0.00, w = 1.00, h = 1.00 }
|
||||||
|
-- }
|
||||||
|
--
|
||||||
|
-- mash = { 'shift', 'ctrl', 'cmd' }
|
||||||
|
-- hs.hotkey.bind(mash, 'l', function() hs.window.focusedWindow():move(units.right50, nil, true) end)
|
||||||
|
-- hs.hotkey.bind(mash, 'h', function() hs.window.focusedWindow():move(units.left50, nil, true) end)
|
||||||
|
-- hs.hotkey.bind(mash, 'k', function() hs.window.focusedWindow():move(units.top50, nil, true) end)
|
||||||
|
-- hs.hotkey.bind(mash, 'j', function() hs.window.focusedWindow():move(units.bot50, nil, true) end)
|
||||||
|
-- hs.hotkey.bind(mash, ']', function() hs.window.focusedWindow():move(units.upright50, nil, true) end)
|
||||||
|
-- hs.hotkey.bind(mash, '[', function() hs.window.focusedWindow():move(units.upleft50, nil, true) end)
|
||||||
|
-- hs.hotkey.bind(mash, ';', function() hs.window.focusedWindow():move(units.botleft50, nil, true) end)
|
||||||
|
-- hs.hotkey.bind(mash, "'", function() hs.window.focusedWindow():move(units.botright50, nil, true) end)
|
||||||
|
-- hs.hotkey.bind(mash, 'm', function() hs.window.focusedWindow():move(units.maximum, nil, true) end)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue