Skip to content

Commit b02ffaf

Browse files
committed
breaking-change: De-structured build configs to configs directory
1 parent e8dd4f8 commit b02ffaf

20 files changed

+739
-212
lines changed

.github/workflows/build.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ jobs:
3535
- name: Print cbmp version
3636
run: npx cbmp --version
3737

38-
# - name: Rendering Bitmaps
39-
# run: yarn render
40-
# continue-on-error: false
38+
- name: Rendering Bitmaps
39+
run: yarn render
40+
continue-on-error: false
4141

4242
- name: Set up Python
4343
uses: actions/setup-python@v5
@@ -53,5 +53,5 @@ jobs:
5353
clickgen --version
5454
ctgen --version
5555
56-
# - name: Building XCursor-Pro Cursors
57-
# run: yarn build
56+
- name: Building XCursor-Pro Cursors
57+
run: yarn build

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- The 'bitmaps' directory has been removed from the git repository. You can now generate the PNG files using `yarn render` or download them from the release assets.
1313

14+
- The `build.toml` file has been removed. Instead, the cursor build configurations are now distributed according to platforms within the `configs` directory:
15+
- `configs/x.build.toml`: Used to build XCursor.
16+
- `configs/win_rg.build.toml`: Used to build regular size Windows cursors.
17+
- `configs/win_lg.build.toml`: Used to build large size Windows cursors.
18+
- `configs/win_xxl.build.toml`: Used to build extra large size Windows cursors.
19+
1420
### What's New?
1521

1622
- Using [cbmp v1.1.1](https://github.com/ful1e5/cbmp/tree/v1.1.1) for rendering cursor bitmaps.

README.md

+30-29
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,27 @@ N/A
5050

5151
### Windows Cursor Size:
5252

53-
- <kbd>16x16</kbd> - Small
54-
- <kbd>24x24</kbd> - Regular
55-
- <kbd>32x32</kbd> - Large
56-
- <kbd>48x48</kbd> - Extra Large
53+
- <kbd>48x48</kbd> - Extra Large
54+
- <kbd>32x32</kbd> - Large
55+
- <kbd>24x24</kbd> - Regular
56+
- <kbd>16x16</kbd> - Small
5757

5858
## Colors:
5959

6060
### XCursor-Pro-Red
6161

62-
- Base Color - `#FF0000` (Red)
63-
- Outline Color - `#FFFFFF` (White)
62+
- Outline Color - `#FFFFFF` (White)
63+
- Base Color - `#FF0000` (Red)
6464

6565
### XCursor-Pro-Dark
6666

67-
- Base Color - `#000000` (Black)
68-
- Outline Color - `#FFFFFF` (White)
67+
- Outline Color - `#FFFFFF` (White)
68+
- Base Color - `#000000` (Black)
6969

7070
### XCursor-Pro-Light
7171

72-
- Base Color - `#FFFFFF` (White)
73-
- Outline Color - `#000000` (Black)
72+
- Outline Color - `#000000` (Black)
73+
- Base Color - `#FFFFFF` (White)
7474

7575
## How to get it
7676

@@ -81,9 +81,9 @@ You can download latest `stable` & `development` releases from
8181

8282
### Quick install
8383

84-
- XCursor Pro Dark: [https://www.pling.com/p/1481466](https://www.pling.com/p/1481466)
85-
- XCursor Pro Light: [https://www.pling.com/p/1639833](https://www.pling.com/p/1639833)
86-
- XCursor Pro Red: [https://www.pling.com/p/1639834](https://www.pling.com/p/1639834)
84+
- XCursor Pro Red: [https://www.pling.com/p/1639834](https://www.pling.com/p/1639834)
85+
- XCursor Pro Light: [https://www.pling.com/p/1639833](https://www.pling.com/p/1639833)
86+
- XCursor Pro Dark: [https://www.pling.com/p/1481466](https://www.pling.com/p/1481466)
8787

8888
## Installing XCursor-Pro Cursor
8989

@@ -133,25 +133,26 @@ Run the `uninstall.bat` script packed with the `.zip` archive
133133

134134
#### Notes
135135

136-
- XCursor-Pro build configuration and cursor hotspot settings are bundled in the `build.toml` file.
137-
- Check out the scripts section in [package.json](./package.json) to see how we build the cursor theme,
138-
excluding the render scripts. They are useful for converting `.svg` files to `.png` files.
139-
- yarn is optional, For building XCursors and Windows cursors from `.png` files or resizing them
140-
you don't need that. If you want to develop/modify XCursor-Pro's colors, and bitmaps, or generate a png
141-
file from a svg, Then you can use yarn because bitmapper is written in TypeScript.
142-
- Since XCursor-Pro variants are designed similarly, they share the same hotspot settings so a
143-
single configuration file `build.toml` is responsible for building all variants. Due to this, you will have
144-
to change the following options in `ctgen` to build the appropriate variant:
145-
- **-d**: bitmaps directory
146-
- **-n**: The name you want to give to the generated theme.
147-
- **-c**: Theme comment.
148-
- See `ctgen --help` for all available options.
136+
- See `ctgen --help` for all available options.
137+
- **-c**: Theme comment.
138+
- **-n**: The name you want to give to the generated theme.
139+
- **-d**: bitmaps directory
140+
to change the following options in `ctgen` to build the appropriate variant:
141+
single configuration file `build.toml` is responsible for building all variants. Due to this, you will have
142+
143+
- Since XCursor-Pro variants are designed similarly, they share the same hotspot settings so a
144+
file from a svg, Then you can use yarn because bitmapper is written in TypeScript.
145+
you don't need that. If you want to develop/modify XCursor-Pro's colors, and bitmaps, or generate a png
146+
- yarn is optional, For building XCursors and Windows cursors from `.png` files or resizing them
147+
excluding the render scripts. They are useful for converting `.svg` files to `.png` files.
148+
- Check out the scripts section in [package.json](./package.json) to see how we build the cursor theme,
149+
- XCursor-Pro build configuration and cursor hotspot settings are bundled in the `build.toml` file.
149150

150151
### Build prerequisites
151152

152-
- Python version 3.7 or higher
153-
- [clickgen](https://github.com/ful1e5/clickgen)>=2.1.2 (`pip install clickgen`)
154-
- [yarn](https://github.com/yarnpkg/yarn)
153+
- [yarn](https://github.com/yarnpkg/yarn)
154+
- [clickgen](https://github.com/ful1e5/clickgen)>=2.1.2 (`pip install clickgen`)
155+
- Python version 3.7 or higher
155156

156157
### Quick start
157158

build.sh

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/bin/bash
2+
# A script for preparing binaries of XCursor-Pro Cursors, created by Abdulkaiz Khatri.
3+
4+
version="v2.0.2"
5+
6+
error() (
7+
set -o pipefail
8+
"$@" 2> >(sed $'s,.*,\e[31m&\e[m,' >&2)
9+
)
10+
11+
get_config_file() {
12+
local key="${1}"
13+
local cfg_file="build.toml"
14+
15+
if [[ $key == *"Right"* ]]; then
16+
cfg_file="build.right.toml"
17+
fi
18+
19+
echo $cfg_file
20+
}
21+
22+
with_version() {
23+
local comment="${1}"
24+
echo "$comment ($version)"
25+
}
26+
27+
if ! type -p ctgen >/dev/null; then
28+
error ctgen
29+
exit 127 # exit program with "command not found" error code
30+
fi
31+
32+
declare -A names
33+
names["XCursor-Pro-Dark"]=$(with_version "Modern, Proffesional Dark")
34+
names["XCursor-Pro-Light"]=$(with_version "Modern, Proffesional Light")
35+
names["XCursor-Pro-Red"]=$(with_version "Modern, Proffesional Red")
36+
37+
# Cleanup old builds
38+
rm -rf themes bin
39+
40+
# Building XCursor binaries
41+
for key in "${!names[@]}"; do
42+
comment="${names[$key]}"
43+
cfg=$(get_config_file key)
44+
45+
ctgen "configs/x.$cfg" -p x11 -d "bitmaps/$key" -n "$key" -c "$comment XCursors" &
46+
PID=$!
47+
wait $PID
48+
done
49+
50+
# Building Windows binaries
51+
for key in "${!names[@]}"; do
52+
comment="${names[$key]}"
53+
cfg=$(get_config_file key)
54+
55+
ctgen "configs/win_rg.$cfg" -d "bitmaps/$key" -n "$key-Regular" -c "$comment Regular Windows Cursors" &
56+
ctgen "configs/win_lg.$cfg" -d "bitmaps/$key" -n "$key-Large" -c "$comment Large Windows Cursors" &
57+
ctgen "configs/win_xl.$cfg" -d "bitmaps/$key" -n "$key-Extra-Large" -c "$comment Extra Large Windows Cursors" &
58+
PID=$!
59+
wait $PID
60+
done
61+
62+
# Compressing Binaries
63+
mkdir -p bin
64+
cd themes || exit
65+
66+
for key in "${!names[@]}"; do
67+
tar -cJvf "../bin/${key}.tar.xz" "${key}" &
68+
PID=$!
69+
wait $PID
70+
done
71+
72+
# Compressing xcursor-pro-all.tar.xz
73+
cp ../LICENSE .
74+
tar -cJvf "../bin/xcursor-pro-all.tar.xz" --exclude="*-Windows" . &
75+
PID=$!
76+
wait $PID
77+
78+
# Compressing XCursor-Pro-*-Windows
79+
for key in "${!names[@]}"; do
80+
zip -rv "../bin/${key}-Windows.zip" "${key}-Regular-Windows" "${key}-Large-Windows" "${key}-Extra-Large-Windows" &
81+
PID=$!
82+
wait $PID
83+
done
84+
85+
cd ..
86+
87+
# Copying License File for 'bitmaps'
88+
cp LICENSE bitmaps/
89+
zip -rv bin/bitmaps.zip bitmaps

configs/win_lg.build.toml

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
[theme]
2+
name = 'XCursor-Pro-Large'
3+
comment = 'Modern, Proffesional Large Windows Cursors'
4+
website = 'https://github.com/ful1e5/XCursor-pro'
5+
6+
[config]
7+
bitmaps_dir = '' # This config will assigned with `ctgen -d <path>`
8+
out_dir = '../themes'
9+
platforms = 'windows'
10+
11+
12+
[cursors]
13+
[cursors.fallback_settings]
14+
win_sizes = ["26:32", "39:48", "52:64", "77:96", "103:128"]
15+
x_hotspot = 128
16+
y_hotspot = 128
17+
win_delay = 1
18+
19+
20+
[cursors.all-scroll]
21+
png = 'all-scroll.png'
22+
win_name = 'Move'
23+
24+
[cursors.move]
25+
png = 'move.png'
26+
x_hotspot = 137
27+
y_hotspot = 84
28+
win_name = 'Grabbing'
29+
30+
[cursors.bottom_left_corner]
31+
png = 'bottom_left_corner.png'
32+
win_name = 'Dgn2'
33+
34+
[cursors.bottom_right_corner]
35+
png = 'bottom_right_corner.png'
36+
win_name = 'Dgn1'
37+
38+
[cursors.cross]
39+
png = 'cross.png'
40+
win_name = 'Cross'
41+
42+
[cursors.crossed_circle]
43+
png = 'crossed_circle.png'
44+
x_hotspot = 39
45+
y_hotspot = 32
46+
win_name = 'Unavailable'
47+
48+
[cursors.hand1]
49+
png = 'hand1.png'
50+
x_hotspot = 141
51+
y_hotspot = 88
52+
win_name = 'Pan'
53+
54+
[cursors.hand2]
55+
png = 'hand2.png'
56+
x_hotspot = 98
57+
y_hotspot = 24
58+
win_name = 'Link'
59+
60+
[cursors.left_ptr]
61+
png = 'left_ptr.png'
62+
x_hotspot = 123
63+
y_hotspot = 11
64+
win_name = 'Pointer'
65+
66+
[cursors.left_ptr_watch]
67+
png = 'left_ptr_watch-*.png'
68+
x_hotspot = 40
69+
y_hotspot = 30
70+
win_sizes = "78:96"
71+
win_name = 'Work'
72+
73+
[cursors.pencil]
74+
png = 'pencil.png'
75+
x_hotspot = 28
76+
y_hotspot = 226
77+
win_name = 'Handwriting'
78+
79+
[cursors.question_arrow]
80+
png = 'question_arrow.png'
81+
x_hotspot = 39
82+
y_hotspot = 32
83+
win_name = 'Help'
84+
85+
[cursors.right_ptr]
86+
png = 'right_ptr.png'
87+
x_hotspot = 174
88+
y_hotspot = 42
89+
win_name = 'Alternate'
90+
91+
[cursors.sb_h_double_arrow]
92+
png = 'sb_h_double_arrow.png'
93+
x11_name = 'sb_h_double_arrow'
94+
win_name = 'Horz'
95+
96+
[cursors.sb_v_double_arrow]
97+
png = 'sb_v_double_arrow.png'
98+
win_name = 'Vert'
99+
100+
[cursors.wait]
101+
png = 'wait-*.png'
102+
win_sizes = "78:96"
103+
win_name = 'Busy'
104+
105+
[cursors.xterm]
106+
png = 'xterm.png'
107+
x_hotspot = 128
108+
y_hotspot = 126
109+
win_name = 'Text'
110+
111+
[cursors.zoom-in]
112+
png = 'zoom-in.png'
113+
x_hotspot = 112
114+
y_hotspot = 113
115+
win_name = 'Zoom-in'
116+
117+
[cursors.zoom-out]
118+
png = 'zoom-out.png'
119+
x_hotspot = 112
120+
y_hotspot = 113
121+
win_name = 'Zoom-out'
122+
123+
[cursors.person]
124+
png = 'person.png'
125+
x_hotspot = 39
126+
y_hotspot = 32
127+
win_name = 'Person'
128+
129+
[cursors.pin]
130+
png = 'pin.png'
131+
x_hotspot = 39
132+
y_hotspot = 32
133+
win_name = 'Pin'

0 commit comments

Comments
 (0)