New "maximized" window function to Hammerspoon
This commit is contained in:
parent
94f14495d1
commit
88179b0fdb
2 changed files with 20 additions and 2 deletions
|
|
@ -47,7 +47,7 @@ This also starts another break timer, that calls
|
||||||
`ha-focus-break-over' when finished."
|
`ha-focus-break-over' when finished."
|
||||||
(interactive)
|
(interactive)
|
||||||
(run-with-idle-timer 30 nil 'ha-focus-capture)
|
(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)
|
(ha-focus-countdown-timer 5 'ha-focus-break-over)
|
||||||
(message "🍅 Time to take a break."))
|
(message "🍅 Time to take a break."))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#+author: Howard X. Abrams
|
#+author: Howard X. Abrams
|
||||||
#+date: 2025-11-24
|
#+date: 2025-11-24
|
||||||
#+filetags: emacs hamacs
|
#+filetags: emacs hamacs
|
||||||
#+lastmod: [2026-08-10 Mon]
|
#+lastmod: [2026-08-12 Wed]
|
||||||
|
|
||||||
A literate programming file for configuring Hammerspoon.
|
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 don’t care
|
||||||
hs.hotkey.bind({"cmd", "alt", "ctrl", "shift"}, "Y", centerWindow)
|
hs.hotkey.bind({"cmd", "alt", "ctrl", "shift"}, "Y", centerWindow)
|
||||||
#+END_SRC
|
#+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
|
* Auto Reload Configuration
|
||||||
Whenever my configuration file is altered (or with a ~Meh-R~ key), I reload the configuration:
|
Whenever my configuration file is altered (or with a ~Meh-R~ key), I reload the configuration:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue