Repository navigation
Expand file tree
/
Copy pathscrery.sh
More file actions
77 lines (66 loc) · 2.38 KB
/
Copy pathscrery.sh
File metadata and controls
77 lines (66 loc) · 2.38 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
set -euo pipefail
# Detect Arch Linux
if ! grep -qi arch /etc/os-release; then
echo "This Srcery color scheme install script only works on Arch Linux."
exit 1
fi
SRCERY_DIR="$HOME/.srcery"
I3_CONFIG="$HOME/.config/i3/config"
ALACRITTY_CONFIG="$HOME/.config/alacritty/alacritty.yml"
function install_dependencies() {
echo "Installing necessary dependencies..."
sudo pacman -Sy --needed --noconfirm git make gcc ncurses
}
function clone_srcery() {
if [[ -d "$SRCERY_DIR" ]]; then
echo "Srcery repo found, updating..."
git -C "$SRCERY_DIR" pull
else
echo "Cloning Srcery..."
git clone https://github.com/srcery-colors/srcery-colors.git "$SRCERY_DIR"
fi
}
function install_srcery_terminal() {
echo "Installing Srcery terminal colors..."
cd "$SRCERY_DIR/term-colors" || exit
./install.sh
cd - || exit
}
function apply_i3_colors() {
if [[ -f "$I3_CONFIG" ]]; then
echo "Applying Srcery colors to i3 config..."
# Backup i3 config
cp "$I3_CONFIG" "${I3_CONFIG}.bak.$(date +%Y%m%d%H%M%S)"
# Replace color-related lines with Srcery scheme (simple example)
sed -i 's/^set \$bg .*/set $bg #1c1c1c/' "$I3_CONFIG"
sed -i 's/^set \$fg .*/set $fg #c5c8c6/' "$I3_CONFIG"
else
echo "i3 config not found at $I3_CONFIG, skipping i3 color config."
fi
}
function apply_alacritty_colors() {
if [[ -f "$ALACRITTY_CONFIG" ]]; then
echo "Applying Srcery colors to Alacritty..."
cp "$ALACRITTY_CONFIG" "${ALACRITTY_CONFIG}.bak.$(date +%Y%m%d%H%M%S)"
# Append srcery colors include or merge as needed
# This depends on your alacritty.yml structure
# For simplicity, let's just copy the srcery alacritty.yml if exists:
if [[ -f "$SRCERY_DIR/alacritty.yml" ]]; then
cp "$SRCERY_DIR/alacritty.yml" "$ALACRITTY_CONFIG"
echo "Srcery Alacritty config applied."
else
echo "Srcery alacritty.yml not found; skipping."
fi
else
echo "Alacritty config not found at $ALACRITTY_CONFIG; skipping."
fi
}
echo "Installing Srcery color scheme on Arch Linux..."
install_dependencies
clone_srcery
install_srcery_terminal
apply_i3_colors
apply_alacritty_colors
echo "Srcery color scheme installation complete."
exit 0