-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.sh
executable file
·66 lines (48 loc) · 1.65 KB
/
deploy.sh
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
#!/usr/bin/env bash
DOTFILES_DIR="$HOME/.dotfiles"
TMP_DIR="/tmp"
# /* ======================================================================== *\
awesome() {
echo "Creating symbolic link for AwesomeWM..."
ln -sf "$DOTFILES_DIR/home/config/awesome" "$HOME/.config/awesome"
}
# /* ======================================================================== *\
home() {
echo "Executing home-manager switch..."
home-manager switch --flake .#gabriel@aorus
}
aorus() {
echo "Executing nixos-rebuild switch..."
sudo nixos-rebuild switch --flake .#aorus
}
# /* ======================================================================== *\
font() {
FONTS_DIR="$HOME/.local/share/fonts"
mkdir -p "$TMP_DIR" "$FONTS_DIR"
# NOTE: https://github.com/be5invis/Iosevka
echo "Downloading Iosevka fonts to $TMP_DIR..."
curl -s 'https://api.github.com/repos/be5invis/Iosevka/releases/latest' | \
jq -r ".assets[] | .browser_download_url" | \
grep -E 'PkgTTC-Iosevka(Etoile|Slab)' | \
while read -r url; do
file_name=$(basename "$url")
curl -L --fail --progress-bar --show-error -o "$TMP_DIR/$file_name" "$url"
done
echo "Extracting fonts to $FONTS_DIR..."
find "$TMP_DIR" -name "*.zip" -exec unzip -q -o {} -d "$FONTS_DIR/Iosevka" \; 2>/dev/null
echo "Updating font cache..."
fc-cache -f
echo "Done"
}
# /* ======================================================================== *\
help() {
echo "Usage: $0 {home|aorus|awesome|font}"
}
# /* ======================================================================== *\
case "$1" in
aorus) aorus ;;
awesome) awesome ;;
font) font ;;
home) home ;;
*) help ;;
esac