From a71da3765629348b86766314e9188e928ada1476 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Mon, 12 Aug 2024 10:14:44 +0200 Subject: [PATCH] chore: remove Hammerspoon --- darwin/hammerspoon/caffeine.lua | 20 -- darwin/hammerspoon/functions.lua | 184 ------------------ darwin/hammerspoon/icons/cup-off.pdf | Bin 2019 -> 0 bytes darwin/hammerspoon/icons/cup-on.pdf | Bin 2735 -> 0 bytes darwin/hammerspoon/icons/moon.pdf | Bin 1765 -> 0 bytes darwin/hammerspoon/icons/sun.pdf | Bin 2143 -> 0 bytes darwin/hammerspoon/init.lua | 275 --------------------------- homebrew/mac-mini | 2 - install.conf.yaml | 7 +- 9 files changed, 1 insertion(+), 487 deletions(-) delete mode 100644 darwin/hammerspoon/caffeine.lua delete mode 100644 darwin/hammerspoon/functions.lua delete mode 100644 darwin/hammerspoon/icons/cup-off.pdf delete mode 100644 darwin/hammerspoon/icons/cup-on.pdf delete mode 100644 darwin/hammerspoon/icons/moon.pdf delete mode 100644 darwin/hammerspoon/icons/sun.pdf delete mode 100644 darwin/hammerspoon/init.lua diff --git a/darwin/hammerspoon/caffeine.lua b/darwin/hammerspoon/caffeine.lua deleted file mode 100644 index dfdc231..0000000 --- a/darwin/hammerspoon/caffeine.lua +++ /dev/null @@ -1,20 +0,0 @@ --- Replace Caffeine.app with 18 lines of Lua :D -local caffeine = hs.menubar.new() - -function SetCaffeineDisplay(state) - local result - if state then - result = caffeine:setIcon("~/.hammerspoon/icons/sun.pdf") - else - result = caffeine:setIcon("~/.hammerspoon/icons/moon.pdf") - end -end - -function CaffeineClicked() - SetCaffeineDisplay(hs.caffeinate.toggle("displayIdle")) -end - -if caffeine then - caffeine:setClickCallback(CaffeineClicked) - SetCaffeineDisplay(hs.caffeinate.get("displayIdle")) -end diff --git a/darwin/hammerspoon/functions.lua b/darwin/hammerspoon/functions.lua deleted file mode 100644 index 4ad9445..0000000 --- a/darwin/hammerspoon/functions.lua +++ /dev/null @@ -1,184 +0,0 @@ ----------------------- --- Helper Functions -- ----------------------- - --- Get list of screens and refresh that list whenever screens are plugged or unplugged: -local screens = hs.screen.allScreens() -local screenwatcher = hs.screen.watcher.new(function() - screens = hs.screen.allScreens() -end) -screenwatcher:start() - --- Move a window a number of pixels in x and y -function Nudge(xpos, ypos) - local win = hs.window.focusedWindow() - local f = win:frame() - f.x = f.x + xpos - f.y = f.y + ypos - win:setFrame(f) -end - --- Resize a window by moving the bottom -function Yank(xpixels, ypixels) - local win = hs.window.focusedWindow() - local f = win:frame() - - f.w = f.w + xpixels - f.h = f.h + ypixels - win:setFrame(f) -end - --- Resize window for chunk of screen. --- For x and y: use 0 to expand fully in that dimension, 0.5 to expand halfway --- For w and h: use 1 for full, 0.5 for half -function Push(x, y, w, h) - local win = hs.window.focusedWindow() - local f = win:frame() - local screen = win:screen() - local max = screen:frame() - - f.x = max.x + (max.w * x) - f.y = max.y + (max.h * y) - f.w = max.w * w - f.h = max.h * h - win:setFrame(f) -end - --- Move to monitor x. Checks to make sure monitor exists, if not moves to last monitor that exists -function MoveToMonitor(x) - local win = hs.window.focusedWindow() - local newScreen = nil - while not newScreen do - newScreen = screens[x] - x = x - 1 - end - - win:moveToScreen(newScreen) -end - --- Move to next screen -local function moveToNextScreen(win) - win = win or window.focusedWindow() - win:moveToScreen(win:screen():next()) -end - --- Move to previous screen -local function moveToPreviousScreen(win) - win = win or window.focusedWindow() - win:moveToScreen(win:screen():previous()) -end - --- This places a red circle around the mouse pointer -local mouseCircle = nil -local mouseCircleTimer = nil - -function MouseHighlight() - -- Delete an existing highlight if it exists - if mouseCircle then - mouseCircle:delete() - if mouseCircleTimer then - mouseCircleTimer:stop() - end - end - -- Get the current co-ordinates of the mouse pointer - Mousepoint = hs.mouse.get() - -- Prepare a big red circle around the mouse pointer - mouseCircle = hs.drawing.circle(hs.geometry.rect(Mousepoint.x - 40, Mousepoint.y - 40, 80, 80)) - mouseCircle:setStrokeColor({ ["red"] = 1, ["blue"] = 0, ["green"] = 0, ["alpha"] = 1 }) - mouseCircle:setFill(false) - mouseCircle:setStrokeWidth(5) - mouseCircle:show() - - -- Set a timer to delete the circle after 3 seconds - mouseCircleTimer = hs.timer.doAfter(2, function() - mouseCircle:delete() - end) -end - --- Get all valid windows -function GetAllValidWindows() - local allWindows = hs.window.allWindows() - local windows = {} - local index = 1 - for i = 1, #allWindows do - local w = allWindows[i] - if w:screen() then - windows[index] = w - index = index + 1 - end - end - return windows -end - --- Launch application or toggle it -function launchToggleApplication(applicationName) - local app = hs.application.find(applicationName) - - if app then - local appWindows = app:visibleWindows() - - if #appWindows > 0 then - local focusedWindow = app:focusedWindow() - - if focusedWindow then - if app:isHidden() then - app:unhide() - else - HideApplicationWithAppleScript(app) - end - else - ShowApplicationWithAppleScript(app) - end - else - app:activate() - end - else - hs.application.launchOrFocus(applicationName) - end -end - --- Hide application with AppleScript -function HideApplicationWithAppleScript(app) - local appName = app:name() - local hideScript = [[ - tell application "Finder" - set visible of process "%s" to false - end tell - ]] - local formattedScript = string.format(hideScript, appName) - hs.osascript.applescript(formattedScript) -end - --- Show application with AppleScript -function ShowApplicationWithAppleScript(app) - local appName = app:name() - local showScript = [[ - tell application "Finder" - set visible of process "%s" to true - end tell - ]] - local formattedScript = string.format(showScript, appName) - hs.osascript.applescript(formattedScript) -end - -function Yabai(commands) - for _, cmd in ipairs(commands) do - os.execute("/opt/homebrew/bin/yabai -m " .. cmd) - end -end - --- Auto Reload Config -function ReloadConfig(files) - DoReload = false - for _, file in pairs(files) do - if file:sub(-4) == ".lua" then - DoReload = true - end - end - if DoReload then - hs.reload() - end -end - -hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", ReloadConfig):start() -hs.alert.show("Hammerspoon") diff --git a/darwin/hammerspoon/icons/cup-off.pdf b/darwin/hammerspoon/icons/cup-off.pdf deleted file mode 100644 index 265bb1b5dff5c2df0e9aaa6c264bc39695a7db0d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2019 zcm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gsn zGA#sJJcti&=JuZMPFlR`#a)2mMGf4!zGB2f>~lP51_~t6rF;C*?NM~ z#REvWv0V(hNduX~jQYa32&Q5P%0e*&Ls=LX^eT2 zYT8 z)lq~pnxu?xPO&l`o*x_{!5R(ZgJu98q@P-@fw1(g1rQf6t|v*zKjQ;>-o!o!` diff --git a/darwin/hammerspoon/icons/cup-on.pdf b/darwin/hammerspoon/icons/cup-on.pdf deleted file mode 100644 index fdf48febe4a965f9c6eb684bece9ca22f1ea6127..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2735 zcmai$dpuO@8pk(wv8URii(9mmYiMT8m@!lK3^UV2yP~0xOU-4CFlICt3DHp_a&U63 zw%k*4sT83oj6*Kj$}JAgwu>?<*`ZXNHR5#pW3SJAX1()U&-=X3yzlq0a#d~14x<=R|E;*JC`AXs1S?K zh5#ZFAruK9hCd=m!9T^ec%9X9>a_4Q@gHP*u1S$lG2;&;j#LbLu!eYH+K2H znSIFhB_^^8?4wi@yk(VL$a~LDlyqN5oRhYA`b!1ZQ|aCGE9*)*_nK(gE5#}&l1J7R zm8-a9nqsWB(%gxsY>(L#+{c$xOzv=N(TDnrwQ;enN%6I`-$r*f$C0m)$<7h!_*-X? zsGPL4O`gesEc^Gv`y=VH!bW@uJ*hkA#$(62 zkA8IJBa-%HPDpKt3+I*W;+S0^8*)$aQ~hva@A*v|WyZgy*1zh0AAi|CRXYIRUbA{7 z!#Q|O)cJ=i2nrB4KP=`2(RKDh&v2&XuS>E1I*Rrz^VU$t&Q0mT;~Oa@Z?`Hxv-K^C zh#n!mG8rqb+b3}6ojswoCxZENl)W^96S}uKi7`W1t`ZI0{7l`Aue0aK zdb6aqDlPlBs$R{fa308`apisWq!r_IX1<2voNJav!I_|J^uwn6n-$7;pkn&`2A=ws z2I*Tl$1iiRmiAU#IA_kBOuRn2F+x?zWqGoHLY`d-_#oq@B(^i>0EH+s%=Xn6_xUMo zE>s`G=8q*dOtX@CM=Dbb%Eo(JH4K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_tqo}m2Dy4)!`eT747!KS8l1)(X9 zMq@tAY<*=JTg~0Lk^KV~IaHBhsm!|XpIVc6Isf>p&T;K-hn9BKxaib6+;T$cVeb_5 zl;6>eZwsZ*t&$B8V7i;e8T7c%6a#SDdjM44&^wTYZ#Oa%EO+OHKq#@4z!u}Q3 zO|EfiO<2YXXlOxtf%FlMd`D9vhaZGmYVHsLu(i@=1BqvezrZnC`!- zetn(ptYC6SG-+IsY$DNn(~XK2hJCfBEPC9bn1If^ow(($u8P}P=_@BL9&M9T82HgA zbzYLk<`c_Y-Hw$!-XAK-Z#P;0+jz3qWnc7GrH_So(6&CZV!TQ@njc~^zHzD`#^KWW zO!ML;$+w>$2|Cez&@nZytAn%8x}(>%F^-Tl>g9G5y`!d{xmv#2JY!eVadg4M#)DAu zmYiLEb+o9Qn&Dw@5-nM0-_6XiQ%aveNFB_e0j@^5#nKdE%#rxl~&^ay>Q zS*;PNW8K#aTja9TWr*{psk0Lq*S^XQivN0ImWMvy>&Jqd)xK$d0mrY*o@_hGrmeyD z*&igUs$&uB;au0Pc52hBJat)Qtnf`*c8nzJX|tLeli6z)8@c*zUzK{Jd!?nS{LZnz zin}Un&OSN&v%O}lKK#s|MWN;BnY-E|2^vP&etebC+#U6f9p5vSY;o>vYrSuk+jh{& zCG?x1(-9G7Gq1e0|Ht^rZHfIzFsX&4_&{0M;Br$0P!hnzmB(|zRfHI#5b%To216(~ z2dVnRuIh6dnFs@7aTo^B)PQLOqA!(-RRBN=evoenWC(@t@SHrH#AOOezcEw;j`)Nn zf(*2yQ5yXJ z1u-!U#h_qlKtq@q_#f(ml2X08FH- zJXir>>96wvE{-@V3JxY5U@^=VvvHh_V=NAgBMz7dW}_?->O}i;NIz~W5};vN5QN2G M(yXl)c?f9#0jm5UoB#j- diff --git a/darwin/hammerspoon/init.lua b/darwin/hammerspoon/init.lua deleted file mode 100644 index db82ef7..0000000 --- a/darwin/hammerspoon/init.lua +++ /dev/null @@ -1,275 +0,0 @@ -require("functions") -require("caffeine") - -rawset(_G, "hs", hs or {}) - -local application = hs.application -local window = hs.window -local layout = hs.layout -local screen = hs.screen -local hotkey = hs.hotkey -local hints = hs.hints - -------------------- --- Configuration -- -------------------- - --- Animation -window.animationDuration = 0 - --- Hints -hints.fontName = "Helvetica-Bold" -hints.fontSize = 18 -hints.showTitleThresh = 0 -hints.style = "vimperator" - --- Allow searching for alternate names -application.enableSpotlightForNameSearches(true) - ------------- --- Aliases -- ------------- - --- Keys -local KEY_HYPER = { "⇧", "⌃", "⌥", "⌘" } -local KEY_A = { "⌥" } -local KEY_AM = { "⌥", "⌘" } -local KEY_CA = { "⌃", "⌥" } -local KEY_CAM = { "⌃", "⌥", "⌘" } -local KEY_CM = { "⌃", "⌘" } -local KEY_SA = { "⇧", "⌥" } -local KEY_SAM = { "⇧", "⌥", "⌘" } -local KEY_SC = { "⇧", "⌘" } -local KEY_SCA = { "⇧", "⌃", "⌥" } -local KEY_SCM = { "⇧", "⌃", "⌘" } - --- Displays -local DISPLAY_PRIMARY = screen.primaryScreen() -local DISPLAY_NOTEBOOK = "Color LCD" - --- Sizes -local LEFT_MOST = hs.geometry.unitrect(0, 0, 0.6, 1) -local LEFT_LESS = hs.geometry.unitrect(0, 0, 0.4, 1) -local RIGHT_MOST = hs.geometry.unitrect(0.4, 0, 0.6, 1) -local RIGHT_LESS = hs.geometry.unitrect(0.6, 0, 0.4, 1) -local FULLSCREEN = hs.geometry.unitrect(0, 0, 1, 1) -local RIGHT_HALF = hs.geometry.unitrect(0.5, 0, 0.5, 1) -local LEFT_HALF = hs.geometry.unitrect(0, 0, 0.5, 1) - -------------- --- Layouts -- -------------- - --- Format reminder: --- {"App name", "Window name", "Display Name", "unitrect", "framerect", "fullframerect"}, - --- One Monitor and Notebook -local LAYOUT_DUAL = { - { "Brave Browser", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Calendar", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Code", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "DEVONthink 3", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Element", nil, DISPLAY_NOTEBOOK, RIGHT_HALF, nil, nil }, - { "Firefox Developer Edition", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Mail", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Messages", nil, DISPLAY_PRIMARY, RIGHT_HALF, nil, nil }, - { "Microsoft Outlook", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Music", nil, DISPLAY_NOTEBOOK, FULLSCREEN, nil, nil }, - { "Obsidian", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Slack", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Sonos", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Telegram", nil, DISPLAY_PRIMARY, LEFT_HALF, nil, nil }, - { "Things", nil, DISPLAY_NOTEBOOK, FULLSCREEN, nil, nil }, - { "iA Writer", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "kitty", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, -} - --- One Monitor -local LAYOUT_SINGLE = { - { "Brave Browser", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Calendar", nil, DISPLAY_PRIMARY, LEFT_MOST, nil, nil }, - { "Code", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "DEVONthink 3", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Element", nil, DISPLAY_PRIMARY, RIGHT_HALF, nil, nil }, - { "Firefox Developer Edition", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Mail", nil, DISPLAY_PRIMARY, RIGHT_MOST, nil, nil }, - { "Messages", nil, DISPLAY_PRIMARY, RIGHT_LESS, nil, nil }, - { "Microsoft Outlook", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Music", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Obsidian", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Slack", nil, DISPLAY_PRIMARY, LEFT_MOST, nil, nil }, - { "Sonos", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "Telegram", nil, DISPLAY_PRIMARY, LEFT_MOST, nil, nil }, - { "Things", nil, DISPLAY_PRIMARY, RIGHT_LESS, nil, nil }, - { "iA Writer", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, - { "kitty", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil }, -} - ------------------- --- Key Bindings -- ------------------- - --- stylua: ignore start - --- Movement hotkeys --- hotkey.bind(KEY_AM, "down", function() Nudge(0, 100) end) --- hotkey.bind(KEY_AM, "up", function() Nudge(0, -100) end) --- hotkey.bind(KEY_AM, "right", function() Nudge(100, 0) end) --- hotkey.bind(KEY_AM, "left", function() Nudge(-100, 0) end) - --- Resize hotkeys --- hotkey.bind(KEY_SAM, "up", function() Yank(0, -100) end) --- hotkey.bind(KEY_SAM, "down", function() Yank(0, 100) end) --- hotkey.bind(KEY_SAM, "right", function() Yank(100, 0) end) --- hotkey.bind(KEY_SAM, "left", function() Yank(-100, 0) end) - --- Push to screen edge --- hotkey.bind(KEY_CAM, "left", function() Push(0, 0, 0.5, 1) end) --- hotkey.bind(KEY_CAM, "right", function() Push(0.5, 0, 0.5, 1) end) --- hotkey.bind(KEY_CAM, "up", function() Push(0, 0, 1, 0.5) end) --- hotkey.bind(KEY_CAM, "down", function() Push(0, 0.5, 1, 0.5) end) - --- Focus -hotkey.bind(KEY_AM, 'k', function() window.focusedWindow():focusWindowNorth() end) -hotkey.bind(KEY_AM, 'j', function() window.focusedWindow():focusWindowSouth() end) -hotkey.bind(KEY_AM, 'l', function() window.focusedWindow():focusWindowEast() end) -hotkey.bind(KEY_AM, 'h', function() window.focusedWindow():focusWindowWest() end) - - --- Centered window with some room to see the desktop --- hotkey.bind(KEY_SCM, "l", function() Push(0.05, 0.05, 0.9, 0.9) end) --- hotkey.bind(KEY_SCM, "m", function() Push(0.1, 0.1, 0.8, 0.8) end) --- hotkey.bind(KEY_SCM, "s", function() Push(0.15, 0.15, 0.7, 0.7) end) - --- Fullscreen --- hotkey.bind(KEY_CAM, "0", function() Push(0, 0, 1, 1) end) - --- Quarter Screens --- hotkey.bind(KEY_CAM, "q", function() Push(0, 0, 0.5, 0.5) end) --- hotkey.bind(KEY_CAM, "w", function() Push(0.5, 0, 0.5, 0.5) end) --- hotkey.bind(KEY_CAM, "a", function() Push(0, 0.5, 0.5, 0.5) end) --- hotkey.bind(KEY_CAM, "s", function() Push(0.5, 0.5, 0.5, 0.5) end) - --- Part Screens --- hotkey.bind(KEY_CAM, "4", function() Push(0, 0, 0.6, 1) end) --- hotkey.bind(KEY_CAM, "5", function() Push(0, 0, 0.4, 1) end) --- hotkey.bind(KEY_CAM, "6", function() Push(0.4, 0, 0.6, 1) end) --- hotkey.bind(KEY_CAM, "7", function() Push(0.6, 0, 0.4, 1) end) - --- Move a window between monitors (preserve size) --- hotkey.bind(KEY_CM, "1", function() window.focusedWindow():moveOneScreenNorth() end) --- hotkey.bind(KEY_CM, "2", function() window.focusedWindow():moveOneScreenSouth() end) --- hotkey.bind(KEY_CM, "3", function() window.focusedWindow():moveOneScreenWest() end) --- hotkey.bind(KEY_CM, "down", function() window.focusedWindow():moveOneScreenSouth() end) --- hotkey.bind(KEY_CM, "h", function() window.focusedWindow():moveOneScreenWest() end) --- hotkey.bind(KEY_CM, "j", function() window.focusedWindow():moveOneScreenSouth() end) --- hotkey.bind(KEY_CM, "k", function() window.focusedWindow():moveOneScreenNorth() end) --- hotkey.bind(KEY_CM, "l", function() window.focusedWindow():moveOneScreenEast() end) --- hotkey.bind(KEY_CM, "left", function() window.focusedWindow():moveOneScreenWest() end) --- hotkey.bind(KEY_CM, "right", function() window.focusedWindow():moveOneScreenEast() end) --- hotkey.bind(KEY_CM, "up", function() window.focusedWindow():moveOneScreenNorth() end) - --- Move a window between monitors (change to fullscreen) --- hotkey.bind(KEY_SCM, "1", function() window.focusedWindow():moveOneScreenNorth(); push(0, 0, 1, 1) end) --- hotkey.bind(KEY_SCM, "2", function() window.focusedWindow():moveOneScreenSouth(); push(0, 0, 1, 1) end) --- hotkey.bind(KEY_SCM, "3", function() window.focusedWindow():moveOneScreenWest(); window.focusedWindow():moveOneScreenWest(); push(0, 0, 1, 1) end) --- hotkey.bind(KEY_SCM, "up", function() window.focusedWindow():moveOneScreenNorth(); push(0, 0, 1, 1) end) --- hotkey.bind(KEY_SCM, "down", function() window.focusedWindow():moveOneScreenSouth(); push(0, 0, 1, 1) end) --- hotkey.bind(KEY_SCM, "right", function() window.focusedWindow():moveOneScreenEast(); push(0, 0, 1, 1) end) --- hotkey.bind(KEY_SCM, "left", function() window.focusedWindow():moveOneScreenWest(); window.focusedWindow():moveOneScreenWest(); push(0, 0, 1, 1) end) --- hotkey.bind(KEY_SCM, "k", function() window.focusedWindow():moveOneScreenNorth(); push(0, 0, 1, 1) end) --- hotkey.bind(KEY_SCM, "j", function() window.focusedWindow():moveOneScreenSouth(); push(0, 0, 1, 1) end) --- hotkey.bind(KEY_SCM, "l", function() window.focusedWindow():moveOneScreenEast(); push(0, 0, 1, 1) end) --- hotkey.bind(KEY_SCM, "h", function() window.focusedWindow():moveOneScreenWest(); window.focusedWindow():moveOneScreenWest(); push(0, 0, 1, 1) end) - --- Yabai --- Focus Window -hotkey.bind(KEY_A, "h", function() Yabai({"window --focus west"}) end) -hotkey.bind(KEY_A, "j", function() Yabai({"window --focus south"}) end) -hotkey.bind(KEY_A, "k", function() Yabai({"window --focus north"}) end) -hotkey.bind(KEY_A, "l", function() Yabai({"window --focus east"}) end) - --- Swap Managed Windows -hotkey.bind(KEY_SA, "h", function() Yabai({"window --swap west"}) end) -hotkey.bind(KEY_SA, "j", function() Yabai({"window --swap south"}) end) -hotkey.bind(KEY_SA, "k", function() Yabai({"window --swap north"}) end) -hotkey.bind(KEY_SA, "l", function() Yabai({"window --swap east"}) end) - --- Move Managed Windows -hotkey.bind(KEY_SCA, "h", function() Yabai({"window --warp west"}) end) -hotkey.bind(KEY_SCA, "j", function() Yabai({"window --warp south"}) end) -hotkey.bind(KEY_SCA, "k", function() Yabai({"window --warp north"}) end) -hotkey.bind(KEY_SCA, "l", function() Yabai({"window --warp east"}) end) - --- Rotate Windows -hotkey.bind(KEY_A, "r", function() Yabai({"space --rotate 90"}) end) - --- Toggle Window Fullscreen Zoom -hotkey.bind(KEY_A, "f", function() Yabai({"window --toggle zoom-fullscreen"}) end) - --- Toggle Padding and Gap -hotkey.bind(KEY_A, "g", function() Yabai({"space --toggle padding", "space --toggle gap"}) end) - --- Float/Unfloat Window -hotkey.bind(KEY_A, "t", function() Yabai({"window --toggle float", "window --grid 7:7:1:1:5:5"}) end) - --- Toggle Window Split Type -hotkey.bind(KEY_A, "e", function() Yabai({"window --toggle split"}) end) - --- Balance Size of Windows -hotkey.bind(KEY_SA, "0", function() Yabai({"space --balance"}) end) - --- Move Window to space -hotkey.bind(KEY_SCA, "1", function() Yabai({"window --space 1"}) end) -hotkey.bind(KEY_SCA, "2", function() Yabai({"window --space 2"}) end) -hotkey.bind(KEY_SCA, "3", function() Yabai({"window --space 3"}) end) -hotkey.bind(KEY_SCA, "4", function() Yabai({"window --space 4"}) end) -hotkey.bind(KEY_SCA, "5", function() Yabai({"window --space 5"}) end) -hotkey.bind(KEY_SCA, "6", function() Yabai({"window --space 6"}) end) -hotkey.bind(KEY_SCA, "7", function() Yabai({"window --space 7"}) end) -hotkey.bind(KEY_SCA, "8", function() Yabai({"window --space 8"}) end) -hotkey.bind(KEY_SCA, "9", function() Yabai({"window --space 9"}) end) - --- Send Window to Monitor -hotkey.bind(KEY_SA, "n", function() Yabai({"window --display next"}) end) -hotkey.bind(KEY_SA, "p", function() Yabai({"window --display prev"}) end) - --- Move Focus to Monitor -hotkey.bind(KEY_SAM, "h", function() Yabai({"display --focus next"}) end) -hotkey.bind(KEY_SAM, "l", function() Yabai({"display --focus prev"}) end) - --- Application shortcuts --- hotkey.bind(KEY_SC, "r", function() launchToggleApplication("Wezterm") end) --- hotkey.bind(KEY_SC, "w", function() launchToggleApplication("kitty") end) --- hotkey.bind(KEY_HYPER, "a", function() launchToggleApplication("Arc") end) --- hotkey.bind(KEY_HYPER, "b", function() launchToggleApplication("Brave Browser") end) --- hotkey.bind(KEY_HYPER, "c", function() launchToggleApplication("Visual Studio Code") end) --- hotkey.bind(KEY_HYPER, "d", function() launchToggleApplication("DEVONthink 3") end) --- hotkey.bind(KEY_HYPER, "e", function() launchToggleApplication("Eagle") end) --- hotkey.bind(KEY_HYPER, "f", function() launchToggleApplication("Reeder") end) --- hotkey.bind(KEY_HYPER, "g", function() launchToggleApplication("Signal") end) --- hotkey.bind(KEY_HYPER, "i", function() launchToggleApplication("Messages") end) --- hotkey.bind(KEY_HYPER, "m", function() launchToggleApplication("Mail") end) --- hotkey.bind(KEY_HYPER, "n", function() launchToggleApplication("MindNode") end) --- hotkey.bind(KEY_HYPER, "o", function() launchToggleApplication("Obsidian") end) --- hotkey.bind(KEY_HYPER, "r", function() launchToggleApplication("Raindrop.io") end) --- hotkey.bind(KEY_HYPER, "s", function() launchToggleApplication("Spotify") end) --- hotkey.bind(KEY_HYPER, "t", function() launchToggleApplication("Things") end) --- hotkey.bind(KEY_HYPER, "u", function() launchToggleApplication("Kalender") end) --- hotkey.bind(KEY_HYPER, "w", function() launchToggleApplication("iA Writer") end) --- hotkey.bind(KEY_HYPER, "x", function() launchToggleApplication("Microsoft Teams") end) - --- Place red circle around mouse -hotkey.bind(KEY_CAM, "space", MouseHighlight) - --- Hints -hotkey.bind(KEY_HYPER, "space", function() hints.windowHints(GetAllValidWindows()) end) - --- Manual config reloading (from getting started guide): -hotkey.bind(KEY_HYPER, "delete", function() hs.reload() end) - --- Layouts -hotkey.bind(KEY_HYPER, "1", function() layout.apply(LAYOUT_SINGLE) end) -hotkey.bind(KEY_HYPER, "2", function() layout.apply(LAYOUT_DUAL) end) - --- stylua: ignore end diff --git a/homebrew/mac-mini b/homebrew/mac-mini index 086166f..8dc55ba 100644 --- a/homebrew/mac-mini +++ b/homebrew/mac-mini @@ -366,8 +366,6 @@ cask "gemini" cask "google-japanese-ime" # Tools to protect your files cask "gpg-suite-no-mail" -# Desktop automation application -cask "hammerspoon" # Open-source video transcoder cask "handbrake" # Create presentation slides from a Markdown document diff --git a/install.conf.yaml b/install.conf.yaml index 3abe0f9..e87d519 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -20,9 +20,7 @@ path: config/* relink: true exclude: [config/karabiner, config/hammerspoon] - ~/.config/karabiner: - if: "[ `uname` = Darwin ]" - link: darwin/karabiner + ~/.config/karabiner: darwin/karabiner ~/.ctags: ctags ~/.curlrc: curlrc ~/.default-gems: default-gems @@ -35,9 +33,6 @@ ~/.gnupg/dirmngr.conf: gnupg/dirmngr.conf ~/.gnupg/gpg-agent.conf: gnupg/gpg-agent.conf ~/.gnupg/gpg.conf: gnupg/gpg.conf - ~/.hammerspoon: - if: "[ `uname` = Darwin ]" - path: darwin/hammerspoon ~/.profile: profile ~/.session-variables.sh: session-variables.sh ~/.tool-versions: tool-versions