This repository has been archived by the owner on Aug 10, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
install-papirus-root.sh
executable file
·57 lines (45 loc) · 1.84 KB
/
install-papirus-root.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
#!/bin/sh
set -e
gh_repo="papirus-libreoffice-theme"
gh_desc="Papirus LibreOffice themes"
cat <<- EOF
ppppp ii
pp pp aaaaa ppppp rr rrr uu uu sssss
ppppp aa aa pp pp ii rrrr uu uu ssss
pp aa aa pp pp ii rr uu uu ssss
pp aaaaa ppppp ii rr uuuuu sssss
pp
pp
$gh_desc
https://github.com/PapirusDevelopmentTeam/$gh_repo
EOF
temp_dir="$(mktemp -d)"
echo "=> Getting the latest version from GitHub ..."
wget -O "/tmp/$gh_repo.tar.gz" \
https://github.com/PapirusDevelopmentTeam/$gh_repo/archive/master.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_epapirus.zip"
sudo rm -f "/usr/share/libreoffice/share/config/images_papirus.zip"
sudo rm -f "/usr/share/libreoffice/share/config/images_papirus_dark.zip"
echo "=> Installing ..."
sudo mkdir -p "/usr/share/libreoffice/share/config"
sudo cp -R \
"$temp_dir/$gh_repo-master/images_epapirus.zip" \
"$temp_dir/$gh_repo-master/images_papirus.zip" \
"$temp_dir/$gh_repo-master/images_papirus_dark.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_epapirus.zip" "$dir"
sudo ln -sf "/usr/share/libreoffice/share/config/images_papirus.zip" "$dir"
sudo ln -sf "/usr/share/libreoffice/share/config/images_papirus_dark.zip" "$dir"
done
echo "=> Clearing cache ..."
rm -rf "/tmp/$gh_repo.tar.gz" "$temp_dir"
echo "=> Done!"