diff --git a/config/bash/bashrc b/config/bash/bashrc index c7a5cc3..2c5d91a 100644 --- a/config/bash/bashrc +++ b/config/bash/bashrc @@ -1,3 +1,8 @@ +_tf="${XDG_STATE_HOME:-$HOME/.local/state}/theme" +THEME="$(cat "$_tf" 2>/dev/null)" || THEME="midnight" +export THEME +unset _tf + shopt -s autocd cdspell dirspell globstar histappend HISTFILE="${XDG_STATE_HOME:-$HOME/.local/state}/bash_history" diff --git a/home/modules/shell.nix b/home/modules/shell.nix index d34bc65..ec8d9ce 100644 --- a/home/modules/shell.nix +++ b/home/modules/shell.nix @@ -114,7 +114,6 @@ in CLAUDE_CONFIG_DIR = "${config.xdg.configHome}/claude"; }) { - THEME = config.theme; INPUTRC = "${repoDir}/config/bash/inputrc"; } ]; diff --git a/hosts/xps15/configuration.nix b/hosts/xps15/configuration.nix index 286cac1..701e51d 100644 --- a/hosts/xps15/configuration.nix +++ b/hosts/xps15/configuration.nix @@ -95,6 +95,10 @@ in [ -f "$_hm/etc/profile.d/hm-session-vars.sh" ] && . "$_hm/etc/profile.d/hm-session-vars.sh" && break done unset _hm + _tf="''${XDG_STATE_HOME:-$HOME/.local/state}/theme" + THEME="$(cat "$_tf" 2>/dev/null)" || THEME="midnight" + export THEME + unset _tf if [ "$(tty)" = "/dev/tty1" ]; then exec Hyprland fi diff --git a/scripts/theme b/scripts/theme index 18caf9d..ba26db0 100755 --- a/scripts/theme +++ b/scripts/theme @@ -49,6 +49,11 @@ fi [ -z "$theme" ] && exit 1 echo "$themes" | grep -Fxq "$theme" || exit 1 +state_dir="${XDG_STATE_HOME:-$HOME/.local/state}" +mkdir -p "$state_dir" +printf '%s\n' "$theme" > "$state_dir/theme" +export THEME="$theme" + case "$(uname)" in Linux) case "$theme" in