-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrack-themes.sh
More file actions
executable file
·63 lines (58 loc) · 1.7 KB
/
track-themes.sh
File metadata and controls
executable file
·63 lines (58 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
# Ensure script runs from the dotfiles repo root
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
if [ -z "$REPO_ROOT" ]; then
echo "Error: Not inside the dotfiles git repository."
exit 1
fi
cd "$REPO_ROOT" || exit 1
# List of all matugen output files (relative to repo root)
# Add/remove files according to matugen config
FILES=(
"kitty/.config/kitty/themes/Colors.conf"
"btop/.config/btop/themes/colors.theme"
"fuzzel/.config/fuzzel/colors.ini"
"mako/.config/mako/colors"
"gtk/.config/gtk-3.0/colors.css"
"gtk/.config/gtk-4.0/colors.css"
"waybar/.config/waybar/colors.css"
"yazi/.config/yazi/theme.toml"
"niri/.config/niri/colors.kdl"
"foot/.config/foot/colors.ini"
"nvim/.config/nvim/lua/plugins/theme.lua"
"helix/.config/helix/themes/colors.toml"
"swaylock/.config/swaylock/config"
"hypr/.config/hypr/colors.lua"
"qtct/.config/qt5ct/qt5ct.conf"
"qtct/.config/qt6ct/qt6ct.conf"
"mango/.config/mango/colors.conf"
)
skip_updates() {
echo "Marking ${#FILES[@]} files to skip worktree..."
git update-index --skip-worktree "${FILES[@]}" 2>/dev/null
echo "Done."
}
restore_tracking() {
echo "Restoring tracking for ${#FILES[@]} files..."
git update-index --no-skip-worktree "${FILES[@]}" 2>/dev/null
echo "Done."
}
case "$1" in
skip)
skip_updates
;;
track)
restore_tracking
;;
*)
echo "Usage: $0 {skip|track}"
echo " skip: Ignore local updates to matugen theme files"
echo " track: Resume tracking updates to matugen theme files"
echo ""
echo "Managed files (${#FILES[@]} total):"
for file in "${FILES[@]}"; do
echo " - $file"
done
exit 1
;;
esac