Skip to content

Commit

Permalink
fix: size on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
daiyam committed Apr 13, 2023
1 parent 8f7acfc commit d926d66
Show file tree
Hide file tree
Showing 174 changed files with 68 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.goutputstream-*
icon*.png
icon*.svg
72 changes: 53 additions & 19 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ set -e
check_programs "icns2png" "composite" "convert" "png2icns" "icotool" "rsvg-convert" "bc" "pastel"

build_icon() { # {{{
echo "- ${ICON_NAME}/${BG_NAME}/${COLOR_NAME}: ${BG_COLOR_SET}"

# echo "COLOR_PRIMARY: ${COLOR_PRIMARY}"
# echo "COLOR_MEDIAN1: ${COLOR_MEDIAN1}"
# echo "COLOR_MEDIAN2: ${COLOR_MEDIAN2}"
# echo "COLOR_FLOOR: ${COLOR_FLOOR}"

convert -size 2048x2048 canvas:transparent PNG32:"icon.png"

if [ ! -z "${BG_FILENAME}" ]; then
Expand All @@ -34,10 +41,10 @@ build_icon() { # {{{

rsvg-convert -w "${BG_ICON_SIZE}" -h "${BG_ICON_SIZE}" "icon_head.svg" -o "icon_head.png"

# echo "${BG_ICON_TOP};${BG_SHIFT_ICON};${ICON_SHIFT_LEFT}"
# echo "${BG_ICON_TOP};${BG_ICON_SHIFT};${ICON_SHIFT_LEFT}"

if [ ! -z "${BG_ICON_TOP}" ]; then
if [ "${BG_SHIFT_ICON}" == "on" ] && [ ! -z "${ICON_SHIFT_LEFT}" ]; then
if [ "${BG_ICON_SHIFT}" == "on" ] && [ ! -z "${ICON_SHIFT_LEFT}" ]; then
LEFT="$( bc <<< "${ICON_SHIFT_LEFT} + ${BG_ICON_LEFT}" )"

# echo "${LEFT}"
Expand All @@ -49,30 +56,63 @@ build_icon() { # {{{
else
composite "icon_head.png" -gravity center -background none -colorspace sRGB "icon.png" "icon.png"
fi

BUILT="yes"
} # }}}

build_darwin() { # {{{
mkdir -p "./icons/darwin/${BG_NAME}/${COLOR_NAME}/"
if [ ! -f "./icons/darwin/${BG_NAME}/${COLOR_NAME}/${ICON_NAME}.icns" ]; then
if [ "${BUILT}" == "no" ]; then
build_icon
fi

mkdir -p "./icons/darwin/${BG_NAME}/${COLOR_NAME}/"

composite \( "icon.png" -resize 884x884 \) -gravity center -background none \( -size 1024x1024 canvas:transparent \) "icon_1024.png"
composite \( "icon.png" -resize 884x884 \) -gravity center -background none \( -size 1024x1024 canvas:transparent \) "icon_1024.png"

convert "icon_1024.png" -resize 512x512 icon_512.png
convert "icon_1024.png" -resize 256x256 icon_256.png
convert "icon_1024.png" -resize 128x128 icon_128.png
convert "icon_1024.png" -resize 512x512 icon_512.png
convert "icon_1024.png" -resize 256x256 icon_256.png
convert "icon_1024.png" -resize 128x128 icon_128.png

png2icns "./icons/darwin/${BG_NAME}/${COLOR_NAME}/${ICON_NAME}.icns" icon_512.png icon_256.png icon_128.png > /dev/null
png2icns "./icons/darwin/${BG_NAME}/${COLOR_NAME}/${ICON_NAME}.icns" icon_512.png icon_256.png icon_128.png > /dev/null
fi
} # }}}

build_linux() { # {{{
mkdir -p "./icons/linux/${BG_NAME}/${COLOR_NAME}/"
if [ ! -f "./icons/linux/${BG_NAME}/${COLOR_NAME}/${ICON_NAME}.png" ]; then
if [ "${BUILT}" == "no" ]; then
build_icon
fi

mkdir -p "./icons/linux/${BG_NAME}/${COLOR_NAME}/"

if [ -z "${BG_LINUX_SIZE}" ]; then
BG_LINUX_SIZE="952"
fi

composite \( "icon.png" -resize 846x846 \) -gravity center -background none \( -size 1024x1024 canvas:transparent \) "./icons/linux/${BG_NAME}/${COLOR_NAME}/${ICON_NAME}.png"
if [ -z "${BG_LINUX_TOP}" ]; then
composite \( "icon.png" -resize "${BG_LINUX_SIZE}x${BG_LINUX_SIZE}" \) -gravity center -background none \( -size 1024x1024 canvas:transparent \) "./icons/linux/${BG_NAME}/${COLOR_NAME}/${ICON_NAME}.png"
else
LEFT="$( bc <<< "(1024 - ${BG_LINUX_SIZE}) / 2" )"
TOP="$( bc <<< "${LEFT} + ${BG_LINUX_TOP}" )"

# echo "+${LEFT}+${TOP}"

composite \( "icon.png" -resize "${BG_LINUX_SIZE}x${BG_LINUX_SIZE}" \) -geometry "+${LEFT}+${TOP}" -background none \( -size 1024x1024 canvas:transparent \) "./icons/linux/${BG_NAME}/${COLOR_NAME}/${ICON_NAME}.png"
fi
fi
} # }}}

build_win32() { # {{{
mkdir -p "./icons/win32/${BG_NAME}/${COLOR_NAME}/"
if [ ! -f "./icons/win32/${BG_NAME}/${COLOR_NAME}/${ICON_NAME}.ico" ]; then
if [ "${BUILT}" == "no" ]; then
build_icon
fi

mkdir -p "./icons/win32/${BG_NAME}/${COLOR_NAME}/"

convert "icon.png" -define icon:auto-resize=256,128,96,64,48,32,24,20,16 "./icons/win32/${BG_NAME}/${COLOR_NAME}/${ICON_NAME}.ico"
convert "icon.png" -define icon:auto-resize=256,128,96,64,48,32,24,20,16 "./icons/win32/${BG_NAME}/${COLOR_NAME}/${ICON_NAME}.ico"
fi
} # }}}

for ICON_PATH in "./templates/icons/"*
Expand All @@ -96,8 +136,6 @@ do
COLOR_NAME="${COLOR_PATH/*\//}"
COLOR_NAME="${COLOR_NAME%.*}"

echo "- ${ICON_NAME}/${BG_NAME}/${COLOR_NAME}: ${BG_COLOR_SET}"

if [ "${BG_COLOR_SET}" == "light" ]; then
source "${COLOR_PATH}/normal.conf"

Expand All @@ -109,12 +147,8 @@ do
source "${COLOR_PATH}/${BG_COLOR_SET}.conf"
fi

# echo "COLOR_PRIMARY: ${COLOR_PRIMARY}"
# echo "COLOR_MEDIAN1: ${COLOR_MEDIAN1}"
# echo "COLOR_MEDIAN2: ${COLOR_MEDIAN2}"
# echo "COLOR_FLOOR: ${COLOR_FLOOR}"
BUILT="no"

build_icon
build_darwin
build_linux
build_win32
Expand Down
Binary file modified icons/linux/circle1/blue1/cristiano20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/blue1/daiyam22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/blue1/jared18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/blue1/paulo22d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/blue1/paulo22s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/blue1/zolt20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/brown1/cristiano20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/brown1/daiyam22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/brown1/jared18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/brown1/paulo22d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/brown1/paulo22s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/brown1/zolt20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/green1/cristiano20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/green1/daiyam22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/green1/jared18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/green1/paulo22d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/green1/paulo22s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/green1/zolt20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/orange1/cristiano20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/orange1/daiyam22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/orange1/jared18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/orange1/paulo22d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/orange1/paulo22s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/orange1/zolt20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/purple1/cristiano20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/linux/circle1/purple1/daiyam22.png
Binary file modified icons/linux/circle1/purple1/jared18.png
Binary file modified icons/linux/circle1/purple1/paulo22d.png
Binary file modified icons/linux/circle1/purple1/paulo22s.png
Binary file modified icons/linux/circle1/purple1/zolt20.png
Binary file modified icons/linux/circle1/red1/cristiano20.png
Binary file modified icons/linux/circle1/red1/daiyam22.png
Binary file modified icons/linux/circle1/red1/jared18.png
Binary file modified icons/linux/circle1/red1/paulo22d.png
Binary file modified icons/linux/circle1/red1/paulo22s.png
Binary file modified icons/linux/circle1/red1/zolt20.png
Binary file modified icons/linux/circle1/yellow1/cristiano20.png
Binary file modified icons/linux/circle1/yellow1/daiyam22.png
Binary file modified icons/linux/circle1/yellow1/jared18.png
Binary file modified icons/linux/circle1/yellow1/paulo22d.png
Binary file modified icons/linux/circle1/yellow1/paulo22s.png
Binary file modified icons/linux/circle1/yellow1/zolt20.png
Binary file modified icons/linux/macos1/blue1/cristiano20.png
Binary file modified icons/linux/macos1/blue1/daiyam22.png
Binary file modified icons/linux/macos1/blue1/jared18.png
Binary file modified icons/linux/macos1/blue1/paulo22d.png
Binary file modified icons/linux/macos1/blue1/paulo22s.png
Binary file modified icons/linux/macos1/blue1/zolt20.png
Binary file modified icons/linux/macos1/brown1/cristiano20.png
Binary file modified icons/linux/macos1/brown1/daiyam22.png
Binary file modified icons/linux/macos1/brown1/jared18.png
Binary file modified icons/linux/macos1/brown1/paulo22d.png
Binary file modified icons/linux/macos1/brown1/paulo22s.png
Binary file modified icons/linux/macos1/brown1/zolt20.png
Binary file modified icons/linux/macos1/green1/cristiano20.png
Binary file modified icons/linux/macos1/green1/daiyam22.png
Binary file modified icons/linux/macos1/green1/jared18.png
Binary file modified icons/linux/macos1/green1/paulo22d.png
Binary file modified icons/linux/macos1/green1/paulo22s.png
Binary file modified icons/linux/macos1/green1/zolt20.png
Binary file modified icons/linux/macos1/orange1/cristiano20.png
Binary file modified icons/linux/macos1/orange1/daiyam22.png
Binary file modified icons/linux/macos1/orange1/jared18.png
Binary file modified icons/linux/macos1/orange1/paulo22d.png
Binary file modified icons/linux/macos1/orange1/paulo22s.png
Binary file modified icons/linux/macos1/orange1/zolt20.png
Binary file modified icons/linux/macos1/purple1/cristiano20.png
Binary file modified icons/linux/macos1/purple1/daiyam22.png
Binary file modified icons/linux/macos1/purple1/jared18.png
Binary file modified icons/linux/macos1/purple1/paulo22d.png
Binary file modified icons/linux/macos1/purple1/paulo22s.png
Binary file modified icons/linux/macos1/purple1/zolt20.png
Binary file modified icons/linux/macos1/red1/cristiano20.png
Binary file modified icons/linux/macos1/red1/daiyam22.png
Binary file modified icons/linux/macos1/red1/jared18.png
Binary file modified icons/linux/macos1/red1/paulo22d.png
Binary file modified icons/linux/macos1/red1/paulo22s.png
Binary file modified icons/linux/macos1/red1/zolt20.png
Binary file modified icons/linux/macos1/yellow1/cristiano20.png
Binary file modified icons/linux/macos1/yellow1/daiyam22.png
Binary file modified icons/linux/macos1/yellow1/jared18.png
Binary file modified icons/linux/macos1/yellow1/paulo22d.png
Binary file modified icons/linux/macos1/yellow1/paulo22s.png
Binary file modified icons/linux/macos1/yellow1/zolt20.png
Binary file modified icons/linux/nobg/blue1/cristiano20.png
Binary file modified icons/linux/nobg/blue1/daiyam22.png
Binary file modified icons/linux/nobg/blue1/jared18.png
Binary file modified icons/linux/nobg/blue1/paulo22d.png
Binary file modified icons/linux/nobg/blue1/paulo22s.png
Binary file modified icons/linux/nobg/blue1/zolt20.png
Binary file modified icons/linux/nobg/brown1/cristiano20.png
Binary file modified icons/linux/nobg/brown1/daiyam22.png
Binary file modified icons/linux/nobg/brown1/jared18.png
Binary file modified icons/linux/nobg/brown1/paulo22d.png
Binary file modified icons/linux/nobg/brown1/paulo22s.png
Binary file modified icons/linux/nobg/brown1/zolt20.png
Binary file modified icons/linux/nobg/green1/cristiano20.png
Binary file modified icons/linux/nobg/green1/daiyam22.png
Binary file modified icons/linux/nobg/green1/jared18.png
Binary file modified icons/linux/nobg/green1/paulo22d.png
Binary file modified icons/linux/nobg/green1/paulo22s.png
Binary file modified icons/linux/nobg/green1/zolt20.png
Binary file modified icons/linux/nobg/orange1/cristiano20.png
Binary file modified icons/linux/nobg/orange1/daiyam22.png
Binary file modified icons/linux/nobg/orange1/jared18.png
Binary file modified icons/linux/nobg/orange1/paulo22d.png
Binary file modified icons/linux/nobg/orange1/paulo22s.png
Binary file modified icons/linux/nobg/orange1/zolt20.png
Binary file modified icons/linux/nobg/purple1/cristiano20.png
Binary file modified icons/linux/nobg/purple1/daiyam22.png
Binary file modified icons/linux/nobg/purple1/jared18.png
Binary file modified icons/linux/nobg/purple1/paulo22d.png
Binary file modified icons/linux/nobg/purple1/paulo22s.png
Binary file modified icons/linux/nobg/purple1/zolt20.png
Binary file modified icons/linux/nobg/red1/cristiano20.png
Binary file modified icons/linux/nobg/red1/daiyam22.png
Binary file modified icons/linux/nobg/red1/jared18.png
Binary file modified icons/linux/nobg/red1/paulo22d.png
Binary file modified icons/linux/nobg/red1/paulo22s.png
Binary file modified icons/linux/nobg/red1/zolt20.png
Binary file modified icons/linux/nobg/yellow1/cristiano20.png
Binary file modified icons/linux/nobg/yellow1/daiyam22.png
Binary file modified icons/linux/nobg/yellow1/jared18.png
Binary file modified icons/linux/nobg/yellow1/paulo22d.png
Binary file modified icons/linux/nobg/yellow1/paulo22s.png
Binary file modified icons/linux/nobg/yellow1/zolt20.png
Binary file modified icons/linux/rect1/blue1/cristiano20.png
Binary file modified icons/linux/rect1/blue1/daiyam22.png
Binary file modified icons/linux/rect1/blue1/jared18.png
Binary file modified icons/linux/rect1/blue1/paulo22d.png
Binary file modified icons/linux/rect1/blue1/paulo22s.png
Binary file modified icons/linux/rect1/blue1/zolt20.png
Binary file modified icons/linux/rect1/brown1/cristiano20.png
Binary file modified icons/linux/rect1/brown1/daiyam22.png
Binary file modified icons/linux/rect1/brown1/jared18.png
Binary file modified icons/linux/rect1/brown1/paulo22d.png
Binary file modified icons/linux/rect1/brown1/paulo22s.png
Binary file modified icons/linux/rect1/brown1/zolt20.png
Binary file modified icons/linux/rect1/green1/cristiano20.png
Binary file modified icons/linux/rect1/green1/daiyam22.png
Binary file modified icons/linux/rect1/green1/jared18.png
Binary file modified icons/linux/rect1/green1/paulo22d.png
Binary file modified icons/linux/rect1/green1/paulo22s.png
Binary file modified icons/linux/rect1/green1/zolt20.png
Binary file modified icons/linux/rect1/orange1/cristiano20.png
Binary file modified icons/linux/rect1/orange1/daiyam22.png
Binary file modified icons/linux/rect1/orange1/jared18.png
Binary file modified icons/linux/rect1/orange1/paulo22d.png
Binary file modified icons/linux/rect1/orange1/paulo22s.png
Binary file modified icons/linux/rect1/orange1/zolt20.png
Binary file modified icons/linux/rect1/purple1/cristiano20.png
Binary file modified icons/linux/rect1/purple1/daiyam22.png
Binary file modified icons/linux/rect1/purple1/jared18.png
Binary file modified icons/linux/rect1/purple1/paulo22d.png
Binary file modified icons/linux/rect1/purple1/paulo22s.png
Binary file modified icons/linux/rect1/purple1/zolt20.png
Binary file modified icons/linux/rect1/red1/cristiano20.png
Binary file modified icons/linux/rect1/red1/daiyam22.png
Binary file modified icons/linux/rect1/red1/jared18.png
Binary file modified icons/linux/rect1/red1/paulo22d.png
Binary file modified icons/linux/rect1/red1/paulo22s.png
Binary file modified icons/linux/rect1/red1/zolt20.png
Binary file modified icons/linux/rect1/yellow1/cristiano20.png
Binary file modified icons/linux/rect1/yellow1/daiyam22.png
Binary file modified icons/linux/rect1/yellow1/jared18.png
Binary file modified icons/linux/rect1/yellow1/paulo22d.png
Binary file modified icons/linux/rect1/yellow1/paulo22s.png
Binary file modified icons/linux/rect1/yellow1/zolt20.png
4 changes: 3 additions & 1 deletion templates/backgrounds/circle1/main.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ BG_COLOR_SET="normal"
BG_ICON_SIZE="1410"
BG_ICON_TOP="281.706"
BG_ICON_LEFT="319"
BG_SHIFT_ICON="on"
BG_ICON_SHIFT="on"
BG_LINUX_SIZE="988"
BG_LINUX_TOP=""
4 changes: 3 additions & 1 deletion templates/backgrounds/macos1/main.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ BG_COLOR_SET="normal"
BG_ICON_SIZE="1530"
BG_ICON_TOP=""
BG_ICON_LEFT=""
BG_SHIFT_ICON="on"
BG_ICON_SHIFT="on"
BG_LINUX_SIZE="888"
BG_LINUX_TOP="-15"
4 changes: 3 additions & 1 deletion templates/backgrounds/nobg/main.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ BG_COLOR_SET="light"
BG_ICON_SIZE="2048"
BG_ICON_TOP=""
BG_ICON_LEFT=""
BG_SHIFT_ICON="off"
BG_ICON_SHIFT="off"
BG_LINUX_SIZE=""
BG_LINUX_TOP=""
4 changes: 3 additions & 1 deletion templates/backgrounds/rect1/main.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ BG_COLOR_SET="normal"
BG_ICON_SIZE="1410"
BG_ICON_TOP="281.706"
BG_ICON_LEFT="319"
BG_SHIFT_ICON="on"
BG_ICON_SHIFT="on"
BG_LINUX_SIZE="862"
BG_LINUX_TOP=""

0 comments on commit d926d66

Please sign in to comment.