fix(apply): target specific system and timestamp backups
This commit is contained in:
1 parent
1c127b29e7
commit
83216e7b64
7 files changed
+18
-11
No files matched your search
@@ -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."
|
||||
@@ -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 [
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
[flavor]
|
||||
use = "catppuccin-latte"
|
||||
Reference in new issue
Block a user