A fork of the Materia GTK theme.

By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

scripts: Support new command option of Inkscape 1.0

In Inkscape 1.0beta2, the command option "--export-png=foo.png" has been replaced by "--export-file=foo.png".

This commit makes "--export-file" available if "--export-png" is not found in "inkscape --help". There may be a better way though...

https://github.com/nana-4/materia-theme/issues/454

roundabout,
created on Tuesday, 24 December 2019, 23:31:33 (1577230293), received on Sunday, 11 May 2025, 13:22:47 (1746969767)
Author identity: nana-4 <hnmaigo@gmail.com>

e068e80e6e3680d8bef3e5c19423821ded9a9041

src/chrome/render-asset.sh

@@ -5,13 +5,19 @@ RENDER_SVG="$(command -v rendersvg)" || true

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            INKSCAPE="$(command -v inkscape)" || true
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            OPTIPNG="$(command -v optipng)" || true
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        if "$INKSCAPE" --help | grep -e "--export-png" > /dev/null; then
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          EXPORT_FILE_OPTION="--export-png"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        else
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          EXPORT_FILE_OPTION="--export-file"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        fi
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            i="$1"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            echo "Rendering '$i.png'"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            if [[ -n "${RENDER_SVG}" ]]; then
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              "$RENDER_SVG" --dpi 96 "$i.svg" "$i.png"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            else
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          "$INKSCAPE" --export-dpi=96 --export-png="$i.png" "$i.svg" >/dev/null
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          "$INKSCAPE" --export-dpi=96 "$EXPORT_FILE_OPTION"="$i.png" "$i.svg" >/dev/null
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            fi
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            if [[ -n "${OPTIPNG}" ]]; then
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

src/gtk-2.0/render-asset.sh

@@ -5,6 +5,12 @@ RENDER_SVG="$(command -v rendersvg)" || true

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            INKSCAPE="$(command -v inkscape)" || true
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            OPTIPNG="$(command -v optipng)" || true
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        if "$INKSCAPE" --help | grep -e "--export-png" > /dev/null; then
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          EXPORT_FILE_OPTION="--export-png"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        else
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          EXPORT_FILE_OPTION="--export-file"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        fi
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            if [[ "$1" == "dark" ]]; then
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              SRC_FILE="assets-dark.svg"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              ASSETS_DIR="assets-dark"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -36,7 +42,7 @@ else

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              "$INKSCAPE" --export-id="$i" \
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                          --export-id-only \
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                          --export-dpi=${DPI} \
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                      --export-png="$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                      "$EXPORT_FILE_OPTION"="$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            fi
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            if [[ -n "${OPTIPNG}" ]]; then
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

src/gtk/render-asset.sh

@@ -5,6 +5,12 @@ RENDER_SVG="$(command -v rendersvg)" || true

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            INKSCAPE="$(command -v inkscape)" || true
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            OPTIPNG="$(command -v optipng)" || true
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        if "$INKSCAPE" --help | grep -e "--export-png" > /dev/null; then
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          EXPORT_FILE_OPTION="--export-png"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        else
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          EXPORT_FILE_OPTION="--export-file"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        fi
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            SRC_FILE="assets.svg"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            ASSETS_DIR="assets"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -17,7 +23,7 @@ if [[ -n "${RENDER_SVG}" ]]; then

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