forked from musq/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fonts.sh
executable file
·45 lines (28 loc) · 825 Bytes
/
fonts.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
#!/bin/bash
cd "$(dirname "${BASH_SOURCE[0]}")" \
&& . "../utils.sh"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
copy_fonts_locally() {
local -r message="Activate downloaded fonts"
local -r sourcePath="$HOME/.nix-profile/share/fonts"
local -r kernel="$(get_os_kernel)"
if [ "$kernel" == "Darwin" ]; then
local -r targetPath="$HOME/Library/Fonts"
else
local -r targetPath="$HOME/.local/share/fonts"
fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ -d "$sourcePath" ]; then
execute \
"cp -f $sourcePath/*/* $targetPath \
&& fc-cache -v" \
"$message"
else
print_error "$message"
return 1
fi
}
main() {
copy_fonts_locally
}
main