Skip to content

Commit 13432ac

Browse files
🤖 automatedchrisgrieser
authored andcommitted
Home (hammerspoon/)
1 parent 6b31523 commit 13432ac

4 files changed

Lines changed: 9 additions & 29 deletions

File tree

hammerspoon/appearance/dark-mode.lua

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ function M.autoSetBrightness()
2727

2828
print(("💡 ambient: %.1f -> setting brightness to %s"):format(ambient, target))
2929
local iMacDisplay = require("win-management.window-utils").iMacDisplay
30-
iMacDisplay:setBrightness(target)
30+
if iMacDisplay then iMacDisplay:setBrightness(target) end
3131
end
3232

3333
-- INFO done manually to include app-specific toggling for:
3434
-- * System
3535
-- * Sketchybar
36-
-- * PDF appearance
3736
-- * Hammerspoon Console
3837
---@param toMode "dark"|"light"
3938
function M.setDarkMode(toMode)
@@ -46,12 +45,6 @@ function M.setDarkMode(toMode)
4645
-- delay so sketchybar picks up on system mode change
4746
u.defer(2, function() hs.execute(u.exportPath .. "sketchybar --reload") end)
4847

49-
-- PDF background
50-
if u.appRunning("PDF Expert") then
51-
local pdfBg = toMode == "light" and "Day" or "Night"
52-
u.app("PDF Expert"):selectMenuItem { "View", "Theme", pdfBg }
53-
end
54-
5548
-- hammerspoon itself
5649
require("appearance.console").setConsoleColors(toMode)
5750
require("appearance.hole-cover").update()

hammerspoon/apps/app-specific-behavior.lua

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,9 @@ local wu = require("win-management.window-utils")
66
local aw = hs.application.watcher
77
local wf = hs.window.filter
88

9-
---VIDEO CALLS------------------------------------------------------------------
10-
-- remove leftover tabs
11-
M.wf_zoom = wf.new({ "zoom.us", "Webex" }):subscribe(wf.windowCreated, function(_newWin)
12-
u.defer(4, function()
13-
u.closeBrowserTabsWith("zoom.us")
14-
u.closeBrowserTabsWith("webex.com")
15-
end)
9+
---ZOOM------------------------------------------------------------------
10+
M.wf_zoom = wf.new("zoom.us"):subscribe(wf.windowCreated, function(_newWin)
11+
u.defer(4, function() u.closeBrowserTabsWith("zoom.us") end)
1612
end)
1713

1814
---FINDER-----------------------------------------------------------------------
@@ -37,13 +33,6 @@ M.aw_pdfreaders = aw.new(function(appName, event, app)
3733
elseif event == aw.launched and appName == "Preview" then
3834
local isPdf = app:mainWindow():title():find("%.pdf")
3935
if isPdf then app:selectMenuItem { "View", "Thumbnails" } end
40-
elseif event == aw.launched and appName == "PDF Expert" then
41-
app:selectMenuItem { "View", "Theme", u.isDarkMode() and "Night" or "Day" }
42-
app:selectMenuItem { "Annotate", "Highlight" }
43-
44-
local shellCmd =
45-
'rm -rf "$HOME/Library/Mobile Documents/3L68KQB4HG~com~readdle~CommonDocuments/Documents/"'
46-
hs.execute(shellCmd)
4736
end
4837
end):start()
4938

hammerspoon/meta/utils.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ M.exportPath = "export PATH=/usr/local/lib:/usr/local/bin:/opt/homebrew/bin/:$PA
1111

1212
M.videoAndAudioApps = {
1313
"zoom.us",
14-
"Webex",
1514
"IINA",
1615
"FaceTime",
17-
"Netflix",
18-
"YouTube",
19-
"Crunchyroll",
20-
"Prime Video",
16+
-- PENDING https://github.com/brave/brave-browser/issues/53803
17+
-- "Netflix",
18+
-- "YouTube",
19+
-- "Crunchyroll",
20+
-- "Prime Video",
2121
}
2222

2323
---UTILS------------------------------------------------------------------------

hammerspoon/win-management/win-mover.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ local pseudoMaxApps = {
2424
"Granola",
2525
"Obsidian",
2626
"zoom.us",
27-
"Webex",
28-
"PDF Expert",
2927
"Highlights",
3028
"Signal",
3129
"Gmail",

0 commit comments

Comments
 (0)