Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 0 additions & 104 deletions hammerspoon/.hammerspoon/CLAUDE.md

This file was deleted.

15 changes: 10 additions & 5 deletions hammerspoon/.hammerspoon/Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
.DEFAULT_GOAL := test
.PHONY: test format native preview-glass

NATIVE_BINARY := native/.build/glass-toast
NATIVE_BINARIES := native/.build/glass-toast native/.build/native-chooser

native: $(NATIVE_BINARY)
native: $(NATIVE_BINARIES)

$(NATIVE_BINARY): native/GlassToast.swift
native/.build/glass-toast: native/GlassToast.swift
native/.build/native-chooser: native/NativeChooser.swift

$(NATIVE_BINARIES): native/GlassBackground.swift
mkdir -p native/.build
xcrun swiftc -O -target "$$(uname -m)-apple-macosx13.0" -framework AppKit $< -o $@.tmp
xcrun swiftc -O -target "$$(uname -m)-apple-macosx13.0" -framework AppKit $^ -o $@.tmp
mv -f $@.tmp $@

# Visual preview only; does not change caffeine state.
preview-glass: native
$(NATIVE_BINARY) enabled "Caffeine Enabled" 4
native/.build/glass-toast enabled "Caffeine Enabled" 4

test:
hs -c "dofile(hs.configdir .. '/tests/test_chooser.lua').run()"
hs -c "dofile(hs.configdir .. '/tests/test_launcher.lua').run()"
hs -c "dofile(hs.configdir .. '/tests/test_glass_toast.lua').run()"
hs -c "dofile(hs.configdir .. '/tests/test_basic_alerts.lua').run()"
hs -c "dofile(hs.configdir .. '/tests/test_stacking.lua').run()"
Expand Down
9 changes: 9 additions & 0 deletions hammerspoon/.hammerspoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ wm.config.layouts = {

wm:init()

-- Preserve window-state persistence while closing the native chooser on reload.
local save_window_state = hs.shutdownCallback
hs.shutdownCallback = function()
require("modules.chooser").shutdown()
if save_window_state then
save_window_state()
end
end

hs.hotkey.bind({ "cmd", "shift" }, "b", function()
local applescript_toggle_menubar = [[
tell application "System Events"
Expand Down
Loading
Loading