feat: init dynamic wallpaper ($theme gen)
Some checks are pending
quality / changes (push) Waiting to run
quality / Flake Check (push) Blocked by required conditions
quality / Nix Format Check (push) Blocked by required conditions
quality / Deploy netty (push) Blocked by required conditions

This commit is contained in:
Harivansh Rathi 2026-04-08 15:10:57 -04:00
parent 38c096dbc1
commit af19b1e78b
6 changed files with 489 additions and 11 deletions

View file

@ -14,7 +14,12 @@ in
++ lib.optionals hostConfig.isDarwin (builtins.attrValues customScripts.darwinPackages);
home.activation.initializeThemeState = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir -p "${customScripts.theme.paths.stateDir}" "${customScripts.theme.paths.fzfDir}" "${customScripts.theme.paths.ghosttyDir}" "${customScripts.theme.paths.tmuxDir}"
mkdir -p "${customScripts.theme.paths.stateDir}" \
"${customScripts.theme.paths.fzfDir}" \
"${customScripts.theme.paths.ghosttyDir}" \
"${customScripts.theme.paths.tmuxDir}" \
"${customScripts.theme.paths.lazygitDir}" \
"${customScripts.theme.wallpapers.dir}"
if [[ -f "${customScripts.theme.paths.stateFile}" ]]; then
mode=$(tr -d '[:space:]' < "${customScripts.theme.paths.stateFile}")
@ -28,17 +33,43 @@ in
fzf_target="${customScripts.theme.paths.fzfDir}/cozybox-light"
ghostty_target="${customScripts.theme.paths.ghosttyDir}/cozybox-light"
tmux_target="${customScripts.tmuxConfigs.light}"
lazygit_target="${customScripts.theme.paths.lazygitDir}/config-light.yml"
;;
*)
printf '%s\n' "${customScripts.theme.defaultMode}" > "${customScripts.theme.paths.stateFile}"
fzf_target="${customScripts.theme.paths.fzfDir}/cozybox-dark"
ghostty_target="${customScripts.theme.paths.ghosttyDir}/cozybox-dark"
tmux_target="${customScripts.tmuxConfigs.dark}"
lazygit_target="${customScripts.theme.paths.lazygitDir}/config-dark.yml"
;;
esac
ln -sfn "$fzf_target" "${customScripts.theme.paths.fzfCurrentFile}"
ln -sfn "$ghostty_target" "${customScripts.theme.paths.ghosttyCurrentFile}"
ln -sfn "$tmux_target" "${customScripts.theme.paths.tmuxCurrentFile}"
ln -sfn "$lazygit_target" "${customScripts.theme.paths.lazygitCurrentFile}"
${lib.optionalString hostConfig.isDarwin ''
lg_darwin="${config.home.homeDirectory}/Library/Application Support/lazygit"
mkdir -p "$lg_darwin"
case "$mode" in
light) ln -sfn "$lg_darwin/config-light.yml" "$lg_darwin/config.yml" ;;
*) ln -sfn "$lg_darwin/config-dark.yml" "$lg_darwin/config.yml" ;;
esac
''}
# seed wallpapers from static assets if no generated ones exist yet
if [[ ! -f "${customScripts.theme.wallpapers.dark}" ]]; then
cp "${customScripts.theme.wallpapers.staticDark}" "${customScripts.theme.wallpapers.dark}"
fi
if [[ ! -f "${customScripts.theme.wallpapers.light}" ]]; then
cp "${customScripts.theme.wallpapers.staticLight}" "${customScripts.theme.wallpapers.light}"
fi
# ensure wallpaper symlink points to active mode
case "$mode" in
light) wp_target="${customScripts.theme.wallpapers.light}" ;;
*) wp_target="${customScripts.theme.wallpapers.dark}" ;;
esac
ln -sfn "$wp_target" "${customScripts.theme.wallpapers.current}"
'';
}