From 3a981257de1c70dd8582eb8ddd9616b547a1cfca Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 8 Nov 2021 09:55:16 +0100 Subject: [PATCH] [simple theme] create favicon.png from src/svg/searxng-wordmark.svg new bash function convert_if_newer() / usage:: convert_if_newer [, ...] convert_if_newer "path/to/origin.svg" "path/to/converted.png" -transparent white -resize 64x64 Run's ImageMagik' convert comand to generate from , if is newer than . The command line is to convert is:: convert [, ...] PNG 'searx/static/themes/simple/img/favicon.png' has been created by:: $ make themes.simple CONVERT searx/static/themes/simple/src/svg/searxng-wordmark.svg -transparent white -resize 64x64 searx/static/themes/simple/img/favicon.png ... Signed-off-by: Markus Heiser --- manage | 38 +++++++++++++++++++-- searx/static/themes/simple/img/favicon.png | Bin 1474 -> 4734 bytes utils/lib_static.sh | 1 + 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/manage b/manage index daa7171da..07761e76c 100755 --- a/manage +++ b/manage @@ -692,11 +692,45 @@ themes.oscar() { } themes.simple() { - build_msg GRUNT "theme: simple" - npm --prefix searx/static/themes/simple run build + local src="searx/static/themes/simple/src" + local static="searx/static/themes/simple" + ( set -e + convert_if_newer "$src/svg/searxng-wordmark.svg" "$static/img/favicon.png" \ + -transparent white -resize 64x64 + build_msg GRUNT "theme: simple" + npm --prefix searx/static/themes/simple run build + ) dump_return $? } +convert_if_newer() { + + # usage: convert_if_newer [, ...] + # + # convert_if_newer "path/to/origin.svg" "path/to/converted.png" -resize 100x100 + # + # Run's ImageMagik' convert comand to generate from , if + # is newer than . The command line is to convert is:: + # + # convert [, ...] + + local src_file="$1" && shift + local dst_file="$1" && shift + + if [[ "${src_file}" -nt "${dst_file}" ]]; then + if ! required_commands convert; then + info_msg "to install build tools use::" + info_msg " sudo -H ./utils/searx.sh install buildhost" + die 1 "install needed build tools first" + fi + build_msg CONVERT "${src_file}" "$@" "${dst_file}" + convert "${src_file}" "$@" "${dst_file}" + else + build_msg CONVERT "${dst_file} (up-to-date)" + fi +} + + PYLINT_FILES=() while IFS= read -r line; do PYLINT_FILES+=("$line") diff --git a/searx/static/themes/simple/img/favicon.png b/searx/static/themes/simple/img/favicon.png index 36be5fc01a877d35009829d8e4d4248b9073b425..409ede8ab0c8fd1a3c7e7516252afd84e1d37849 100644 GIT binary patch literal 4734 zcmZ`-Ra6_!(+%!k+?^r~F2REZcP*~PEoiY4D5baumm)=q1u0H|LMc*#Qrsap6sOpq z-{bf2ot@cx_U_)Dm)SGB8?UFMMubm?4*&p&)FH|SPpI&p<6=McHLkwPPk`y7sI3S9 zG^G&S*L zWx(Tqt)!zwF^*W;J{)jeS zCwhV_)oF8Zr4*ErxaP+?pQ;cxPQ}qf^*Vx#Gp&>+j;LI`l3QE>l0I#|w~$0^ezL8j zXeM!vr+(gP`PH*EVA15Inr=cCO9oz{Dy)hW(j2qoQEK_AQlpl2MMbGOM;i4S(>G#| z=G6aGXhnKmUTIj{{hn3*2N3_uKhKy-EBi2W&Wyy1Au;$#n?>3|SqQyvA)C5en2|%L0h zdcc%fz3Pt3kb8Ek-F+krM>}IhLr@LoKIXTCJE3e5`mm)J!T-eG?I)qyT|(CVSanTJ zD4bhcm)6?SOZ6Sj{7{a;xb&4N4v{8I*-}$o*)b*+k^W#oXVLDq_=WErh|UtY5SPgN zNuO>p;d4-p5^OfYg@K;8wxjcOw4S|GW%T%%LM9k^I?%dUTrm2tS!3Yv(k9RnH-hZb zs85UObJia@-d_6?We0p5k4Mkn5gvxIWlma0yjJy5lb=rM=~v3BZ!8^t=k5O1=C}on z9gE&&5I^VjVa9E+++@S8eZwA6+BBc{9c}V!li8XEnL{E`w=92hY+7jn&vWYQ(0~_s z6Xo|ChR6-Ww4&hnIr9*Y`uZ=eoG8X*o@XWgrIx4xsUQsbod6D6=(Fj3o*sCDuPy(w zn5s-t!1>4eiiXjF#(7W~z1FM4K$NoNrY1S`jJq~Sm#N$0+f^YWo&*Gx!B0a&K=4O+ zlb=)LUmSHJ9 zTRooWfcsrqpm58d$CYm$b3OO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QS~vv8%3hyd(x_-0`JU^X z+FY$^BlEmvx^inDEZ=D^v8&0Wb`*x}-H!?))Q)H9HPK*`QtohTn#Q`q+%%s-kmroV zXFpU&11$?T##%DXOV+gZtLsxzmmt{MVB4E}eOX=Sok*z1RDDuBHmnzK=29}~8l-c^ zebe8U18=yMZ*=jI=4U%$rs9V<;9}QK-Se^vpHe35u(4L5peG*dHYYy}7(>SySodGT{75wHkIZ(z(rNYq zN)9lPIoWNC(kdlB_N5hbx+~+;(-fMiYc)i>pWT7CH@12%wz{Va0W(V_T3SxBKCq4n z3S%**rt-V2i>oD~XMSPzmO>(}0j09>RzN?`r~)Y0^FY$RBLy0Qfp);Fh7@(JJfN=S83X-Jru#Tpg10p2TB5dI)%7}vTnkBI zsK&!B5Y#{_XkfdYVpW^2rcj0#quD#kY@uRoOK9-KIO5N4{%+a;mzl-~k=Jx0$OzRF zN)R?vMn|Fh<)UL}L8j$8rHAn;T(EQriwk9iMVJM-_* za%snz;E2d0k!x3#*J9gIh#7}RovLnXk^W0#NE~5?rhAGVcX<%@UR{~WSBreb(PA}Y zS$_}Va>rE^)2M;lIan6;ig7m9LGr?g5$*kL#DfItbl>_tY&X+5yDqmZXEQxeD4^k9 zTOQ>npl~xQhIS7+fT^ZGBnX$1A+FJHem%~pNa20tpB@Y$%=dIlrhI#Zcsqh^qYWwT EAM+NDdH?_b diff --git a/utils/lib_static.sh b/utils/lib_static.sh index b88b9b6cf..35fdbd7de 100755 --- a/utils/lib_static.sh +++ b/utils/lib_static.sh @@ -11,6 +11,7 @@ STATIC_BUILT_PATHS=( searx/static/themes/simple/css searx/static/themes/simple/js searx/static/themes/simple/src/generated/pygments.less + searx/static/themes/simple/img/favicon.png searx/templates/__common__/searxng-wordmark.min.svg )