github.com/google/capslock@v0.2.3-0.20240517042941-dac19fc347c0/docs/mkbitmaps.sh (about) 1 #!/bin/sh 2 3 # Copyright 2023 Google LLC 4 # 5 # Use of this source code is governed by a BSD-style 6 # license that can be found in the LICENSE file or at 7 # https://developers.google.com/open-source/licenses/bsd 8 9 # This is a convenience script to convert our vector logo images to bitmaps 10 # in the sizes that we are about. 11 12 if ! type rsvg-convert >/dev/null 2>&1 ; then 13 echo "Missing rsvg-convert" 1>&2 14 test -x /usr/bin/apt && echo "Try: sudo apt install librsvg2-bin" 1>&2 15 exit 1 16 fi 17 18 set -e 19 20 # Banner image 21 rsvg-convert --format=png --width=1024 \ 22 -o capslock-banner.png capslock-banner.svg 23 echo "Rendered capslock-banner.png" 24 25 # Logo to icons; add sizes as required. 26 for w in 256 64 ; do 27 rsvg-convert --format=png --width=$w \ 28 -o capslock-logo${w}.png capslock-logo.svg 29 echo "Rendered capslock-logo${w}.png" 30 done