This commit is contained in:
vinceliuice 2018-06-09 22:55:05 +08:00
parent 718762abd1
commit 2900d21989
1 changed files with 43 additions and 41 deletions

20
install.sh Normal file → Executable file
View File

@ -9,9 +9,8 @@ DEST_DIR=/usr/share/themes
THEME_NAME=Sierra THEME_NAME=Sierra
COMPACT_VARIANTS=('' '-compact') COMPACT_VARIANTS=('' '-compact')
TRANS_VARIANTS=('' '-solid') TRANS_VARIANTS=('' '-solid')
COLOR_VARIANTS=( '-light' '-dark') COLOR_VARIANTS=('-light' '-dark')
THIN_VARIANTS=( '' '-thin') THIN_VARIANTS=('' '-thin')
usage() { usage() {
printf "%s\n" "Usage: $0 [OPTIONS...]" printf "%s\n" "Usage: $0 [OPTIONS...]"
@ -57,13 +56,13 @@ install() {
# Install index.theme # Install index.theme
echo "[Desktop Entry]" >> ${THEME_DIR}/index.theme echo "[Desktop Entry]" >> ${THEME_DIR}/index.theme
echo "Type=X-GNOME-Metatheme" >> ${THEME_DIR}/index.theme echo "Type=X-GNOME-Metatheme" >> ${THEME_DIR}/index.theme
echo "Name=Sierra${compact}${color}${trans}${thin}" >> ${THEME_DIR}/index.theme echo "Name=${name}${compact}${color}${trans}${thin}" >> ${THEME_DIR}/index.theme
echo "Comment=An Stylish Gtk+ theme based on Elegant Design" >> ${THEME_DIR}/index.theme echo "Comment=An Stylish Gtk+ theme based on Elegant Design" >> ${THEME_DIR}/index.theme
echo "Encoding=UTF-8" >> ${THEME_DIR}/index.theme echo "Encoding=UTF-8" >> ${THEME_DIR}/index.theme
echo "" >> ${THEME_DIR}/index.theme echo "" >> ${THEME_DIR}/index.theme
echo "[X-GNOME-Metatheme]" >> ${THEME_DIR}/index.theme echo "[X-GNOME-Metatheme]" >> ${THEME_DIR}/index.theme
echo "GtkTheme=Sierra${compact}${color}${trans}${thin}" >> ${THEME_DIR}/index.theme echo "GtkTheme=${name}${compact}${color}${trans}${thin}" >> ${THEME_DIR}/index.theme
echo "MetacityTheme=Sierra${compact}${color}${trans}${thin}" >> ${THEME_DIR}/index.theme echo "MetacityTheme=${name}${compact}${color}${trans}${thin}" >> ${THEME_DIR}/index.theme
echo "IconTheme=Adwaita" >> ${THEME_DIR}/index.theme echo "IconTheme=Adwaita" >> ${THEME_DIR}/index.theme
echo "CursorTheme=Adwaita" >> ${THEME_DIR}/index.theme echo "CursorTheme=Adwaita" >> ${THEME_DIR}/index.theme
echo "ButtonLayout=close,minimize,maximize:menu" >> ${THEME_DIR}/index.theme echo "ButtonLayout=close,minimize,maximize:menu" >> ${THEME_DIR}/index.theme
@ -72,7 +71,7 @@ install() {
cd ${SRC_DIR}/gnome-shell cd ${SRC_DIR}/gnome-shell
cp -r ${SRC_DIR}/gnome-shell/gnome-shell${color}${trans}.css ${THEME_DIR}/gnome-shell/gnome-shell.css cp -r ${SRC_DIR}/gnome-shell/gnome-shell${color}${trans}.css ${THEME_DIR}/gnome-shell/gnome-shell.css
cp -r ${SRC_DIR}/gnome-shell/{extensions,message-indicator-symbolic.svg,pad-osd.css} ${THEME_DIR}/gnome-shell cp -r ${SRC_DIR}/gnome-shell/{extensions,message-indicator-symbolic.svg,pad-osd.css} ${THEME_DIR}/gnome-shell
cp -r ${SRC_DIR}/gnome-shell/gnome-shell-theme.gresource.xml ${THEME_DIR}/gnome-shell
mkdir -p ${THEME_DIR}/gnome-shell/assets mkdir -p ${THEME_DIR}/gnome-shell/assets
cd ${SRC_DIR}/gnome-shell/assets cd ${SRC_DIR}/gnome-shell/assets
cp -r ${SRC_DIR}/gnome-shell/assets/{dash,dash-placeholder.svg,noise-texture.svg,startup.png,process-working.svg,window-close.svg,window-close-active.svg,toggle-on.svg,more-results.svg,checkbox.svg,key-enter.svg,key-shift-latched-uppercase.svg,key-shift-uppercase.svg} ${THEME_DIR}/gnome-shell/assets cp -r ${SRC_DIR}/gnome-shell/assets/{dash,dash-placeholder.svg,noise-texture.svg,startup.png,process-working.svg,window-close.svg,window-close-active.svg,toggle-on.svg,more-results.svg,checkbox.svg,key-enter.svg,key-shift-latched-uppercase.svg,key-shift-uppercase.svg} ${THEME_DIR}/gnome-shell/assets
@ -124,6 +123,7 @@ install() {
cp -r ${SRC_DIR}/xfwm4/assets${color}/*.png ${THEME_DIR}/xfwm4 cp -r ${SRC_DIR}/xfwm4/assets${color}/*.png ${THEME_DIR}/xfwm4
cp -r ${SRC_DIR}/xfwm4/themerc${color} ${THEME_DIR}/xfwm4/themerc cp -r ${SRC_DIR}/xfwm4/themerc${color} ${THEME_DIR}/xfwm4/themerc
} }
install_gdm() { install_gdm() {
local THEME_DIR=${1}/${2}${3}${4}${5}${6} local THEME_DIR=${1}/${2}${3}${4}${5}${6}
# bakup and install files related to gdm theme # bakup and install files related to gdm theme
@ -145,6 +145,7 @@ install_gdm() {
${THEME_DIR}/gnome-shell/gnome-shell-theme.gresource.xml ${THEME_DIR}/gnome-shell/gnome-shell-theme.gresource.xml
echo "Installing 'gnome-shell-theme.gresource'..." echo "Installing 'gnome-shell-theme.gresource'..."
} }
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "${1}" in case "${1}" in
-d|--dest) -d|--dest)
@ -269,9 +270,10 @@ for compact in "${compacts[@]:-${COMPACT_VARIANTS[@]}}"; do
done done
done done
done done
if [[ $gdm == true ]]; then
if [[ $gdm == true ]]; then
install_gdm "${dest:-${DEST_DIR}}" "${name:-${THEME_NAME}}" "${compact}" "${color}" "${trans}" "${thin}" install_gdm "${dest:-${DEST_DIR}}" "${name:-${THEME_NAME}}" "${compact}" "${color}" "${trans}" "${thin}"
fi fi
echo echo
echo Done. echo Done.