Updated install script
This commit is contained in:
parent
122ab7d6f3
commit
ccb4e7afbb
83
install.sh
83
install.sh
|
@ -26,9 +26,24 @@ echo '#-----------------------------------------#'
|
||||||
echo '# Paper GTK Theme Install Script #'
|
echo '# Paper GTK Theme Install Script #'
|
||||||
echo '#-----------------------------------------#'
|
echo '#-----------------------------------------#'
|
||||||
|
|
||||||
|
|
||||||
|
show_question() {
|
||||||
|
echo -e "\033[1;34m$@\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
|
show_dir() {
|
||||||
|
echo -e "\033[1;32m$@\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
|
show_error() {
|
||||||
|
echo -e "\033[1;31m$@\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
function continue {
|
function continue {
|
||||||
echo ""
|
echo
|
||||||
read -p "Do you want to continue? (Y)es, (N)o : " INPUT
|
show_question '\tDo you want to continue? (Y)es, (N)o : '
|
||||||
|
echo
|
||||||
|
read INPUT
|
||||||
case $INPUT in
|
case $INPUT in
|
||||||
[Yy]* ) main;;
|
[Yy]* ) main;;
|
||||||
[Nn]* ) exit 99;;
|
[Nn]* ) exit 99;;
|
||||||
|
@ -40,33 +55,32 @@ function main {
|
||||||
if [ "$UID" -eq "$ROOT_UID" ]; then
|
if [ "$UID" -eq "$ROOT_UID" ]; then
|
||||||
if [ -d /usr/share/themes/Paper ]; then
|
if [ -d /usr/share/themes/Paper ]; then
|
||||||
echo
|
echo
|
||||||
read -p "Found an existing installation. Replace it? (Y)es, (N)o : " INPUT
|
show_question '\tFound an existing installation. Replace it? (Y)es, (N)o : '
|
||||||
|
echo
|
||||||
|
read INPUT
|
||||||
case $INPUT in
|
case $INPUT in
|
||||||
[Yy]* ) rm -Rf /usr/share/themes/Paper 2>/dev/null;;
|
[Yy]* ) rm -Rf /usr/share/themes/Paper 2>/dev/null;;
|
||||||
[Nn]* );;
|
[Nn]* );;
|
||||||
* )
|
* ) clear; show_error '\tSorry, try again.'; main;;
|
||||||
clear && echo 'Sorry, try again.'
|
|
||||||
main
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
echo "Installing..."
|
||||||
cp -R ./Paper/ /usr/share/themes/
|
cp -R ./Paper/ /usr/share/themes/
|
||||||
chmod -R 755 /usr/share/themes/Paper
|
chmod -R 755 /usr/share/themes/Paper
|
||||||
echo "Installation complete!"
|
echo "Installation complete!"
|
||||||
set
|
|
||||||
elif [ "$UID" -ne "$ROOT_UID" ]; then
|
elif [ "$UID" -ne "$ROOT_UID" ]; then
|
||||||
if [ -d $HOME/.local/share/themes/Paper ]; then
|
if [ -d $HOME/.local/share/themes/Paper ]; then
|
||||||
echo
|
echo
|
||||||
read -p "Found an existing installation. Replace it? (Y)es, (N)o : " INPUT
|
show_question '\tFound an existing installation. Replace it? (Y)es, (N)o : '
|
||||||
|
echo
|
||||||
|
read INPUT
|
||||||
case $INPUT in
|
case $INPUT in
|
||||||
[Yy]* ) rm -Rf "$HOME/.local/share/themes/Paper" 2>/dev/null;;
|
[Yy]* ) rm -Rf "$HOME/.local/share/themes/Paper" 2>/dev/null;;
|
||||||
[Nn]* );;
|
[Nn]* );;
|
||||||
* )
|
* ) clear; show_error '\tSorry, try again.'; main;;
|
||||||
clear && echo 'Sorry, try again.'
|
|
||||||
main
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
echo "Installing..."
|
||||||
# .local/share/themes
|
# .local/share/themes
|
||||||
if [ -d $HOME/.local/share/themes ]; then
|
if [ -d $HOME/.local/share/themes ]; then
|
||||||
cp -R ./Paper/ $HOME/.local/share/themes/
|
cp -R ./Paper/ $HOME/.local/share/themes/
|
||||||
|
@ -82,25 +96,49 @@ elif [ "$UID" -ne "$ROOT_UID" ]; then
|
||||||
cp -R ./Paper/ $HOME/.local/share/themes/
|
cp -R ./Paper/ $HOME/.local/share/themes/
|
||||||
fi
|
fi
|
||||||
echo "Installation complete!"
|
echo "Installation complete!"
|
||||||
|
set
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function set {
|
function set {
|
||||||
echo ""
|
echo
|
||||||
read -p "Do you want to set Paper as desktop theme? (Y)es, (N)o : " INPUT
|
show_question '\tDo you want to set Paper as desktop theme? (Y)es, (N)o : '
|
||||||
|
echo
|
||||||
|
read INPUT
|
||||||
case $INPUT in
|
case $INPUT in
|
||||||
[Yy]* ) settheme;;
|
[Yy]* ) settheme;;
|
||||||
[Nn]* ) end;;
|
[Nn]* ) end;;
|
||||||
* ) echo; echo "Uh oh, invalid response. Please retry."; set;;
|
* ) echo; show_error "\aUh oh, invalid response. Please retry."; set;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function settheme {
|
function settheme {
|
||||||
echo "Setting Paper as desktop GTK theme..."
|
echo "Setting Paper as desktop GTK theme..."
|
||||||
|
gsettings reset org.gnome.desktop.interface gtk-theme
|
||||||
|
gsettings reset org.gnome.desktop.wm.preferences theme
|
||||||
gsettings set org.gnome.desktop.interface gtk-theme "Paper"
|
gsettings set org.gnome.desktop.interface gtk-theme "Paper"
|
||||||
gsettings set org.gnome.desktop.wm.preferences theme "Paper"
|
gsettings set org.gnome.desktop.wm.preferences theme "Paper"
|
||||||
echo "Done."
|
echo "Done."
|
||||||
end
|
setthemegnome
|
||||||
|
}
|
||||||
|
|
||||||
|
function setthemegnome {
|
||||||
|
if [ -d /usr/share/gnome-shell/extensions/user-theme@gnome-shell-extensions.gcampax.github.com/ ]; then
|
||||||
|
echo
|
||||||
|
show_question '\tWould you like to use Paper as your GNOME Shell theme? (Y)es, (N)o : '
|
||||||
|
echo
|
||||||
|
read INPUT
|
||||||
|
case $INPUT in
|
||||||
|
[Yy]* ) gsettings set org.gnome.shell.extensions.user-theme name "Paper";;
|
||||||
|
[Nn]* ) end;;
|
||||||
|
* ) echo; show_error "\aUh oh, invalid response. Please retry."; set;;
|
||||||
|
esac
|
||||||
|
end
|
||||||
|
else
|
||||||
|
end
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function end {
|
function end {
|
||||||
|
@ -108,15 +146,22 @@ function end {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ROOT_UID=0
|
ROOT_UID=0
|
||||||
if [ "$UID" -ne "$ROOT_UID" ]; then
|
if [ "$UID" -ne "$ROOT_UID" ]; then
|
||||||
echo
|
echo
|
||||||
echo "Paper GTK Theme will be installed in '$HOME/.local/share/themes/Paper'."
|
echo "Paper GTK Theme will be installed in:"
|
||||||
|
echo
|
||||||
|
show_dir '\t$HOME/.local/share/themes'
|
||||||
|
echo
|
||||||
echo "To make them available to all users, run this script as root."
|
echo "To make them available to all users, run this script as root."
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
echo
|
echo
|
||||||
echo "Paper GTK Theme will be installed in '/usr/share/themes'"
|
echo "Paper GTK Theme will be installed in:"
|
||||||
|
echo
|
||||||
|
show_dir '\t/usr/share/themes'
|
||||||
|
echo
|
||||||
echo "It will be available to all users."
|
echo "It will be available to all users."
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
Loading…
Reference in New Issue