New "maximized" window function to Hammerspoon

This commit is contained in:
Howard Abrams 2026-08-12 08:28:40 -07:00
parent 94f14495d1
commit 88179b0fdb
2 changed files with 20 additions and 2 deletions

View file

@ -47,7 +47,7 @@ This also starts another break timer, that calls
`ha-focus-break-over' when finished."
(interactive)
(run-with-idle-timer 30 nil 'ha-focus-capture)
(ha-focus--command "tell application \"VLC\" to pause")
(ha-focus--command "tell application \"VLC\" to stop")
(ha-focus-countdown-timer 5 'ha-focus-break-over)
(message "🍅 Time to take a break."))

View file

@ -2,7 +2,7 @@
#+author: Howard X. Abrams
#+date: 2025-11-24
#+filetags: emacs hamacs
#+lastmod: [2026-08-10 Mon]
#+lastmod: [2026-08-12 Wed]
A literate programming file for configuring Hammerspoon.
@ -304,6 +304,24 @@ My company gave me a nice monitor … maybe a little too nice, as I dont care
hs.hotkey.bind({"cmd", "alt", "ctrl", "shift"}, "Y", centerWindow)
#+END_SRC
Similarly, I sometimes want a window as large as possible, but flushed to the edges of the monitor (a maximized frame, not macOS' native /full screen/):
#+BEGIN_SRC lua
----------------------------------------------------------------------
-- Making a window as large as possible on its current monitor:
function fullWindow()
local win = hs.window.focusedWindow()
if not win then return end -- Safety check in case no window is focused
local screen = win:screen()
win:setFrame(screen:frame())
hs.alert.show("Full Window")
end
hs.hotkey.bind({"cmd", "alt", "ctrl", "shift"}, "U", fullWindow)
#+END_SRC
* Auto Reload Configuration
Whenever my configuration file is altered (or with a ~Meh-R~ key), I reload the configuration: