Skip to content

Commit

Permalink
breaking-change: partitioned configs into multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
ful1e5 committed Jun 13, 2024
1 parent afb25d6 commit 4460d91
Show file tree
Hide file tree
Showing 9 changed files with 1,616 additions and 23 deletions.
47 changes: 24 additions & 23 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ error() (
"$@" 2> >(sed $'s,.*,\e[31m&\e[m,' >&2)
)

get_config_file() {
get_config_path() {
local key="${1}"
local cfg_file="build.toml"
local cfg_path="configs"

if [[ $key == *"Right"* ]]; then
cfg_file="build.right.toml"
cfg_path="${cfg_path}/right"
else
cfg_path="${cfg_path}/normal"
fi

echo $cfg_file
echo $cfg_path
}

with_version() {
Expand All @@ -30,41 +32,40 @@ if ! type -p ctgen >/dev/null; then
fi

declare -A names
names["Bibata-Modern-Amber"]=$(with_version "Yellowish and rounded edge Bibata cursors")
names["Bibata-Modern-Amber-Right"]=$(with_version "Yellowish and rounded edge right-hand Bibata cursors")
names["Bibata-Modern-Classic"]=$(with_version "Black and rounded edge Bibata cursors")
names["Bibata-Modern-Classic-Right"]=$(with_version "Black and rounded edge right-hand Bibata cursors")
names["Bibata-Modern-Ice"]=$(with_version "White and rounded edge Bibata cursors")
names["Bibata-Modern-Ice-Right"]=$(with_version "White and rounded edge right-hand Bibata cursors")
names["Bibata-Original-Amber"]=$(with_version "Yellowish and sharp edge Bibata cursors")
names["Bibata-Original-Amber-Right"]=$(with_version "Yellowish and sharp edge right-hand Bibata cursors")
names["Bibata-Original-Classic"]=$(with_version "Black and sharp edge Bibata cursors")
names["Bibata-Original-Classic-Right"]=$(with_version "Black and sharp edge right-hand Bibata cursors")
names["Bibata-Original-Ice"]=$(with_version "White and sharp edge Bibata cursors")
names["Bibata-Original-Ice-Right"]=$(with_version "White and sharp edge right-hand Bibata cursors")
names["Bibata-Modern-Amber"]=$(with_version "Yellowish and rounded edge Bibata")
names["Bibata-Modern-Amber-Right"]=$(with_version "Yellowish and rounded edge right-hand Bibata")
names["Bibata-Modern-Classic"]=$(with_version "Black and rounded edge Bibata")
names["Bibata-Modern-Classic-Right"]=$(with_version "Black and rounded edge right-hand Bibata")
names["Bibata-Modern-Ice"]=$(with_version "White and rounded edge Bibata")
names["Bibata-Modern-Ice-Right"]=$(with_version "White and rounded edge right-hand Bibata")
names["Bibata-Original-Amber"]=$(with_version "Yellowish and sharp edge Bibata")
names["Bibata-Original-Amber-Right"]=$(with_version "Yellowish and sharp edge right-hand Bibata")
names["Bibata-Original-Classic"]=$(with_version "Black and sharp edge Bibata")
names["Bibata-Original-Classic-Right"]=$(with_version "Black and sharp edge right-hand Bibata")
names["Bibata-Original-Ice"]=$(with_version "White and sharp edge Bibata")
names["Bibata-Original-Ice-Right"]=$(with_version "White and sharp edge right-hand Bibata")

# Cleanup old builds
rm -rf themes bin

# Building Bibata XCursor binaries
for key in "${!names[@]}"; do
comment="${names[$key]}"
cfg=$(get_config_file key)
cfg_path=$(get_config_path "$key")

ctgen "$cfg" -p x11 -d "bitmaps/$key" -n "$key" -c "$comment" &
ctgen "$cfg_path/x.build.toml" -p x11 -d "bitmaps/$key" -n "$key" -c "$comment XCursors" &
PID=$!
wait $PID
done

# Building Bibata Windows binaries
for key in "${!names[@]}"; do
comment="${names[$key]}"
cfg=$(get_config_file key)
cfg_path=$(get_config_path "$key")

ctgen "$cfg" -p windows -s 16 -d "bitmaps/$key" -n "$key-Small" -c "$comment" &
ctgen "$cfg" -p windows -s 24 -d "bitmaps/$key" -n "$key-Regular" -c "$comment" &
ctgen "$cfg" -p windows -s 32 -d "bitmaps/$key" -n "$key-Large" -c "$comment" &
ctgen "$cfg" -p windows -s 48 -d "bitmaps/$key" -n "$key-Extra-Large" -c "$comment" &
ctgen "$cfg_path/win_rg.build.toml" -d "bitmaps/$key" -n "$key-Regular" -c "$comment Windows Cursors" &
ctgen "$cfg_path/win_lg.build.toml" -d "bitmaps/$key" -n "$key-Large" -c "$comment Windows Cursors" &
ctgen "$cfg_path/win_xl.build.toml" -d "bitmaps/$key" -n "$key-Extra-Large" -c "$comment Windows Cursors" &
PID=$!
wait $PID
done
Expand Down
128 changes: 128 additions & 0 deletions configs/normal/win_lg.build.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
[theme]
name = 'Bibata Large Windows Cursor'
comment = 'Bibata is open source, compact, and material designed cursor set.'
website = 'https://www.bibata.live'

[config]
bitmaps_dir = '' # This config will assigned with `ctgen -d <path>`
out_dir = '../../themes'
platforms = 'windows'

[cursors]
[cursors.fallback_settings]
win_sizes = ["26:32", "39:48", "52:64", "77:96", "103:128"]
x_hotspot = 128
y_hotspot = 128
win_delay = 1

[cursors.bd_double_arrow]
png = 'bd_double_arrow.png'
win_name = 'Dgn1'

[cursors.circle]
png = 'circle.png'
x_hotspot = 55
y_hotspot = 17
win_name = 'Unavailable'

[cursors.crosshair]
png = 'crosshair.png'
win_name = 'Cross'

[cursors.fd_double_arrow]
png = 'fd_double_arrow.png'
win_name = 'Dgn2'

[cursors.grabbing]
png = 'grabbing.png'
x_hotspot = 128
y_hotspot = 66
win_name = 'Grabbing'

[cursors.hand1]
png = 'hand1.png'
x_hotspot = 144
y_hotspot = 79
win_name = 'Pan'

[cursors.hand2]
png = 'hand2.png'
x_hotspot = 114
y_hotspot = 18
win_name = 'Link'

[cursors.left_ptr]
png = 'left_ptr.png'
x_hotspot = 55
y_hotspot = 17
win_name = 'Pointer'

[cursors.left_ptr_watch]
png = 'left_ptr_watch-*.png'
win_sizes = "78:96"
x_hotspot = 55
y_hotspot = 17
win_name = 'Work'

[cursors.move]
png = 'move.png'
win_name = 'Move'

[cursors.pencil]
png = 'pencil.png'
x_hotspot = 46
y_hotspot = 211
win_name = 'Handwriting'

[cursors.question_arrow]
png = 'question_arrow.png'
x_hotspot = 42
y_hotspot = 86
win_name = 'Help'

[cursors.right_ptr]
png = 'right_ptr.png'
x_hotspot = 204
y_hotspot = 17
win_name = 'Alternate'

[cursors.sb_h_double_arrow]
png = 'sb_h_double_arrow.png'
win_name = 'Horz'

[cursors.sb_v_double_arrow]
png = 'sb_v_double_arrow.png'
win_name = 'Vert'

[cursors.wait]
png = 'wait-*.png'
win_sizes = "78:96"
win_name = 'Busy'

[cursors.xterm]
png = 'xterm.png'
win_name = 'Text'

[cursors.zoom_in]
png = 'zoom-in.png'
x_hotspot = 116
y_hotspot = 116
win_name = 'Zoom-in'

[cursors.zoom_out]
png = 'zoom-out.png'
x_hotspot = 116
y_hotspot = 116
win_name = 'Zoom-out'

[cursors.person]
png = 'person.png'
x_hotspot = 55
y_hotspot = 17
win_name = 'Person'

[cursors.pin]
png = 'pin.png'
x_hotspot = 55
y_hotspot = 17
win_name = 'Pin'
128 changes: 128 additions & 0 deletions configs/normal/win_rg.build.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
[theme]
name = 'Bibata Regular Windows Cursor'
comment = 'Bibata is open source, compact, and material designed cursor set.'
website = 'https://www.bibata.live'

[config]
bitmaps_dir = '' # This config will assigned with `ctgen -d <path>`
out_dir = '../../themes'
platforms = 'windows'

[cursors]
[cursors.fallback_settings]
win_sizes = ["22:32", "32:48", "43:64", "64:96", "86:128"]
x_hotspot = 128
y_hotspot = 128
win_delay = 1

[cursors.bd_double_arrow]
png = 'bd_double_arrow.png'
win_name = 'Dgn1'

[cursors.circle]
png = 'circle.png'
x_hotspot = 55
y_hotspot = 17
win_name = 'Unavailable'

[cursors.crosshair]
png = 'crosshair.png'
win_name = 'Cross'

[cursors.fd_double_arrow]
png = 'fd_double_arrow.png'
win_name = 'Dgn2'

[cursors.grabbing]
png = 'grabbing.png'
x_hotspot = 128
y_hotspot = 66
win_name = 'Grabbing'

[cursors.hand1]
png = 'hand1.png'
x_hotspot = 144
y_hotspot = 79
win_name = 'Pan'

[cursors.hand2]
png = 'hand2.png'
x_hotspot = 114
y_hotspot = 18
win_name = 'Link'

[cursors.left_ptr]
png = 'left_ptr.png'
x_hotspot = 55
y_hotspot = 17
win_name = 'Pointer'

[cursors.left_ptr_watch]
png = 'left_ptr_watch-*.png'
win_sizes = "64:96"
x_hotspot = 55
y_hotspot = 17
win_name = 'Work'

[cursors.move]
png = 'move.png'
win_name = 'Move'

[cursors.pencil]
png = 'pencil.png'
x_hotspot = 46
y_hotspot = 211
win_name = 'Handwriting'

[cursors.question_arrow]
png = 'question_arrow.png'
x_hotspot = 42
y_hotspot = 86
win_name = 'Help'

[cursors.right_ptr]
png = 'right_ptr.png'
x_hotspot = 204
y_hotspot = 17
win_name = 'Alternate'

[cursors.sb_h_double_arrow]
png = 'sb_h_double_arrow.png'
win_name = 'Horz'

[cursors.sb_v_double_arrow]
png = 'sb_v_double_arrow.png'
win_name = 'Vert'

[cursors.wait]
png = 'wait-*.png'
win_sizes = "64:96"
win_name = 'Busy'

[cursors.xterm]
png = 'xterm.png'
win_name = 'Text'

[cursors.zoom_in]
png = 'zoom-in.png'
x_hotspot = 116
y_hotspot = 116
win_name = 'Zoom-in'

[cursors.zoom_out]
png = 'zoom-out.png'
x_hotspot = 116
y_hotspot = 116
win_name = 'Zoom-out'

[cursors.person]
png = 'person.png'
x_hotspot = 55
y_hotspot = 17
win_name = 'Person'

[cursors.pin]
png = 'pin.png'
x_hotspot = 55
y_hotspot = 17
win_name = 'Pin'
Loading

0 comments on commit 4460d91

Please sign in to comment.