Skip to content

Commit

Permalink
breaking-change: De-structured build configs to configs directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ful1e5 committed Aug 7, 2024
1 parent e8dd4f8 commit b02ffaf
Show file tree
Hide file tree
Showing 20 changed files with 739 additions and 212 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ jobs:
- name: Print cbmp version
run: npx cbmp --version

# - name: Rendering Bitmaps
# run: yarn render
# continue-on-error: false
- name: Rendering Bitmaps
run: yarn render
continue-on-error: false

- name: Set up Python
uses: actions/setup-python@v5
Expand All @@ -53,5 +53,5 @@ jobs:
clickgen --version
ctgen --version
# - name: Building XCursor-Pro Cursors
# run: yarn build
- name: Building XCursor-Pro Cursors
run: yarn build
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- 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.

- The `build.toml` file has been removed. Instead, the cursor build configurations are now distributed according to platforms within the `configs` directory:
- `configs/x.build.toml`: Used to build XCursor.
- `configs/win_rg.build.toml`: Used to build regular size Windows cursors.
- `configs/win_lg.build.toml`: Used to build large size Windows cursors.
- `configs/win_xxl.build.toml`: Used to build extra large size Windows cursors.

### What's New?

- Using [cbmp v1.1.1](https://github.com/ful1e5/cbmp/tree/v1.1.1) for rendering cursor bitmaps.
Expand Down
59 changes: 30 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,27 @@ N/A

### Windows Cursor Size:

- <kbd>16x16</kbd> - Small
- <kbd>24x24</kbd> - Regular
- <kbd>32x32</kbd> - Large
- <kbd>48x48</kbd> - Extra Large
- <kbd>48x48</kbd> - Extra Large
- <kbd>32x32</kbd> - Large
- <kbd>24x24</kbd> - Regular
- <kbd>16x16</kbd> - Small

## Colors:

### XCursor-Pro-Red

- Base Color - `#FF0000` (Red)
- Outline Color - `#FFFFFF` (White)
- Outline Color - `#FFFFFF` (White)
- Base Color - `#FF0000` (Red)

### XCursor-Pro-Dark

- Base Color - `#000000` (Black)
- Outline Color - `#FFFFFF` (White)
- Outline Color - `#FFFFFF` (White)
- Base Color - `#000000` (Black)

### XCursor-Pro-Light

- Base Color - `#FFFFFF` (White)
- Outline Color - `#000000` (Black)
- Outline Color - `#000000` (Black)
- Base Color - `#FFFFFF` (White)

## How to get it

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

### Quick install

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

## Installing XCursor-Pro Cursor

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

#### Notes

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

- Since XCursor-Pro variants are designed similarly, they share the same hotspot settings so a
file from a svg, Then you can use yarn because bitmapper is written in TypeScript.
you don't need that. If you want to develop/modify XCursor-Pro's colors, and bitmaps, or generate a png
- yarn is optional, For building XCursors and Windows cursors from `.png` files or resizing them
excluding the render scripts. They are useful for converting `.svg` files to `.png` files.
- Check out the scripts section in [package.json](./package.json) to see how we build the cursor theme,
- XCursor-Pro build configuration and cursor hotspot settings are bundled in the `build.toml` file.

### Build prerequisites

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

### Quick start

Expand Down
89 changes: 89 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/bin/bash
# A script for preparing binaries of XCursor-Pro Cursors, created by Abdulkaiz Khatri.

version="v2.0.2"

error() (
set -o pipefail
"$@" 2> >(sed $'s,.*,\e[31m&\e[m,' >&2)
)

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

if [[ $key == *"Right"* ]]; then
cfg_file="build.right.toml"
fi

echo $cfg_file
}

with_version() {
local comment="${1}"
echo "$comment ($version)"
}

if ! type -p ctgen >/dev/null; then
error ctgen
exit 127 # exit program with "command not found" error code
fi

declare -A names
names["XCursor-Pro-Dark"]=$(with_version "Modern, Proffesional Dark")
names["XCursor-Pro-Light"]=$(with_version "Modern, Proffesional Light")
names["XCursor-Pro-Red"]=$(with_version "Modern, Proffesional Red")

# Cleanup old builds
rm -rf themes bin

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

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

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

ctgen "configs/win_rg.$cfg" -d "bitmaps/$key" -n "$key-Regular" -c "$comment Regular Windows Cursors" &
ctgen "configs/win_lg.$cfg" -d "bitmaps/$key" -n "$key-Large" -c "$comment Large Windows Cursors" &
ctgen "configs/win_xl.$cfg" -d "bitmaps/$key" -n "$key-Extra-Large" -c "$comment Extra Large Windows Cursors" &
PID=$!
wait $PID
done

# Compressing Binaries
mkdir -p bin
cd themes || exit

for key in "${!names[@]}"; do
tar -cJvf "../bin/${key}.tar.xz" "${key}" &
PID=$!
wait $PID
done

# Compressing xcursor-pro-all.tar.xz
cp ../LICENSE .
tar -cJvf "../bin/xcursor-pro-all.tar.xz" --exclude="*-Windows" . &
PID=$!
wait $PID

# Compressing XCursor-Pro-*-Windows
for key in "${!names[@]}"; do
zip -rv "../bin/${key}-Windows.zip" "${key}-Regular-Windows" "${key}-Large-Windows" "${key}-Extra-Large-Windows" &
PID=$!
wait $PID
done

cd ..

# Copying License File for 'bitmaps'
cp LICENSE bitmaps/
zip -rv bin/bitmaps.zip bitmaps
133 changes: 133 additions & 0 deletions configs/win_lg.build.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
[theme]
name = 'XCursor-Pro-Large'
comment = 'Modern, Proffesional Large Windows Cursors'
website = 'https://github.com/ful1e5/XCursor-pro'

[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.all-scroll]
png = 'all-scroll.png'
win_name = 'Move'

[cursors.move]
png = 'move.png'
x_hotspot = 137
y_hotspot = 84
win_name = 'Grabbing'

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

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

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

[cursors.crossed_circle]
png = 'crossed_circle.png'
x_hotspot = 39
y_hotspot = 32
win_name = 'Unavailable'

[cursors.hand1]
png = 'hand1.png'
x_hotspot = 141
y_hotspot = 88
win_name = 'Pan'

[cursors.hand2]
png = 'hand2.png'
x_hotspot = 98
y_hotspot = 24
win_name = 'Link'

[cursors.left_ptr]
png = 'left_ptr.png'
x_hotspot = 123
y_hotspot = 11
win_name = 'Pointer'

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

[cursors.pencil]
png = 'pencil.png'
x_hotspot = 28
y_hotspot = 226
win_name = 'Handwriting'

[cursors.question_arrow]
png = 'question_arrow.png'
x_hotspot = 39
y_hotspot = 32
win_name = 'Help'

[cursors.right_ptr]
png = 'right_ptr.png'
x_hotspot = 174
y_hotspot = 42
win_name = 'Alternate'

[cursors.sb_h_double_arrow]
png = 'sb_h_double_arrow.png'
x11_name = 'sb_h_double_arrow'
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'
x_hotspot = 128
y_hotspot = 126
win_name = 'Text'

[cursors.zoom-in]
png = 'zoom-in.png'
x_hotspot = 112
y_hotspot = 113
win_name = 'Zoom-in'

[cursors.zoom-out]
png = 'zoom-out.png'
x_hotspot = 112
y_hotspot = 113
win_name = 'Zoom-out'

[cursors.person]
png = 'person.png'
x_hotspot = 39
y_hotspot = 32
win_name = 'Person'

[cursors.pin]
png = 'pin.png'
x_hotspot = 39
y_hotspot = 32
win_name = 'Pin'
Loading

0 comments on commit b02ffaf

Please sign in to comment.