-
Notifications
You must be signed in to change notification settings - Fork 2
/
install-karasa-jaga.sh
executable file
·44 lines (36 loc) · 1.35 KB
/
install-karasa-jaga.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
#!/bin/sh
set -e
gh_repo="libreoffice-style-karasa-jaga"
gh_desc="Karasa Jaga LibreOffice icon themes"
cat <<- EOF
$gh_desc
https://github.com/rizmut/$gh_repo
EOF
temp_dir="$(mktemp -d)"
echo "=> Getting the latest version from GitHub ..."
curl -L "https://github.com/rizmut/$gh_repo/archive/master.tar.gz" -o "/tmp/$gh_repo.tar.gz"
echo "=> Unpacking archive ..."
tar -xzf "/tmp/$gh_repo.tar.gz" -C "$temp_dir"
echo "=> Deleting old $gh_desc ..."
sudo rm -f "/usr/share/libreoffice/share/config/images_karasa_jaga.zip"
sudo rm -f "/usr/share/libreoffice/share/config/images_karasa_jaga_svg.zip"
echo "=> Installing ..."
sudo mkdir -p "/usr/share/libreoffice/share/config"
sudo cp -R \
"$temp_dir/$gh_repo-master/build/images_karasa_jaga.zip" \
"/usr/share/libreoffice/share/config"
sudo cp -R \
"$temp_dir/$gh_repo-master/build/images_karasa_jaga_svg.zip" \
"/usr/share/libreoffice/share/config"
for dir in \
/usr/lib64/libreoffice/share/config \
/usr/lib/libreoffice/share/config \
/usr/local/lib/libreoffice/share/config \
/opt/libreoffice*/share/config; do
[ -d "$dir" ] || continue
sudo ln -sf "/usr/share/libreoffice/share/config/images_karasa_jaga.zip" "$dir"
sudo ln -sf "/usr/share/libreoffice/share/config/images_karasa_jaga_svg.zip" "$dir"
done
echo "=> Clearing cache ..."
rm -rf "/tmp/$gh_repo.tar.gz" "$temp_dir"
echo "=> Done!"