mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-15 06:04:42 +00:00
theme dark:light
This commit is contained in:
parent
7ae7c1ceec
commit
67128fe09b
7 changed files with 190 additions and 40 deletions
|
|
@ -9,7 +9,7 @@ in {
|
|||
home.packages = builtins.attrValues customScripts.packages;
|
||||
|
||||
home.activation.initializeThemeState = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
mkdir -p "${customScripts.theme.paths.stateDir}" "${customScripts.theme.paths.tmuxDir}"
|
||||
mkdir -p "${customScripts.theme.paths.stateDir}" "${customScripts.theme.paths.ghosttyDir}" "${customScripts.theme.paths.tmuxDir}"
|
||||
|
||||
if [[ -f "${customScripts.theme.paths.stateFile}" ]]; then
|
||||
mode=$(tr -d '[:space:]' < "${customScripts.theme.paths.stateFile}")
|
||||
|
|
@ -20,14 +20,17 @@ in {
|
|||
|
||||
case "$mode" in
|
||||
light)
|
||||
ghostty_target="${customScripts.theme.paths.ghosttyDir}/cozybox-light"
|
||||
tmux_target="${customScripts.tmuxConfigs.light}"
|
||||
;;
|
||||
*)
|
||||
printf '%s\n' "${customScripts.theme.defaultMode}" > "${customScripts.theme.paths.stateFile}"
|
||||
ghostty_target="${customScripts.theme.paths.ghosttyDir}/cozybox-dark"
|
||||
tmux_target="${customScripts.tmuxConfigs.dark}"
|
||||
;;
|
||||
esac
|
||||
|
||||
ln -sfn "$ghostty_target" "${customScripts.theme.paths.ghosttyCurrentFile}"
|
||||
ln -sfn "$tmux_target" "${customScripts.theme.paths.tmuxCurrentFile}"
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue