Skip to content

Instantly share code, notes, and snippets.

@Osrepnay
Last active October 7, 2022 02:15
Show Gist options
  • Select an option

  • Save Osrepnay/8ce70e67993952e97cb8cca7d2a49402 to your computer and use it in GitHub Desktop.

Select an option

Save Osrepnay/8ce70e67993952e97cb8cca7d2a49402 to your computer and use it in GitHub Desktop.
gruvbox material theme + patch
./change_color.sh -o Grateria <(echo -e "BG=1d2021\nFG=ebdbb2\nMATERIA_VIEW=32302f\nMATERIA_SURFACE=504945\nHDR_BG=282828\nHDR_FG=282828\nSEL_BG=d79921\n")
find -name '*.sh' | xargs sed -i 's/rendersvg/resvg/g; s/--export-id/--export-area-drawing --export-id/g'
sed '/handle-/d' -i src/gtk-2.0/assets.txt
diff --git a/render-assets.sh b/render-assets.sh
index 3238a08..7f7db0a 100755
--- a/render-assets.sh
+++ b/render-assets.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -ueo pipefail
-if [[ ! "$(command -v inkscape || command -v rendersvg)" ]]; then
+if [[ ! "$(command -v inkscape || command -v resvg)" ]]; then
echo "'inkscape' or 'resvg' needs to be installed to generate the PNG."
exit 1
fi
diff --git a/src/chrome/render-asset.sh b/src/chrome/render-asset.sh
index bf33a8d..6698039 100755
--- a/src/chrome/render-asset.sh
+++ b/src/chrome/render-asset.sh
@@ -5,7 +5,7 @@ FORCE_INKSCAPE="$(echo "${FORCE_INKSCAPE-False}" | tr '[:upper:]' '[:lower:]')"
if [[ "${FORCE_INKSCAPE}" == "true" ]]; then
RENDER_SVG=""
else
- RENDER_SVG="$(command -v rendersvg)" || true
+ RENDER_SVG="$(command -v resvg)" || true
fi
INKSCAPE="$(command -v inkscape)" || true
OPTIPNG="$(command -v optipng)" || true
diff --git a/src/gtk-2.0/assets.txt b/src/gtk-2.0/assets.txt
index f951d5b..656a8ee 100644
--- a/src/gtk-2.0/assets.txt
+++ b/src/gtk-2.0/assets.txt
@@ -97,12 +97,6 @@ scrollbar-vert-rtl-slider-hover
scrollbar-vert-rtl-slider-active
scrollbar-vert-rtl-slider-disabled
scrollbar-vert-rtl-trough
-handle-horz
-handle-horz-hover
-handle-horz-active
-handle-vert
-handle-vert-hover
-handle-vert-active
pan-up
pan-up-disabled
pan-up-alt
diff --git a/src/gtk-2.0/render-asset.sh b/src/gtk-2.0/render-asset.sh
index 095e15f..306b1c1 100755
--- a/src/gtk-2.0/render-asset.sh
+++ b/src/gtk-2.0/render-asset.sh
@@ -1,12 +1,13 @@
#!/usr/bin/env bash
set -ueo pipefail
-FORCE_INKSCAPE="$(echo "${FORCE_INKSCAPE-False}" | tr '[:upper:]' '[:lower:]')"
+FORCE_INKSCAPE="false"
if [[ "${FORCE_INKSCAPE}" == "true" ]]; then
RENDER_SVG=""
else
- RENDER_SVG="$(command -v rendersvg)" || true
+ RENDER_SVG="$(command -v resvg)" || true
fi
+echo "peepeepooopoo ${RENDER_SVG}"
INKSCAPE="$(command -v inkscape)" || true
OPTIPNG="$(command -v optipng)" || true
@@ -43,14 +44,19 @@ fi
echo "Rendering '$ASSETS_DIR/$i.png'"
if [[ -n "${RENDER_SVG}" ]]; then
+ echo "$RENDER_SVG --export-area-drawing --export-area-drawing --export-id $i \
+ --dpi ${DPI} \
+ --zoom ${ZOOM} \
+ $SRC_FILE $ASSETS_DIR/$i.png"
+ pwd
# @TODO: remove --zoom when it will be fixed/implemented in resvg
"$RENDER_SVG" --export-id "$i" \
--dpi ${DPI} \
--zoom ${ZOOM} \
"$SRC_FILE" "$ASSETS_DIR/$i.png"
else
- "$INKSCAPE" --export-id="$i" \
- --export-id-only \
+ "$INKSCAPE" --export-area-drawing --export-area-drawing --export-id="$i" \
+ --export-area-drawing --export-area-drawing --export-id-only \
--export-dpi=${DPI} \
"$EXPORT_FILE_OPTION=$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null
fi
diff --git a/src/gtk-3.0/render-asset.sh b/src/gtk-3.0/render-asset.sh
index 425e890..79644f9 100755
--- a/src/gtk-3.0/render-asset.sh
+++ b/src/gtk-3.0/render-asset.sh
@@ -1,11 +1,11 @@
#!/usr/bin/env bash
set -ueo pipefail
-FORCE_INKSCAPE="$(echo "${FORCE_INKSCAPE-False}" | tr '[:upper:]' '[:lower:]')"
+FORCE_INKSCAPE="false"
if [[ "${FORCE_INKSCAPE}" == "true" ]]; then
RENDER_SVG=""
else
- RENDER_SVG="$(command -v rendersvg)" || true
+ RENDER_SVG="$(command -v resvg)" || true
fi
INKSCAPE="$(command -v inkscape)" || true
OPTIPNG="$(command -v optipng)" || true
@@ -31,8 +31,8 @@ if [[ -n "${RENDER_SVG}" ]]; then
"$RENDER_SVG" --export-id "$i" \
"$SRC_FILE" "$ASSETS_DIR/$i.png"
else
- "$INKSCAPE" --export-id="$i" \
- --export-id-only \
+ "$INKSCAPE" --export-area-drawing --export-area-drawing --export-id="$i" \
+ --export-area-drawing --export-area-drawing --export-id-only \
"$EXPORT_FILE_OPTION=$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null
fi
@@ -49,8 +49,8 @@ if [[ -n "${RENDER_SVG}" ]]; then
--zoom 2 \
"$SRC_FILE" "$ASSETS_DIR/[email protected]"
else
- "$INKSCAPE" --export-id="$i" \
- --export-id-only \
+ "$INKSCAPE" --export-area-drawing --export-area-drawing --export-id="$i" \
+ --export-area-drawing --export-area-drawing --export-id-only \
--export-dpi=192 \
"$EXPORT_FILE_OPTION=$ASSETS_DIR/[email protected]" "$SRC_FILE" >/dev/null
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment