A fork of the Materia GTK theme.

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

feat(render_assets): make optipng optional (#336)

  • feat(render_assets): make optipng optional

  • fix(change_color.sh): add two missing fallback values

by roundabout, Sunday, 23 December 2018, 05:30:36 (1545543036), pushed by roundabout, Sunday, 11 May 2025, 13:22:31 (1746969751)

Author identity: nana-4 <nana-4@users.noreply.github.com>

17e6b3567ffe319ce45222415ac067344987fffd

change_color.sh

@@ -111,6 +111,7 @@ HDR_BG=${HDR_BG-$MENU_BG}

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            HDR_FG=${HDR_FG-$MENU_FG}
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            MATERIA_VIEW=${MATERIA_VIEW-$TXT_BG}
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            MATERIA_SURFACE=${MATERIA_SURFACE-$BTN_BG}
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        GNOME_SHELL_PANEL_OPACITY=${GNOME_SHELL_PANEL_OPACITY-0.6}
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            MATERIA_PANEL_OPACITY=${MATERIA_PANEL_OPACITY-$GNOME_SHELL_PANEL_OPACITY}
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            MATERIA_STYLE_COMPACT=$(tr '[:upper:]' '[:lower:]' <<< "${MATERIA_STYLE_COMPACT-True}")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -121,6 +122,7 @@ ROUNDNESS=${ROUNDNESS-2}

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            # shellcheck disable=SC2034 # will this be used in the future?
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            ROUNDNESS_GTK2_HIDPI=$(( ROUNDNESS * 2 ))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            MATERIA_PANEL_OPACITY=${MATERIA_PANEL_OPACITY-0.6}
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        MATERIA_SELECTION_OPACITY=${MATERIA_SELECTION_OPACITY-0.32}
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            INACTIVE_FG=$(mix "$FG" "$BG" 0.75)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            INACTIVE_MATERIA_VIEW=$(mix "$MATERIA_VIEW" "$BG" 0.60)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

render-assets.sh

@@ -7,8 +7,7 @@ if [[ ! "$(which inkscape 2> /dev/null || which rendersvg 2> /dev/null)" ]]; the

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            fi
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            if [[ ! "$(which optipng 2> /dev/null)" ]]; then
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          echo "'optipng' needs to be installed to generate the PNG."
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          exit 1
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          echo "'optipng' needs to be installed to optimize the resulting PNG!"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            fi
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            chrome() (
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

src/chrome/render-asset.sh

@@ -2,8 +2,8 @@

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            set -ueo pipefail
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            RENDER_SVG="$(command -v rendersvg)" || true
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        INKSCAPE="$(command -v inkscape)"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        OPTIPNG="$(command -v optipng)"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        INKSCAPE="$(command -v inkscape)" || true
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        OPTIPNG="$(command -v optipng)" || true
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            i="$1"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -14,4 +14,6 @@ else

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              "$INKSCAPE" --export-dpi=96 --export-png="$i.png" "$i.svg" >/dev/null
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            fi
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        "$OPTIPNG" -o7 --quiet "$i.png"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        if [[ -n "${OPTIPNG}" ]] ; then
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        	"$OPTIPNG" -o7 --quiet "$i.png"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        fi
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

src/gtk-2.0/render-asset.sh

@@ -2,8 +2,8 @@

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            set -ueo pipefail
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            RENDER_SVG="$(command -v rendersvg)" || true
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        INKSCAPE="$(command -v inkscape)"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        OPTIPNG="$(command -v optipng)"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        INKSCAPE="$(command -v inkscape)" || true
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        OPTIPNG="$(command -v optipng)" || true
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            if [[ "$1" == "dark" ]]; then
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              SRC_FILE="assets-dark.svg"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -39,4 +39,6 @@ else

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    --export-png="$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            fi
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        "$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i.png"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        if [[ -n "${OPTIPNG}" ]] ; then
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        	"$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i.png"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        fi
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

src/gtk/render-asset.sh

@@ -2,8 +2,8 @@

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            set -ueo pipefail
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            RENDER_SVG="$(command -v rendersvg)" || true
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        INKSCAPE="$(command -v inkscape)"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        OPTIPNG="$(command -v optipng)"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        INKSCAPE="$(command -v inkscape)" || true
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        OPTIPNG="$(command -v optipng)" || true
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            SRC_FILE="assets.svg"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            ASSETS_DIR="assets"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -19,7 +19,9 @@ else

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    --export-id-only \
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    --export-png="$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            fi
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        "$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i.png"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        if [[ -n "${OPTIPNG}" ]] ; then
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        	"$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i.png"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        fi
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            echo "Rendering '$ASSETS_DIR/$i@2.png'"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            if [[ -n "${RENDER_SVG}" ]] ; then
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -34,4 +36,6 @@ else

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    --export-dpi=192 \
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    --export-png="$ASSETS_DIR/$i@2.png" "$SRC_FILE" >/dev/null
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            fi
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        "$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i@2.png"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        if [[ -n "${OPTIPNG}" ]] ; then
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        	"$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i@2.png"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        fi