diff --git a/apply.sh b/apply.sh index 2569879..078893c 100755 --- a/apply.sh +++ b/apply.sh @@ -11,5 +11,10 @@ nu -c "source ~/.dotfiles/config/nushell/env.nu; source ~/.dotfiles/config/nushe } echo "=> Smoke test passed. Applying home-manager configuration..." -home-manager switch --flake . -b backup +if [[ "$(uname -s)" == "Darwin" ]]; then + TARGET="mac" +else + TARGET="linux" +fi +home-manager switch --flake .#$TARGET -b "backup-$(date +%s)" echo "=> Done." diff --git a/config/nushell/scripts/theme-switch.nu b/config/nushell/scripts/theme-switch.nu index 2235ed9..67da04e 100755 --- a/config/nushell/scripts/theme-switch.nu +++ b/config/nushell/scripts/theme-switch.nu @@ -20,7 +20,6 @@ def apply-theme [selected: string] { let base = $"($home)/.config/themes/catppuccin/($choice)" if not ($base | path exists) { - notify-send "Theme not found" $base exit 1 } @@ -67,21 +66,19 @@ def apply-theme [selected: string] { } # GTK theme, only if installed. - if ($"/usr/share/themes/($gtk_theme)" | path exists) { - gsettings set org.gnome.desktop.interface gtk-theme $gtk_theme + try { + bash -lc $"gsettings set org.gnome.desktop.interface gtk-theme ($gtk_theme)" let color_scheme = if $choice == "mocha" { "prefer-dark" } else { "prefer-light" } - gsettings set org.gnome.desktop.interface color-scheme $color_scheme + bash -lc $"gsettings set org.gnome.desktop.interface color-scheme ($color_scheme)" if ($"($home)/.config/gtk-3.0/settings.ini" | path exists) { bash -lc $'sed -i "s/^gtk-theme-name=.*/gtk-theme-name=($gtk_theme)/" "$HOME/.config/gtk-3.0/settings.ini"' } - } else { - notify-send "GTK theme not installed" $gtk_theme + } catch { } hyprctl reload bash -lc "pkill quickshell 2>/dev/null; setsid quickshell >/tmp/quickshell-theme-switch.log 2>&1 < /dev/null &" - notify-send "Theme applied" $"($choice) via ($selected)" } def main [ diff --git a/home.nix b/home.nix index d7707e6..07f9de6 100644 --- a/home.nix +++ b/home.nix @@ -3,6 +3,8 @@ { nix.package = pkgs.nix; + nixpkgs.config.allowUnfree = true; + home.username = "johannes"; home.homeDirectory = if pkgs.stdenv.hostPlatform.isDarwin then "/Users/johannes" else "/home/johannes"; @@ -42,6 +44,7 @@ unzip owncloud-client wl-clipboard + obsidian ]; home.file = { diff --git a/local_share/dark-mode.d/theme-switch b/local_share/dark-mode.d/theme-switch index 24e9724..3a28623 100755 --- a/local_share/dark-mode.d/theme-switch +++ b/local_share/dark-mode.d/theme-switch @@ -1,3 +1,3 @@ #!/bin/sh -gsettings set org.gnome.desktop.interface color-scheme prefer-dark +bash -lc 'gsettings set org.gnome.desktop.interface color-scheme prefer-dark' exec "$HOME/.config/nushell/scripts/theme-switch.nu" --auto diff --git a/local_share/light-mode.d/theme-switch b/local_share/light-mode.d/theme-switch index f626189..9cd9e3d 100755 --- a/local_share/light-mode.d/theme-switch +++ b/local_share/light-mode.d/theme-switch @@ -1,3 +1,3 @@ #!/bin/sh -gsettings set org.gnome.desktop.interface color-scheme prefer-light +bash -lc 'gsettings set org.gnome.desktop.interface color-scheme prefer-light' exec "$HOME/.config/nushell/scripts/theme-switch.nu" --auto diff --git a/mutable_config/btop/btop.conf b/mutable_config/btop/btop.conf index 1f2e49e..7540ed2 100644 --- a/mutable_config/btop/btop.conf +++ b/mutable_config/btop/btop.conf @@ -2,7 +2,7 @@ #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. #* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" -color_theme = "/home/johannes/.config/btop/themes/catppuccin.theme" +color_theme = "/home/johannes/.config/btop/themes/catppuccin_latte.theme" #* If the theme set background should be shown, set to False if you want terminal background transparency. theme_background = false diff --git a/mutable_config/yazi/theme.toml b/mutable_config/yazi/theme.toml new file mode 100644 index 0000000..00a7314 --- /dev/null +++ b/mutable_config/yazi/theme.toml @@ -0,0 +1,2 @@ +[flavor] +use = "catppuccin-latte"