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
@@ -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 [
|
||||
|
||||
Reference in new issue
Block a user