summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrizzlyuser <grizzlyuser@protonmail.com>2020-12-30 21:36:08 +0200
committerbill-auger <mr.j.spam.me@gmail.com>2021-01-11 03:12:12 -0500
commitb5671a575e4a3a2569e8d28d43e02739bc96a0d0 (patch)
tree60249bc247c5ffe1ae7f5459fd1c6e8d4e50f84e
parent80d1b8da61cb18053182a246cceacc3388dcd6cc (diff)
libre/iceweasel: process icons for top sites
Remove bundled icons of all websites except Wikipedia. Generate icons and thumbnails for top sites configured by Parabola from SVG sources from the branding package. They need to be displayed on new tab. If not added, thumbnails will be automatically generated for each website by completely loading it in background and making a screenshot at start of each browser session. This network communication can be unwanted for those on pay-per-byte data plans.
-rw-r--r--libre/iceweasel/PKGBUILD21
1 files changed, 21 insertions, 0 deletions
diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD
index 1f0960d57..84542ba6f 100644
--- a/libre/iceweasel/PKGBUILD
+++ b/libre/iceweasel/PKGBUILD
@@ -286,6 +286,27 @@ END
-o "${brandingdestdir}/default$i.png"
done
+ # process default Top Sites and their icons
+ local tippytopdir=browser/components/newtab/data/content/tippytop
+ find "${tippytopdir}" -type f \
+ -not -name 'wikipedia-org*' \
+ -not -name 'top_sites.json' \
+ -exec rm -v {} \;
+ for image in "${brandingsrcdir}"/tippytop/*.svg; do
+ local outname=$(basename -s .svg "${image}")
+
+ local size=$(identify -format '%wx%h' "${tippytopdir}"/images/wikipedia-org@2x.png)
+ magick -density 300 $image -gravity center -resize $size -extent $size \
+ "${tippytopdir}/images/${outname}@2x.png"
+
+ local background='none'
+ if [[ $outname == 'gnu' ]]; then background='white'; fi
+ size=256x256
+ magick -density 300 -background $background $image -gravity center \
+ -resize $size -extent $size -define icon:auto-resize=64,48,32,16 \
+ "${tippytopdir}/favicons/${outname}.ico"
+ done
+
# apply branding patches
export QUILT_PATCHES="${brandingsrcdir}"/patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'