mirror of
https://github.com/turtlebasket/env.git
synced 2026-03-05 12:04:27 -08:00
misc macos updates
This commit is contained in:
@@ -1,429 +1,517 @@
|
||||
wf=hs.window.filter
|
||||
ffBrowser = "Firefox"
|
||||
chromiumBrowser = "Brave Browser"
|
||||
-- browser = "Chromium"
|
||||
wf = hs.window.filter
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- Open new / focus existing Finder window in current desktop space
|
||||
--------------------------------------------------------------------
|
||||
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "X", function()
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "X", function()
|
||||
local app = "Finder"
|
||||
|
||||
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true})
|
||||
wf_app = wf.new(false):setAppFilter(app, { currentSpace = true })
|
||||
|
||||
local wins = wf_app:getWindows()
|
||||
local count = 0
|
||||
for _ in pairs(wins) do count = count + 1 end
|
||||
|
||||
if (count > 0)
|
||||
then
|
||||
wf_app:getWindows()[1]:focus()
|
||||
else
|
||||
hs.osascript.applescript(string.format([[
|
||||
tell application "System Events" to tell process "%s"
|
||||
click menu item "New Finder Window" of menu "File" of menu bar 1
|
||||
set frontmost to true
|
||||
end tell
|
||||
]], app))
|
||||
for _ in pairs(wins) do
|
||||
count = count + 1
|
||||
end
|
||||
|
||||
if count > 0 then
|
||||
wf_app:getWindows()[1]:focus()
|
||||
else
|
||||
hs.osascript.applescript(string.format(
|
||||
[[
|
||||
tell application "System Events" to tell process "%s"
|
||||
click menu item "New Finder Window" of menu "File" of menu bar 1
|
||||
set frontmost to true
|
||||
end tell
|
||||
]],
|
||||
app
|
||||
))
|
||||
end
|
||||
end)
|
||||
|
||||
-- Open new / focus existing terminal window in current desktop space
|
||||
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "T", function()
|
||||
-- -- Adjust the app filter to Warp
|
||||
-- wf_warp = wf.new(false):setAppFilter("Warp", {currentSpace=true, visible=true})
|
||||
--
|
||||
-- local wins = wf_warp:getWindows()
|
||||
-- local count = 0
|
||||
-- for _ in pairs(wins) do count = count + 1 end
|
||||
--
|
||||
-- if (count > 0) then
|
||||
-- wf_warp:getWindows()[1]:focus()
|
||||
-- else
|
||||
-- hs.osascript.applescript([[
|
||||
-- tell application "System Events" to tell process "Warp"
|
||||
-- click menu item "New Window" of menu "File" of menu bar 1
|
||||
-- end tell
|
||||
-- ]])
|
||||
-- end
|
||||
-- end)
|
||||
function focusOrOpenGhostty()
|
||||
wf_ghostty = wf.new(false):setAppFilter("Ghostty", { currentSpace = true, visible = true })
|
||||
|
||||
-- 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)
|
||||
local wins = wf_ghostty:getWindows()
|
||||
local count = 0
|
||||
for _ in pairs(wins) do
|
||||
count = count + 1
|
||||
end
|
||||
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "T", function()
|
||||
wf_iterm2 = wf.new(false):setAppFilter("iTerm2", {currentSpace=true, visible=true})
|
||||
if count > 0 then
|
||||
wf_ghostty:getWindows()[1]:focus()
|
||||
else
|
||||
hs.osascript.applescript([[
|
||||
tell application "System Events" to tell process "Ghostty"
|
||||
click menu item "New Window" of menu "File" of menu bar 1
|
||||
end tell
|
||||
]])
|
||||
end
|
||||
end
|
||||
|
||||
function focusOrOpenWarp()
|
||||
-- Adjust the app filter to Warp
|
||||
wf_warp = wf.new(false):setAppFilter("Warp", { currentSpace = true, visible = true })
|
||||
|
||||
local wins = wf_warp:getWindows()
|
||||
local count = 0
|
||||
for _ in pairs(wins) do
|
||||
count = count + 1
|
||||
end
|
||||
|
||||
if count > 0 then
|
||||
wf_warp:getWindows()[1]:focus()
|
||||
else
|
||||
hs.osascript.applescript([[
|
||||
tell application "System Events" to tell process "Warp"
|
||||
click menu item "New Window" of menu "File" of menu bar 1
|
||||
end tell
|
||||
]])
|
||||
end
|
||||
end
|
||||
|
||||
function focusOrOpenKitty()
|
||||
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
|
||||
|
||||
function focusOrOpeniTerm()
|
||||
wf_iterm2 = wf.new(false):setAppFilter("iTerm2", { currentSpace = true, visible = true })
|
||||
|
||||
local wins = wf_iterm2:getWindows()
|
||||
local count = 0
|
||||
for _ in pairs(wins) do count = count + 1 end
|
||||
for _ in pairs(wins) do
|
||||
count = count + 1
|
||||
end
|
||||
|
||||
if (count > 0)
|
||||
then
|
||||
if count > 0 then
|
||||
wf_iterm2:getWindows()[1]:focus()
|
||||
else
|
||||
hs.osascript.applescript([[
|
||||
tell application "iTerm"
|
||||
create window with default profile
|
||||
activate
|
||||
end tell
|
||||
]])
|
||||
tell application "iTerm"
|
||||
create window with default profile
|
||||
activate
|
||||
end tell
|
||||
]])
|
||||
end
|
||||
end
|
||||
|
||||
end)
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "T", focusOrOpeniTerm)
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- Open new / focus existing browser window in current desktop space
|
||||
--------------------------------------------------------------------
|
||||
|
||||
ffBrowser = "Firefox"
|
||||
chromiumBrowser = "Brave Browser"
|
||||
|
||||
function focusOrOpenFirefox()
|
||||
|
||||
-- assumes wf_browser is the name of a firefox-based browser
|
||||
wf_browser = wf.new(false):setAppFilter(ffBrowser, {currentSpace=true, visible=true})
|
||||
wf_browser = wf.new(false):setAppFilter(ffBrowser, { currentSpace = true, visible = true })
|
||||
|
||||
local wins = wf_browser:getWindows()
|
||||
local count = 0
|
||||
for _ in pairs(wins) do count = count + 1 end
|
||||
|
||||
if (count > 0)
|
||||
then
|
||||
for _ in pairs(wins) do
|
||||
count = count + 1
|
||||
end
|
||||
|
||||
if count > 0 then
|
||||
wf_browser:getWindows()[1]:focus()
|
||||
-- print(count)
|
||||
else
|
||||
-- for firefox:
|
||||
hs.osascript.applescript(string.format([[
|
||||
tell application "System Events" to tell process "%s"
|
||||
click menu item "New Window" of menu "File" of menu bar 1
|
||||
set frontmost to true
|
||||
end tell
|
||||
]], ffBrowser))
|
||||
hs.osascript.applescript(string.format(
|
||||
[[
|
||||
tell application "System Events" to tell process "%s"
|
||||
click menu item "New Window" of menu "File" of menu bar 1
|
||||
set frontmost to true
|
||||
end tell
|
||||
]],
|
||||
ffBrowser
|
||||
))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function focusOrOpenChromium()
|
||||
|
||||
-- assumes wf_browser is the name of a chromium-based browser
|
||||
wf_browser = wf.new(false):setAppFilter(chromiumBrowser, {currentSpace=true, visible=true})
|
||||
wf_browser = wf.new(false):setAppFilter(chromiumBrowser, { currentSpace = true, visible = true })
|
||||
|
||||
local wins = wf_browser:getWindows()
|
||||
local count = 0
|
||||
for _ in pairs(wins) do count = count + 1 end
|
||||
|
||||
if (count > 0)
|
||||
then
|
||||
for _ in pairs(wins) do
|
||||
count = count + 1
|
||||
end
|
||||
|
||||
if count > 0 then
|
||||
wf_browser:getWindows()[1]:focus()
|
||||
-- print(count)
|
||||
else
|
||||
hs.osascript.applescript(string.format([[
|
||||
tell application "%s"
|
||||
make new window
|
||||
activate
|
||||
end tell
|
||||
]], chromiumBrowser))
|
||||
hs.osascript.applescript(string.format(
|
||||
[[
|
||||
tell application "%s"
|
||||
make new window
|
||||
activate
|
||||
end tell
|
||||
]],
|
||||
chromiumBrowser
|
||||
))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "W", focusOrOpenChromium)
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "W", focusOrOpenChromium)
|
||||
|
||||
|
||||
-- CHROMIUM-BASED BROWSERS ONLY: Open new tab to right of current browser
|
||||
-- NOTE: currently replaced with binding in chromiumsystem settings
|
||||
-- CHROMIUM-BASED BROWSERS ONLY: Open new tab to right of currently-focused one
|
||||
-- NOTE: This can be replaced with a dedicated keybind in chromium system settings
|
||||
-- hs.hotkey.bind({"cmd", "option"}, "T", function()
|
||||
--
|
||||
-- local focusedAppName = hs.window.focusedWindow():application():title()
|
||||
--
|
||||
-- if focusedAppName == chromiumBrowser
|
||||
-- then
|
||||
-- hs.osascript.applescript(string.format([[
|
||||
-- tell application "System Events" to tell process "%s"
|
||||
-- click menu item "New Tab to the Right" of menu "Tab" of menu bar 1
|
||||
-- end tell
|
||||
-- ]], focusedAppName))
|
||||
-- else
|
||||
-- hs.notify.new({title=string.format("%s not focused.", browser)}):send()
|
||||
-- end
|
||||
--
|
||||
--
|
||||
-- local focusedAppName = hs.window.focusedWindow():application():title()
|
||||
--
|
||||
-- if focusedAppName == chromiumBrowser
|
||||
-- then
|
||||
-- hs.osascript.applescript(string.format([[
|
||||
-- tell application "System Events" to tell process "%s"
|
||||
-- click menu item "New Tab to the Right" of menu "Tab" of menu bar 1
|
||||
-- end tell
|
||||
-- ]], focusedAppName))
|
||||
-- else
|
||||
-- hs.notify.new({title=string.format("%s not focused.", browser)}):send()
|
||||
-- end
|
||||
-- end)
|
||||
|
||||
|
||||
-- Open new / focus existing vscode window in current desktop space
|
||||
-- app = VSCodium, Code, or Cursor
|
||||
function openVsCode(app)
|
||||
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
|
||||
wf_app = wf.new(false):setAppFilter(app, { currentSpace = true, visible = true })
|
||||
|
||||
local wins = wf_app:getWindows()
|
||||
local count = 0
|
||||
for _ in pairs(wins) do count = count + 1 end
|
||||
|
||||
if (count > 0) then
|
||||
for _ in pairs(wins) do
|
||||
count = count + 1
|
||||
end
|
||||
|
||||
if count > 0 then
|
||||
wf_app:getWindows()[1]:focus()
|
||||
else
|
||||
hs.osascript.applescript(string.format([[
|
||||
hs.osascript.applescript(string.format(
|
||||
[[
|
||||
tell application "System Events" to tell process "%s"
|
||||
click menu item "New Window" of menu "File" of menu bar 1
|
||||
set frontmost to true
|
||||
end tell
|
||||
]], app))
|
||||
]],
|
||||
app
|
||||
))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
-- Focus or open editor of choice in current desktop space
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- superbinding to use both cursor and vscode
|
||||
-- try to focus cursor (primarily) or vscode (secondarily), then open cursor if neither is open
|
||||
function tryFocusCursorOrVSCodeThenOpenCursor()
|
||||
wf_cursor= wf.new(false):setAppFilter("Cursor", {currentSpace=true, visible=true})
|
||||
wf_vscode= wf.new(false):setAppFilter("Code", {currentSpace=true, visible=true})
|
||||
-- superbinding to use multiple editors with a preferred order
|
||||
-- e.g. try to focus cursor (primarily) or vscode (secondarily), then open cursor if neither is open
|
||||
function tryFocusAnEditorThenOpenCursor()
|
||||
wf_cursor = wf.new(false):setAppFilter("Cursor", { currentSpace = true, visible = true })
|
||||
wf_vscode = wf.new(false):setAppFilter("Code", { currentSpace = true, visible = true })
|
||||
|
||||
local cursor_wins = wf_cursor:getWindows()
|
||||
local cursor_count = 0
|
||||
for _ in pairs(cursor_wins) do cursor_count = cursor_count + 1 end
|
||||
for _ in pairs(cursor_wins) do
|
||||
cursor_count = cursor_count + 1
|
||||
end
|
||||
|
||||
local vscode_wins = wf_vscode:getWindows()
|
||||
local vscode_count = 0
|
||||
for _ in pairs(vscode_wins) do vscode_count = vscode_count + 1 end
|
||||
for _ in pairs(vscode_wins) do
|
||||
vscode_count = vscode_count + 1
|
||||
end
|
||||
|
||||
if (cursor_count > 0) then
|
||||
if cursor_count > 0 then
|
||||
wf_cursor:getWindows()[1]:focus()
|
||||
elseif (vscode_count > 0) then
|
||||
elseif vscode_count > 0 then
|
||||
wf_vscode:getWindows()[1]:focus()
|
||||
else
|
||||
hs.osascript.applescript(string.format([[
|
||||
hs.osascript.applescript(string.format(
|
||||
[[
|
||||
tell application "System Events" to tell process "%s"
|
||||
click menu item "New Window" of menu "File" of menu bar 1
|
||||
set frontmost to true
|
||||
end tell
|
||||
]], "Cursor"))
|
||||
]],
|
||||
"Cursor"
|
||||
))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "E", function()
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "E", function()
|
||||
-- openVsCode("Cursor")
|
||||
-- openVsCode("Code")
|
||||
tryFocusCursorOrVSCodeThenOpenCursor()
|
||||
tryFocusAnEditorThenOpenCursor()
|
||||
end)
|
||||
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "V", function()
|
||||
openVsCode("Code")
|
||||
end)
|
||||
|
||||
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "V", function()
|
||||
-- openVsCode("Code")
|
||||
-- openVsCode("VSCodium")
|
||||
|
||||
-- No neovide function because it doesn't support system events (yet)
|
||||
-- hs.application.open("Neovide")
|
||||
-- end)
|
||||
|
||||
|
||||
|
||||
-- Open new / focus existing g/n/mac/vim(r) window in current desktop space
|
||||
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "E", function()
|
||||
-- local app = "VimR"
|
||||
--
|
||||
-- wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
|
||||
--
|
||||
-- local wins = wf_app:getWindows()
|
||||
-- local count = 0
|
||||
-- for _ in pairs(wins) do count = count + 1 end
|
||||
--
|
||||
-- if (count > 0)
|
||||
-- then
|
||||
-- wf_app:getWindows()[1]:focus()
|
||||
-- else
|
||||
-- hs.osascript.applescript(string.format([[
|
||||
-- tell application "System Events" to tell process "%s"
|
||||
-- click menu item "New Window" of menu "File" of menu bar 1
|
||||
-- set frontmost to true
|
||||
-- end tell
|
||||
-- ]], app))
|
||||
--
|
||||
-- end
|
||||
--
|
||||
-- local app = "VimR"
|
||||
--
|
||||
-- wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
|
||||
--
|
||||
-- local wins = wf_app:getWindows()
|
||||
-- local count = 0
|
||||
-- for _ in pairs(wins) do count = count + 1 end
|
||||
--
|
||||
-- if (count > 0)
|
||||
-- then
|
||||
-- wf_app:getWindows()[1]:focus()
|
||||
-- else
|
||||
-- hs.osascript.applescript(string.format([[
|
||||
-- tell application "System Events" to tell process "%s"
|
||||
-- click menu item "New Window" of menu "File" of menu bar 1
|
||||
-- set frontmost to true
|
||||
-- end tell
|
||||
-- ]], app))
|
||||
--
|
||||
-- end
|
||||
--
|
||||
-- end)
|
||||
|
||||
-- APP-AGNOSTIC GLOBAL OPEN/FOCUS BINDINGS
|
||||
|
||||
-- common apps
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "R", function() hs.application.open("Obsidian") end)
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "M", function() hs.application.open("Spotify") end)
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "G", function() hs.application.open("Google Calendar") end)
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "Z", function() hs.application.open("Preview") end)
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "C", function() hs.application.open("Open WebUI") end)
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "R", function() hs.application.open("Obsidian") end)
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "M", function()
|
||||
hs.application.open("Spotify")
|
||||
end)
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "G", function()
|
||||
hs.application.open("Google Calendar")
|
||||
end)
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "Z", function()
|
||||
hs.application.open("Preview")
|
||||
end)
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "C", function()
|
||||
hs.application.open("Open WebUI")
|
||||
end)
|
||||
|
||||
-- annoying apps (must manually open)
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "A", function() switchToIfApplicationOpen("Telegram") end)
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "S", function() switchToIfApplicationOpen("Signal") end)
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "N", function() switchToIfApplicationOpen("Numi") end)
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "S", function() switchToIfApplicationOpen("Texts") end)
|
||||
-- hs.hotkey.bind({"cmd", "ctrl", "shift"}, "S", function() hs.application.open("Signal") end)
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "K", function() switchToIfApplicationOpen("KiCad") end)
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "C", function() switchToIfApplicationOpen("CLion") end)
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "J", function() switchToIfApplicationOpen("IntelliJ IDEA") end)
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "L", function() switchToIfApplicationOpen("Linear") end)
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "L", function() switchToIfApplicationOpen("LTspice") end)
|
||||
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "A", function()
|
||||
switchToIfApplicationOpen("Telegram")
|
||||
end)
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "S", function()
|
||||
switchToIfApplicationOpen("Signal")
|
||||
end)
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "N", function()
|
||||
switchToIfApplicationOpen("Numi")
|
||||
end)
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "S", function() switchToIfApplicationOpen("Texts") end)
|
||||
-- hs.hotkey.bind({"cmd", "ctrl", "shift"}, "S", function() hs.application.open("Signal") end)
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "K", function()
|
||||
switchToIfApplicationOpen("KiCad")
|
||||
end)
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "C", function() switchToIfApplicationOpen("CLion") end)
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "J", function()
|
||||
switchToIfApplicationOpen("IntelliJ IDEA")
|
||||
end)
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "L", function() switchToIfApplicationOpen("Linear") end)
|
||||
hs.hotkey.bind({ "cmd", "ctrl" }, "L", function()
|
||||
switchToIfApplicationOpen("LTspice")
|
||||
end)
|
||||
|
||||
-- Clear clipboard
|
||||
|
||||
hs.hotkey.bind({"cmd", "shift", "ctrl"}, "C", function()
|
||||
hs.hotkey.bind({ "cmd", "shift", "ctrl" }, "C", function()
|
||||
hs.pasteboard.setContents("")
|
||||
hs.notify.new({title="Cleared clipboard."}):send()
|
||||
hs.notify.new({ title = "Cleared clipboard." }):send()
|
||||
end)
|
||||
|
||||
-- open Perplexity in Brave-based browser
|
||||
-- 1. if perplexity is already open in most recent Brave window, switch to it and open
|
||||
-- perplexity in new tab to the right
|
||||
-- 2. if not, switch to most recent Brave window and open perplexity
|
||||
hs.hotkey.bind({ "cmd", "shift" }, "space", function()
|
||||
hs.osascript.applescript(string.format(
|
||||
[[
|
||||
tell application "%s"
|
||||
if (count of windows) = 0 then
|
||||
make new window
|
||||
end if
|
||||
activate
|
||||
|
||||
set foundTab to false
|
||||
set tabIndex to 0
|
||||
repeat with i from 1 to (count of tabs of front window)
|
||||
if URL of tab i of front window contains "perplexity.ai" then
|
||||
set foundTab to true
|
||||
set tabIndex to i
|
||||
exit repeat
|
||||
end if
|
||||
end repeat
|
||||
|
||||
if foundTab then
|
||||
set active tab index of front window to tabIndex
|
||||
else
|
||||
tell application "System Events" to tell process "%s"
|
||||
click menu item "New Tab to the Right" of menu "Tab" of menu bar 1
|
||||
end tell
|
||||
|
||||
delay 0.01
|
||||
|
||||
set URL of active tab of front window to "https://perplexity.ai"
|
||||
end if
|
||||
end tell
|
||||
]],
|
||||
chromiumBrowser,
|
||||
chromiumBrowser
|
||||
))
|
||||
end)
|
||||
|
||||
--------------------------------------
|
||||
---------------------------------------------------------------------------
|
||||
-- DESKTOP SWITCHING (axed)
|
||||
-- Retroactive note: it should be harder, not easier, to context-switch :P
|
||||
--------------------------------------
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- function gotoDesktopNumber(desktop)
|
||||
-- local deskstr = string.format("Desktop %d", desktop)
|
||||
-- local index = 0
|
||||
-- for item in hs.spaces.spacesForScreen("Main") do
|
||||
-- if item == deskstr then
|
||||
-- break
|
||||
-- else
|
||||
-- index = index + 1
|
||||
-- end
|
||||
-- end
|
||||
-- print("INDEX ", index)
|
||||
-- hs.spaces.gotoSpace(index)
|
||||
-- local index = 0
|
||||
-- for item in hs.spaces.spacesForScreen("Main") do
|
||||
-- if item == deskstr then
|
||||
-- break
|
||||
-- else
|
||||
-- index = index + 1
|
||||
-- end
|
||||
-- end
|
||||
-- print("INDEX ", index)
|
||||
-- hs.spaces.gotoSpace(index)
|
||||
-- end
|
||||
--
|
||||
--
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "1", function() gotoDesktopNumber(1) end)
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "2", function() gotoDesktopNumber(2) end)
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "3", function() gotoDesktopNumber(3) end)
|
||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "4", function() gotoDesktopNumber(4) end)
|
||||
|
||||
--------------------------------------
|
||||
---------------------------------------------------------------------------
|
||||
-- SWITCH TO IF OPEN
|
||||
-- Switches to application if there's an instance of it open
|
||||
--------------------------------------
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
function switchToIfWindowOpen(app)
|
||||
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
|
||||
wf_app = wf.new(false):setAppFilter(app, { currentSpace = true, visible = true })
|
||||
|
||||
local wins = wf_app:getWindows()
|
||||
local count = 0
|
||||
for _ in pairs(wins) do count = count + 1 end
|
||||
|
||||
if (count > 0) then
|
||||
for _ in pairs(wins) do
|
||||
count = count + 1
|
||||
end
|
||||
|
||||
if count > 0 then
|
||||
wf_app:getWindows()[1]:focus()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--------------------------------------
|
||||
---------------------------------------------------------------------------
|
||||
-- SWITCH TO IF GLOBALLY OPEN
|
||||
-- Switches to application if there's an instance of it open
|
||||
--------------------------------------
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
function switchToIfApplicationOpen(appName)
|
||||
local runningApps = hs.application.runningApplications()
|
||||
local isOpen = false
|
||||
for _, app in pairs(runningApps) do
|
||||
if app:name() == appName then
|
||||
isOpen = true
|
||||
break
|
||||
end
|
||||
end
|
||||
local runningApps = hs.application.runningApplications()
|
||||
local isOpen = false
|
||||
for _, app in pairs(runningApps) do
|
||||
if app:name() == appName then
|
||||
isOpen = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if (isOpen) then
|
||||
hs.application.open(appName)
|
||||
end
|
||||
if isOpen then
|
||||
hs.application.open(appName)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--------------------------------------
|
||||
---------------------------------------------------------------------------
|
||||
-- KEY COMBO TO APPLICATION
|
||||
-- Sends keystrokes but only if the specified application is focused
|
||||
--------------------------------------
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
function sendKeyComboToApplication(appComboTable)
|
||||
|
||||
for appComboPair in ipairs(appComboTable) do
|
||||
|
||||
app = appComboPair[1]
|
||||
mods = appComboPair[2]
|
||||
key = appComboPair[3]
|
||||
|
||||
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
|
||||
|
||||
wf_app = wf.new(false):setAppFilter(app, { currentSpace = true, visible = true })
|
||||
|
||||
local wins = wf_app:getWindows()
|
||||
local count = 0
|
||||
for _ in pairs(wins) do count = count + 1 end
|
||||
|
||||
if (count > 0)
|
||||
then
|
||||
hs.eventtap.keyStroke(mods, key)
|
||||
for _ in pairs(wins) do
|
||||
count = count + 1
|
||||
end
|
||||
|
||||
if count > 0 then
|
||||
hs.eventtap.keyStroke(mods, key)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-------------------
|
||||
-- A R C H I V E --
|
||||
-------------------
|
||||
---------------------------------------------------------------------------
|
||||
-- ARCHIVE
|
||||
--
|
||||
-- Notes:
|
||||
-- - Win-tab is now just set in system settings
|
||||
-- - Desktop / window action hotkeys are now managed with Rectangle.app
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Desktop Action Hotkeys (MOVED TO SYSTEM SETTINGS)
|
||||
|
||||
-- -- Show Desktop (like windows or KDE)
|
||||
--
|
||||
--
|
||||
-- hs.hotkey.bind({"alt"}, "d", function()
|
||||
-- hs.eventtap.keyStroke({"fn"}, "f11")
|
||||
-- hs.eventtap.keyStroke({"fn"}, "f11")
|
||||
-- end)
|
||||
--
|
||||
--
|
||||
-- -- Switch Desktops (like windows or KDE)
|
||||
--
|
||||
--
|
||||
-- hs.hotkey.bind({"ctrl", "alt"}, "left", function()
|
||||
-- hs.eventtap.keyStroke({"ctrl"}, "left")
|
||||
-- hs.eventtap.keyStroke({"ctrl"}, "left")
|
||||
-- end)
|
||||
--
|
||||
--
|
||||
-- hs.hotkey.bind({"ctrl", "alt"}, "right", function()
|
||||
-- hs.eventtap.keyStroke({"ctrl"}, "right")
|
||||
-- hs.eventtap.keyStroke({"ctrl"}, "right")
|
||||
-- end)
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
-- -- Expose Windows (Mission Control)
|
||||
--
|
||||
-- hs.hotkey.bind({"alt"}, "tab", function()
|
||||
-- hs.application.open("Mission Control"):activate()
|
||||
--
|
||||
-- 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())
|
||||
-- hs.window.focusedWindow():moveToScreen(hs.screen:next())
|
||||
-- end)
|
||||
--
|
||||
--
|
||||
-- hs.hotkey.bind({"ctrl", "shift"}, "left", function()
|
||||
-- hs.window.focusedWindow():moveToScreen(hs.screen:previous())
|
||||
-- hs.window.focusedWindow():moveToScreen(hs.screen:previous())
|
||||
-- end)
|
||||
|
||||
|
||||
-- The ShiftIt Alternative (MOVED TO RECTANGLE)
|
||||
-- The ShiftIt Alternative
|
||||
|
||||
-- units = {
|
||||
-- right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 },
|
||||
@@ -438,7 +526,7 @@ end
|
||||
-- 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)
|
||||
@@ -448,4 +536,3 @@ 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)
|
||||
|
||||
|
||||
@@ -10,10 +10,20 @@ The script should do this: \(ai.prompt)</string>
|
||||
<integer>128000</integer>
|
||||
<key>AiModel</key>
|
||||
<string>gpt-4o</string>
|
||||
<key>AitermURL</key>
|
||||
<string>https://api.openai.com/v1/completions</string>
|
||||
<key>AitermUseLegacyAPI</key>
|
||||
<false/>
|
||||
<key>AlternateMouseScroll</key>
|
||||
<true/>
|
||||
<key>ClosingTmuxTabKillsTmuxWindows</key>
|
||||
<true/>
|
||||
<key>ClosingTmuxTabKillsTmuxWindows_selection</key>
|
||||
<integer>1</integer>
|
||||
<key>ClosingTmuxWindowKillsTmuxWindows</key>
|
||||
<true/>
|
||||
<key>ClosingTmuxWindowKillsTmuxWindows_selection</key>
|
||||
<integer>1</integer>
|
||||
<key>Custom Color Presets</key>
|
||||
<dict>
|
||||
<key>Brogrammer</key>
|
||||
@@ -300,6 +310,19 @@ The script should do this: \(ai.prompt)</string>
|
||||
<key>Text</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
<key>0xd-0x20000-0x24</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Keycode</key>
|
||||
<integer>13</integer>
|
||||
<key>Modifiers</key>
|
||||
<integer>131072</integer>
|
||||
<key>Text</key>
|
||||
<string>\n</string>
|
||||
<key>Version</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
<key>0xf700-0x300000</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
@@ -592,7 +615,7 @@ The script should do this: \(ai.prompt)</string>
|
||||
<key>Close Sessions On End</key>
|
||||
<true/>
|
||||
<key>Columns</key>
|
||||
<integer>144</integer>
|
||||
<integer>158</integer>
|
||||
<key>Command</key>
|
||||
<string></string>
|
||||
<key>Cursor Color</key>
|
||||
@@ -869,13 +892,6 @@ The script should do this: \(ai.prompt)</string>
|
||||
<key>Text</key>
|
||||
<string>[1;6A</string>
|
||||
</dict>
|
||||
<key>0xf700-0x280000</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x1b 0x1b 0x5b 0x41</string>
|
||||
</dict>
|
||||
<key>0xf701-0x220000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
@@ -897,13 +913,6 @@ The script should do this: \(ai.prompt)</string>
|
||||
<key>Text</key>
|
||||
<string>[1;6B</string>
|
||||
</dict>
|
||||
<key>0xf701-0x280000</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x1b 0x1b 0x5b 0x42</string>
|
||||
</dict>
|
||||
<key>0xf702-0x220000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
@@ -1196,9 +1205,796 @@ The script should do this: \(ai.prompt)</string>
|
||||
<key>Working Directory</key>
|
||||
<string>/Users/michael</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ASCII Anti Aliased</key>
|
||||
<true/>
|
||||
<key>ASCII Ligatures</key>
|
||||
<false/>
|
||||
<key>Ambiguous Double Width</key>
|
||||
<false/>
|
||||
<key>Ansi 0 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.12343787401914597</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.12343578040599823</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.1234394758939743</real>
|
||||
</dict>
|
||||
<key>Ansi 1 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.095619738101959229</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.067135065793991089</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.97170770168304443</real>
|
||||
</dict>
|
||||
<key>Ansi 10 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.379891037940979</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.82695949077606201</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.11459558457136154</real>
|
||||
</dict>
|
||||
<key>Ansi 11 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.035377603024244308</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.74144089221954346</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.95126962661743164</real>
|
||||
</dict>
|
||||
<key>Ansi 12 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.838664710521698</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.50448882579803467</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.061654355376958847</real>
|
||||
</dict>
|
||||
<key>Ansi 13 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.72698760032653809</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.3135044276714325</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.32478702068328857</real>
|
||||
</dict>
|
||||
<key>Ansi 14 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.85764402151107788</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.4900696873664856</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.059441849589347839</real>
|
||||
</dict>
|
||||
<key>Ansi 15 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>1</real>
|
||||
<key>Green Component</key>
|
||||
<real>1</real>
|
||||
<key>Red Component</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<key>Ansi 2 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.36823004484176636</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.77383565902709961</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.17600196599960327</real>
|
||||
</dict>
|
||||
<key>Ansi 3 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.060177117586135864</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.72761225700378418</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.92706489562988281</real>
|
||||
</dict>
|
||||
<key>Ansi 4 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.82454067468643188</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.51804500818252563</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.16567224264144897</real>
|
||||
</dict>
|
||||
<key>Ansi 5 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.71787959337234497</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.35215187072753906</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.30770933628082275</real>
|
||||
</dict>
|
||||
<key>Ansi 6 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.838664710521698</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.50448882579803467</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.061654355376958847</real>
|
||||
</dict>
|
||||
<key>Ansi 7 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.89713811874389648</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.8579363226890564</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.84028750658035278</real>
|
||||
</dict>
|
||||
<key>Ansi 8 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.89713811874389648</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.8579363226890564</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.84028750658035278</real>
|
||||
</dict>
|
||||
<key>Ansi 9 Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.1818375289440155</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.20686990022659302</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.87161564826965332</real>
|
||||
</dict>
|
||||
<key>BM Growl</key>
|
||||
<true/>
|
||||
<key>Background Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.076218985021114349</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.076217696070671082</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.07621997594833374</real>
|
||||
</dict>
|
||||
<key>Background Image Location</key>
|
||||
<string></string>
|
||||
<key>Badge Color</key>
|
||||
<dict>
|
||||
<key>Alpha Component</key>
|
||||
<real>0.5</real>
|
||||
<key>Blue Component</key>
|
||||
<real>0.0</real>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Green Component</key>
|
||||
<real>0.1491314172744751</real>
|
||||
<key>Red Component</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<key>Blinking Cursor</key>
|
||||
<false/>
|
||||
<key>Blur</key>
|
||||
<false/>
|
||||
<key>Bold Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.89713811874389648</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.8579363226890564</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.84028750658035278</real>
|
||||
</dict>
|
||||
<key>Character Encoding</key>
|
||||
<integer>4</integer>
|
||||
<key>Close Sessions On End</key>
|
||||
<true/>
|
||||
<key>Columns</key>
|
||||
<integer>144</integer>
|
||||
<key>Command</key>
|
||||
<string></string>
|
||||
<key>Cursor Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.72549021244049072</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.72549021244049072</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.72549021244049072</real>
|
||||
</dict>
|
||||
<key>Cursor Guide Color</key>
|
||||
<dict>
|
||||
<key>Alpha Component</key>
|
||||
<real>0.25</real>
|
||||
<key>Blue Component</key>
|
||||
<real>1</real>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Green Component</key>
|
||||
<real>0.9268307089805603</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.70213186740875244</real>
|
||||
</dict>
|
||||
<key>Cursor Text Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.062745101749897003</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.062745101749897003</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.062745101749897003</real>
|
||||
</dict>
|
||||
<key>Custom Command</key>
|
||||
<string>No</string>
|
||||
<key>Custom Directory</key>
|
||||
<string>No</string>
|
||||
<key>Default Bookmark</key>
|
||||
<string>No</string>
|
||||
<key>Description</key>
|
||||
<string>Default</string>
|
||||
<key>Disable Window Resizing</key>
|
||||
<true/>
|
||||
<key>Faint Text Alpha</key>
|
||||
<real>0.5</real>
|
||||
<key>Flashing Bell</key>
|
||||
<false/>
|
||||
<key>Foreground Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.89713811874389648</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.8579363226890564</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.84028750658035278</real>
|
||||
</dict>
|
||||
<key>Guid</key>
|
||||
<string>38D0C455-B853-46AE-B4AC-947B6FDDCD77</string>
|
||||
<key>Has Hotkey</key>
|
||||
<false/>
|
||||
<key>Horizontal Spacing</key>
|
||||
<real>1</real>
|
||||
<key>Icon</key>
|
||||
<integer>0</integer>
|
||||
<key>Idle Code</key>
|
||||
<integer>0</integer>
|
||||
<key>Jobs to Ignore</key>
|
||||
<array>
|
||||
<string>rlogin</string>
|
||||
<string>ssh</string>
|
||||
<string>slogin</string>
|
||||
<string>telnet</string>
|
||||
</array>
|
||||
<key>Keyboard Map</key>
|
||||
<dict>
|
||||
<key>0x2a-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>*</string>
|
||||
</dict>
|
||||
<key>0x2b-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>+</string>
|
||||
</dict>
|
||||
<key>0x2d-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>-</string>
|
||||
</dict>
|
||||
<key>0x2d-0x40000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x1f</string>
|
||||
</dict>
|
||||
<key>0x2e-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>.</string>
|
||||
</dict>
|
||||
<key>0x2f-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>/</string>
|
||||
</dict>
|
||||
<key>0x3-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0xd</string>
|
||||
</dict>
|
||||
<key>0x30-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
<key>0x31-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
<key>0x32-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>2</string>
|
||||
</dict>
|
||||
<key>0x32-0x40000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x00</string>
|
||||
</dict>
|
||||
<key>0x33-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>3</string>
|
||||
</dict>
|
||||
<key>0x33-0x40000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x1b</string>
|
||||
</dict>
|
||||
<key>0x34-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>4</string>
|
||||
</dict>
|
||||
<key>0x34-0x40000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x1c</string>
|
||||
</dict>
|
||||
<key>0x35-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>5</string>
|
||||
</dict>
|
||||
<key>0x35-0x40000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x1d</string>
|
||||
</dict>
|
||||
<key>0x36-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>6</string>
|
||||
</dict>
|
||||
<key>0x36-0x40000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x1e</string>
|
||||
</dict>
|
||||
<key>0x37-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>7</string>
|
||||
</dict>
|
||||
<key>0x37-0x40000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x1f</string>
|
||||
</dict>
|
||||
<key>0x38-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>8</string>
|
||||
</dict>
|
||||
<key>0x38-0x40000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x7f</string>
|
||||
</dict>
|
||||
<key>0x39-0x200000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>12</integer>
|
||||
<key>Text</key>
|
||||
<string>9</string>
|
||||
</dict>
|
||||
<key>0x7f-0x100000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x15</string>
|
||||
</dict>
|
||||
<key>0x7f-0x80000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x1b 0x7f</string>
|
||||
</dict>
|
||||
<key>0xf700-0x220000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;2A</string>
|
||||
</dict>
|
||||
<key>0xf700-0x240000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;5A</string>
|
||||
</dict>
|
||||
<key>0xf700-0x260000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;6A</string>
|
||||
</dict>
|
||||
<key>0xf701-0x220000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;2B</string>
|
||||
</dict>
|
||||
<key>0xf701-0x240000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;5B</string>
|
||||
</dict>
|
||||
<key>0xf701-0x260000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;6B</string>
|
||||
</dict>
|
||||
<key>0xf702-0x220000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;2D</string>
|
||||
</dict>
|
||||
<key>0xf702-0x240000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;5D</string>
|
||||
</dict>
|
||||
<key>0xf702-0x260000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;6D</string>
|
||||
</dict>
|
||||
<key>0xf702-0x280000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>b</string>
|
||||
</dict>
|
||||
<key>0xf702-0x300000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x1</string>
|
||||
</dict>
|
||||
<key>0xf703-0x220000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;2C</string>
|
||||
</dict>
|
||||
<key>0xf703-0x240000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;5C</string>
|
||||
</dict>
|
||||
<key>0xf703-0x260000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;6C</string>
|
||||
</dict>
|
||||
<key>0xf703-0x280000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>f</string>
|
||||
</dict>
|
||||
<key>0xf703-0x300000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x5</string>
|
||||
</dict>
|
||||
<key>0xf704-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;2P</string>
|
||||
</dict>
|
||||
<key>0xf705-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;2Q</string>
|
||||
</dict>
|
||||
<key>0xf706-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;2R</string>
|
||||
</dict>
|
||||
<key>0xf707-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;2S</string>
|
||||
</dict>
|
||||
<key>0xf708-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[15;2~</string>
|
||||
</dict>
|
||||
<key>0xf709-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[17;2~</string>
|
||||
</dict>
|
||||
<key>0xf70a-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[18;2~</string>
|
||||
</dict>
|
||||
<key>0xf70b-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[19;2~</string>
|
||||
</dict>
|
||||
<key>0xf70c-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[20;2~</string>
|
||||
</dict>
|
||||
<key>0xf70d-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[21;2~</string>
|
||||
</dict>
|
||||
<key>0xf70e-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[23;2~</string>
|
||||
</dict>
|
||||
<key>0xf70f-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[24;2~</string>
|
||||
</dict>
|
||||
<key>0xf728-0x0-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>11</integer>
|
||||
<key>Text</key>
|
||||
<string>0x4</string>
|
||||
</dict>
|
||||
<key>0xf728-0x80000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>d</string>
|
||||
</dict>
|
||||
<key>0xf729-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;2H</string>
|
||||
</dict>
|
||||
<key>0xf729-0x40000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;5H</string>
|
||||
</dict>
|
||||
<key>0xf72b-0x20000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;2F</string>
|
||||
</dict>
|
||||
<key>0xf72b-0x40000-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>10</integer>
|
||||
<key>Text</key>
|
||||
<string>[1;5F</string>
|
||||
</dict>
|
||||
<key>0xf739-0x0-0x0</key>
|
||||
<dict>
|
||||
<key>Action</key>
|
||||
<integer>13</integer>
|
||||
<key>Text</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Link Color</key>
|
||||
<dict>
|
||||
<key>Alpha Component</key>
|
||||
<real>1</real>
|
||||
<key>Blue Component</key>
|
||||
<real>0.73423302173614502</real>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Green Component</key>
|
||||
<real>0.35916060209274292</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.0</real>
|
||||
</dict>
|
||||
<key>Load Shell Integration Automatically</key>
|
||||
<false/>
|
||||
<key>Mouse Reporting</key>
|
||||
<true/>
|
||||
<key>Name</key>
|
||||
<string>tmux</string>
|
||||
<key>Non Ascii Font</key>
|
||||
<string>Monaco 12</string>
|
||||
<key>Non-ASCII Anti Aliased</key>
|
||||
<true/>
|
||||
<key>Normal Font</key>
|
||||
<string>MesloLGS-NF-Regular 13</string>
|
||||
<key>Option Key Sends</key>
|
||||
<integer>0</integer>
|
||||
<key>Prompt Before Closing 2</key>
|
||||
<false/>
|
||||
<key>Right Option Key Sends</key>
|
||||
<integer>0</integer>
|
||||
<key>Rows</key>
|
||||
<integer>46</integer>
|
||||
<key>Screen</key>
|
||||
<integer>-1</integer>
|
||||
<key>Scrollback Lines</key>
|
||||
<integer>1000</integer>
|
||||
<key>Selected Text Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.89713811874389648</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.8579363226890564</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.84028750658035278</real>
|
||||
</dict>
|
||||
<key>Selection Color</key>
|
||||
<dict>
|
||||
<key>Blue Component</key>
|
||||
<real>0.12343787401914597</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.12343578040599823</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.1234394758939743</real>
|
||||
</dict>
|
||||
<key>Send Code When Idle</key>
|
||||
<false/>
|
||||
<key>Shortcut</key>
|
||||
<string></string>
|
||||
<key>Silence Bell</key>
|
||||
<true/>
|
||||
<key>Sync Title</key>
|
||||
<false/>
|
||||
<key>Tags</key>
|
||||
<array/>
|
||||
<key>Terminal Type</key>
|
||||
<string>xterm-256color</string>
|
||||
<key>Transparency</key>
|
||||
<real>0.0</real>
|
||||
<key>Unlimited Scrollback</key>
|
||||
<false/>
|
||||
<key>Use Bold Font</key>
|
||||
<true/>
|
||||
<key>Use Bright Bold</key>
|
||||
<true/>
|
||||
<key>Use Italic Font</key>
|
||||
<true/>
|
||||
<key>Use Non-ASCII Font</key>
|
||||
<false/>
|
||||
<key>Vertical Spacing</key>
|
||||
<real>1</real>
|
||||
<key>Visual Bell</key>
|
||||
<true/>
|
||||
<key>Window Type</key>
|
||||
<integer>0</integer>
|
||||
<key>Working Directory</key>
|
||||
<string>/Users/michael</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>OpenFileInNewWindows</key>
|
||||
<false/>
|
||||
<true/>
|
||||
<key>OpenTmuxWindowsIn</key>
|
||||
<integer>0</integer>
|
||||
<key>PMPrintingExpandedStateForPrint2</key>
|
||||
@@ -1241,7 +2037,7 @@ The script should do this: \(ai.prompt)</string>
|
||||
<key>Print In Black And White</key>
|
||||
<true/>
|
||||
<key>ShowFullScreenTabBar</key>
|
||||
<false/>
|
||||
<true/>
|
||||
<key>SmartPlacement</key>
|
||||
<true/>
|
||||
<key>SoundForEsc</key>
|
||||
@@ -1250,6 +2046,8 @@ The script should do this: \(ai.prompt)</string>
|
||||
<real>0.062694554004854366</real>
|
||||
<key>TabStyleWithAutomaticOption</key>
|
||||
<integer>6</integer>
|
||||
<key>TmuxPauseModeAgeLimit</key>
|
||||
<integer>120</integer>
|
||||
<key>VisualIndicatorForEsc</key>
|
||||
<false/>
|
||||
<key>findMode_iTerm</key>
|
||||
|
||||
@@ -37,7 +37,8 @@ vim.cmd('autocmd FileType markdown setlocal wrap')
|
||||
|
||||
-- NOTE: pcall prevents plugin system from shitting itself on first load
|
||||
if not pcall(function()
|
||||
c.colorscheme 'catppuccin'
|
||||
-- c.colorscheme 'catppuccin'
|
||||
c.colorscheme "vscode"
|
||||
end) then
|
||||
print("Failed to load colorscheme - probably has not been installed")
|
||||
end
|
||||
@@ -85,12 +86,12 @@ return require('packer').startup(function(use)
|
||||
-- Editor
|
||||
use {'neovim/nvim-lspconfig', config = function()
|
||||
local lspc = require('lspconfig')
|
||||
lspc['pyright'].setup{}
|
||||
lspc['tsserver'].setup{}
|
||||
lspc['clojure_lsp'].setup{}
|
||||
lspc['racket_langserver'].setup{}
|
||||
lspc['rust_analyzer'].setup{}
|
||||
lspc['gopls'].setup{}
|
||||
-- lspc['pyright'].setup{}
|
||||
-- lspc['tsserver'].setup{}
|
||||
-- lspc['clojure_lsp'].setup{}
|
||||
-- lspc['racket_langserver'].setup{}
|
||||
-- lspc['rust_analyzer'].setup{}
|
||||
-- lspc['gopls'].setup{}
|
||||
end}
|
||||
use 'hrsh7th/cmp-nvim-lsp'
|
||||
use {'hrsh7th/nvim-cmp', config = function()
|
||||
@@ -102,32 +103,31 @@ return require('packer').startup(function(use)
|
||||
}
|
||||
end}
|
||||
|
||||
-- use {'ms-jpq/chadtree', branch = 'chad'}
|
||||
use {"nvim-tree/nvim-tree.lua", config = function()
|
||||
require("nvim-tree").setup()
|
||||
end}
|
||||
use {"nvim-tree/nvim-tree.lua"}
|
||||
use {"nvim-tree/nvim-web-devicons"}
|
||||
require("nvim-tree").setup()
|
||||
|
||||
use 'nvim-lua/plenary.nvim'
|
||||
use 'nvim-telescope/telescope.nvim'
|
||||
use {"akinsho/toggleterm.nvim", tag = '*', config = function()
|
||||
require("toggleterm").setup()
|
||||
end}
|
||||
use {"akinsho/toggleterm.nvim", tag = '*'}
|
||||
require("toggleterm").setup()
|
||||
use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate', config = function()
|
||||
require'nvim-treesitter.configs'.setup{
|
||||
highlight = {enable = true}
|
||||
}
|
||||
end}
|
||||
|
||||
-- use 'martinsione/darkplus.nvim'
|
||||
-- vscode theme
|
||||
use 'Mofiqul/vscode.nvim'
|
||||
|
||||
-- NOTE: requires Node.js >= 17
|
||||
-- use {'github/copilot.vim', run = ':Copilot setup'}
|
||||
--
|
||||
|
||||
|
||||
-- Specify Filetype for .python Files
|
||||
vim.api.nvim_exec([[
|
||||
autocmd BufNewFile,BufRead *.sage set filetype=python
|
||||
]], false)
|
||||
-- vim.api.nvim_exec([[
|
||||
-- autocmd BufNewFile,BufRead *.sage set filetype=python
|
||||
-- ]], false)
|
||||
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user