@@ -94,10 +94,33 @@ link .ghci .ghci || true
9494
9595link .config/sketchybar .config/sketchybar
9696link .config/kitty/kitty.conf .config/kitty/kitty.conf
97+ link .config/kitty/theme-light.conf .config/kitty/theme-light.conf
98+ link .config/kitty/theme-dark.conf .config/kitty/theme-dark.conf
9799link .config/starship.toml .config/starship.toml
98100link .config/karabiner/karabiner.json .config/karabiner/karabiner.json || true
99101link .config/nvim .config/nvim
100102
103+ # Theme watcher files
104+ link scripts/apply_theme.sh scripts/apply_theme.sh
105+
106+ # Install LaunchAgent plist (validated)
107+ install_launchd () {
108+ src=" $THIS_DIR /launchd/local.theme-watcher.plist"
109+ dst=" $HOME /Library/LaunchAgents/local.theme-watcher.plist"
110+ if [ " $DRY_RUN " -eq 1 ]; then
111+ echo " + mkdir -p $( dirname " $dst " ) "
112+ echo " + cp \" $src \" \" $dst \" "
113+ echo " + chmod 644 \" $dst \" "
114+ echo " + plutil -lint \" $dst \" "
115+ else
116+ mkdir -p " $( dirname " $dst " ) "
117+ cp " $src " " $dst "
118+ chmod 644 " $dst " || true
119+ plutil -lint " $dst "
120+ fi
121+ }
122+ install_launchd
123+
101124# 6) Start services
102125title " Starting services"
103126if command -v yabai > /dev/null 2>&1 ; then
@@ -128,6 +151,29 @@ if command -v sketchybar >/dev/null 2>&1; then
128151 fi
129152fi
130153
154+ # 6b) Theme watcher (Light/Dark auto)
155+ title " Configuring theme watcher"
156+ if [ " $DRY_RUN " -eq 1 ]; then
157+ echo " + chmod +x \" $HOME /scripts/apply_theme.sh\" "
158+ echo " + launchctl bootout gui/$( id -u) local.theme-watcher || true"
159+ echo " + launchctl bootstrap gui/$( id -u) \" $HOME /Library/LaunchAgents/local.theme-watcher.plist\" "
160+ echo " + launchctl enable gui/$( id -u) /local.theme-watcher"
161+ echo " + launchctl kickstart -k gui/$( id -u) /local.theme-watcher"
162+ echo " + zsh -lc \" $HOME /scripts/apply_theme.sh\" "
163+ else
164+ chmod +x " $HOME /scripts/apply_theme.sh" || true
165+ launchctl bootout gui/" $( id -u) " local.theme-watcher > /dev/null 2>&1 || true
166+ if ! launchctl bootstrap gui/" $( id -u) " " $HOME /Library/LaunchAgents/local.theme-watcher.plist" ; then
167+ # Fallback for older macOS
168+ launchctl unload -wF " $HOME /Library/LaunchAgents/local.theme-watcher.plist" > /dev/null 2>&1 || true
169+ launchctl load -wF " $HOME /Library/LaunchAgents/local.theme-watcher.plist" || true
170+ else
171+ launchctl enable gui/" $( id -u) " /local.theme-watcher || true
172+ launchctl kickstart -k gui/" $( id -u) " /local.theme-watcher || true
173+ fi
174+ zsh -lc " $HOME /scripts/apply_theme.sh" || true
175+ fi
176+
131177# 7) Post-install notes
132178title " Post-install steps"
133179cat << 'EOS '
@@ -139,6 +185,12 @@ cat <<'EOS'
139185- Hide Menu Bar and Dock (System Settings) for a clean look
140186- Set your terminal font to “JetBrainsMono Nerd Font”
141187
188+ - Automatic Light/Dark theme:
189+ - The theme watcher writes the current mode to ~/.theme and notifies apps
190+ - Kitty theme switching looks for:
191+ - ~/.config/kitty/theme-light.conf
192+ - ~/.config/kitty/theme-dark.conf
193+
142194Tip: Kitty is installed. Launch with: open -na "Kitty" (or ⌥ + enter as configured by skhd)
143195EOS
144196
0 commit comments