by roundabout, Thursday, 5 April 2018, 16:06:27 (1522944387), pushed by roundabout, Sunday, 11 May 2025, 13:22:22 (1746969742)
Author identity: nana-4 <nana-4@users.noreply.github.com>
448d5050a931752c7db3f89a0c1a5df961387c14
install.sh
@@ -37,10 +37,13 @@ usage() {
printf " %-25s%s\n" "-n, --name NAME" "Specify theme name (Default: ${THEME_NAME})"
printf " %-25s%s\n" "-c, --color VARIANTS..." "Specify theme color variant(s) [standard|dark|light] (Default: All variants)"
printf " %-25s%s\n" "-s, --size VARIANT" "Specify theme size variant [standard|compact] (Default: All variants)"
printf " %-25s%s\n" "-g, --gdm" "Install GDM theme"
printf " %-25s%s\n" "-h, --help" "Show this help"
printf "\n%s\n" "INSTALLATION EXAMPLES:"
printf "%s\n" "Install all theme variants into ~/.themes"
printf " %s\n" "$0 --dest ~/.themes"
printf "%s\n" "Install all theme variants into ~/.themes including GDM theme"
printf " %s\n" "$0 --dest ~/.themes --gdm"
printf "%s\n" "Install standard theme variant only"
printf " %s\n" "$0 --color standard --size standard"
printf "%s\n" "Install specific theme variants with different name into ~/.themes"
@@ -75,10 +78,6 @@ install() {
cp -r ${SRC_DIR}/gnome-shell/gnome-shell-theme.gresource.xml ${THEME_DIR}/gnome-shell
cp -r ${SRC_DIR}/gnome-shell/assets${ELSE_DARK} ${THEME_DIR}/gnome-shell/assets
cp -r ${SRC_DIR}/gnome-shell/${GS_VERSION}/gnome-shell${color}${size}.css ${THEME_DIR}/gnome-shell/gnome-shell.css
# glib-compile-resources \
# --sourcedir=${THEME_DIR}/gnome-shell \
# --target=${THEME_DIR}/gnome-shell/gnome-shell-theme.gresource \
# ${SRC_DIR}/gnome-shell/gnome-shell-theme.gresource.xml
mkdir -p ${THEME_DIR}/gtk-2.0
cp -r ${SRC_DIR}/gtk-2.0/{apps.rc,hacks.rc,main.rc} ${THEME_DIR}/gtk-2.0
@@ -116,7 +115,27 @@ install() {
cp -r ${SRC_DIR}/xfwm4/{*.svg,themerc} ${THEME_DIR}/xfwm4
cp -r ${SRC_DIR}/xfwm4/assets${ELSE_LIGHT} ${THEME_DIR}/xfwm4/assets
}
install_gdm() {
local THEME_DIR=${1}/${2}${3}${4}
# bakup and install files related to gdm theme
if [[ ! -f /usr/share/gnome-shell/gnome-shell-theme.gresource.bak ]]; then
mv -f /usr/share/gnome-shell/gnome-shell-theme.gresource \
/usr/share/gnome-shell/gnome-shell-theme.gresource.bak
fi
if [[ -f /usr/share/gnome-shell/theme/ubuntu.css ]]; then
if [[ ! -f /usr/share/gnome-shell/theme/ubuntu.css.bak ]]; then
mv -f /usr/share/gnome-shell/theme/ubuntu.css \
/usr/share/gnome-shell/theme/ubuntu.css.bak
fi
cp -af ${THEME_DIR}/gnome-shell/gnome-shell.css \
/usr/share/gnome-shell/theme/ubuntu.css
fi
glib-compile-resources \
--sourcedir=${THEME_DIR}/gnome-shell \
--target=/usr/share/gnome-shell/gnome-shell-theme.gresource \
${THEME_DIR}/gnome-shell/gnome-shell-theme.gresource.xml
echo "Installing 'gnome-shell-theme.gresource'..."
}
while [[ $# -gt 0 ]]; do
case "${1}" in
-d|--dest)
@@ -131,6 +150,10 @@ while [[ $# -gt 0 ]]; do
name="${2}"
shift 2
;;
-g|--gdm)
gdm=true
shift 1
;;
-c|--color)
shift
for variant in "${@}"; do
@@ -203,6 +226,9 @@ for color in "${colors[@]:-${COLOR_VARIANTS[@]}}"; do
install "${dest:-${DEST_DIR}}" "${name:-${THEME_NAME}}" "${color}" "${size}"
done
done
if [[ $gdm == true ]]; then
install_gdm "${dest:-${DEST_DIR}}" "${name:-${THEME_NAME}}" "${color}" "${size}"
fi
echo
echo Done.