56 lines
1.5 KiB
Bash
Executable File
56 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
##makedesc: Install papirus-icon-theme (latest)
|
|
|
|
set -eo pipefail
|
|
|
|
installed() { command -v "$1" >/dev/null 2>&1; }
|
|
|
|
if [ "$(uname -s)" = "Darwin" ]; then
|
|
echo "ERROR: Papirus icon theme is not supported on macOS." >&2
|
|
exit 1
|
|
fi
|
|
|
|
download() {
|
|
if installed wget; then
|
|
wget -q --show-progress "$1" -O "$2"
|
|
else
|
|
curl -fsSL "$1" -o "$2"
|
|
fi
|
|
}
|
|
|
|
install() {
|
|
echo
|
|
echo "==============================================="
|
|
echo "Installing papirus-icon-theme"
|
|
echo "==============================================="
|
|
echo
|
|
|
|
if installed git; then
|
|
sudo git clone \
|
|
--depth 1 \
|
|
--single-branch \
|
|
https://github.com/PapirusDevelopmentTeam/papirus-icon-theme.git \
|
|
/usr/src/papirus-icon-theme
|
|
|
|
sudo chown "$(whoami)": -R /usr/src/papirus-icon-theme
|
|
else
|
|
download https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/archive/refs/heads/master.zip /tmp/papirus-icon-theme.zip
|
|
sudo unzip -oq /tmp/papirus-icon-theme.zip -d /usr/src/papirus-icon-theme
|
|
rm -f /tmp/papirus-icon-theme.zip
|
|
fi
|
|
|
|
sudo ln -sf /usr/src/papirus-icon-theme/Papirus /usr/share/icons/Papirus
|
|
sudo ln -sf /usr/src/papirus-icon-theme/Papirus-Dark /usr/share/icons/Papirus-Dark
|
|
sudo ln -sf /usr/src/papirus-icon-theme/Papirus-Light /usr/share/icons/Papirus-Light
|
|
|
|
echo
|
|
echo "Finish!"
|
|
echo "You can find icons in /usr/share/icons/"
|
|
echo
|
|
}
|
|
|
|
case "$1" in
|
|
*) install ;;
|
|
esac
|
|
|