Skip to content

Commit

Permalink
mac: minor tweaks and docs
Browse files Browse the repository at this point in the history
Signed-off-by: clux <[email protected]>
  • Loading branch information
clux committed Sep 25, 2024
1 parent 65d63e8 commit 2bf4bd0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
[includeIf "gitdir:~/truelayer/"]
path = ~/.gitconfig-tl.inc
[includeIf "gitdir:/opt/homebrew/Library/Taps/truelayer/"]
# this is annoyingly not picked up on by brew update, but you can still brew install truelayer/internal/X
path = ~/.gitconfig-tl.inc
; include for all repositories inside ~/repos and ~/kube
[includeIf "gitdir:~/repos/"]
Expand Down
3 changes: 2 additions & 1 deletion .zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ if [[ "${OSTYPE}" =~ "darwin" ]]; then
# python on mac is also fun
path+="$(python3 -m site --user-base)/bin"

# want a consistent hostname for ansible
# Want a consistent hostname for ansible
# we re-initialise HostName / LocalHostName / ComputerName props at boot
export HOSTNAME="$(scutil --get LocalHostName)"

# disable analytics sending to homebrew
Expand Down
11 changes: 7 additions & 4 deletions config/hammerspoon/init.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
mash = {"", "", ""}

-- Non-laggy exec
function aerospace(args)
hs.task.new("/opt/homebrew/bin/aerospace", function(ud, ...)
hs.inspect(table.pack(...))
return true
end, args):start()
end


MAIN="3"
local function activateApp(name)
local app = hs.application.find(name)
if not app or app:isHidden() then
hs.application.launchOrFocus(name)
elseif hs.application.frontmostApplication() ~= app then
app:activate()
else
-- unfortunately we cannot swap out easily with aerospace
-- unfortunately we cannot swap back easily with aerospace
-- hiding the window would mean an empty workspace or pulling in another window
-- thus we hardcode the toggle to go back to 3 for now
aerospace({"workspace", "3"})
-- thus we hardcode the toggle return
aerospace({"workspace", MAIN})
end
end

-- Global terminal activation
hs.hotkey.bind({}, "F1", function() activateApp("alacritty") end)
hs.hotkey.bind(mash, "r", function() hs.reload(); aerospace("reload-config"); end)
hs.alert("HS + aerospace loaded")

-- TODO: use hs to trigger aerospace for switching so we could keep track of MAIN?
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ link: fontguard && check
# OS specific links
ln -sf $PWD/config/alacritty/{{os()}}.toml config/alacritty/os.toml
# key specific overrides (using whyq)
yq -i '.SKIP_HOST_UPDATE=true' --input=json ~/.config/discord/settings.json
#yq -i '.SKIP_HOST_UPDATE=true' --input=json ~/.config/discord/settings.json

# font guard helper
fontguard:
fd . {{FONT_DIR}} -e ttf | rg -q "Inconsolata.*Mono"
fd . {{FONT_DIR}} -e ttf | rg -q "Liberation"
fd . {{FONT_DIR}} -e ttf | rg -q "Liberation" # font-liberation pkg technically not necessary on mac

# reload configs insofar as possible/necessary
check:
Expand Down

0 comments on commit 2bf4bd0

Please sign in to comment.