aboutsummaryrefslogtreecommitdiffstats
path: root/community/capitaine-cursors/r4_to_master.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/capitaine-cursors/r4_to_master.patch')
-rw-r--r--community/capitaine-cursors/r4_to_master.patch180
1 files changed, 180 insertions, 0 deletions
diff --git a/community/capitaine-cursors/r4_to_master.patch b/community/capitaine-cursors/r4_to_master.patch
new file mode 100644
index 00000000000..dab928cb5ac
--- /dev/null
+++ b/community/capitaine-cursors/r4_to_master.patch
@@ -0,0 +1,180 @@
+diff --git a/README.md b/README.md
+index 555b2a4..05270f0 100644
+--- a/README.md
++++ b/README.md
+@@ -13,14 +13,14 @@ This cursor pack aims to support all [named pixel densities][named-dpi].
+
+ [named-dpi]: https://en.wikipedia.org/wiki/Pixel_density#Named_pixel_densities
+
+-| Name | Build option name | Rendered density (DPI) | Scale |
+-| :------ | :---------------- | :--------------------- | :------- |
+-| LODPI | `-d lo` | 96-144 | x1, x1.5 |
+-| TVDPI | `-d tv` (default) | 192 | x2 |
+-| HDPI | `-d hd` | 240 | x2.5 |
+-| XHDPI | `-d xhd` | 288 | x3 |
+-| XXHDPI | `-d xxhd` | 384-480 | x4, x5 |
+-| XXXHDPI | `-d xxxhd` | 576 | x6 |
++| Name | Build option name | Rendered density (DPI) | Scale |
++| :------ | :---------------- | :--------------------- | :------------- |
++| LODPI | `-d lo` | 96-144 | x1, 1.25, x1.5 |
++| TVDPI | `-d tv` (default) | 192 | x2 |
++| HDPI | `-d hd` | 240 | x2.5 |
++| XHDPI | `-d xhd` | 288 | x3 |
++| XXHDPI | `-d xxhd` | 384-480 | x4, x5 |
++| XXXHDPI | `-d xxxhd` | 576+ | x6, x10 |
+
+ ## Building from source
+
+@@ -29,7 +29,15 @@ Pre-built packages are available for download.
+
+ That said, you'll find everything you need to build and modify this cursor set in the `src/` directory.
+
+-Just make sure `inkscape` and `xcursorgen` are installed, and run the provided script:
++Make sure `inkscape` and `xcursorgen` are installed
++
++```
++sudo apt install inkscape x11-apps # Debian, Ubuntu based distros
++sudo dnf install inkscape xorg-x11-apps # Fedora, EPEL based distros
++brew cask install xquartz inkscape # macOS
++```
++
++Then run the provided script:
+
+ ```
+ ./build.sh
+@@ -112,4 +120,4 @@ If you like this cursor theme and want to support me, please consider [donating]
+
+ | Dark | Light |
+ | --------------------- | ---------------------- |
+-| ![](preview-dark.png) | ![](preview-light.png) |
+\ No newline at end of file
++| ![](preview-dark.png) | ![](preview-light.png) |
+diff --git a/build.sh b/build.sh
+index 9d80f46..e008e47 100755
+--- a/build.sh
++++ b/build.sh
+@@ -10,7 +10,7 @@ PLATFORMS=('unix' 'win32')
+ BUILD_DIR=$PWD/_build
+ SPECS="$SRC/config"
+ ALIASES="$SRC/cursor-aliases"
+-SIZES=('1' '1.5' '2' '2.5' '3' '4' '5' '6')
++SIZES=('1' '1.25' '1.5' '2' '2.5' '3' '4' '5' '6' '10')
+ DPIS=('lo' 'tv' 'hd' 'xhd' 'xxhd' 'xxxhd')
+ SVG_DIM=24
+ SVG_DPI=96
+@@ -25,22 +25,22 @@ function set_sizes {
+ max_size="$1"
+ case $max_size in
+ lo)
+- SIZES=("${SIZES[@]:0:2}")
++ SIZES=("${SIZES[@]:0:3}")
+ ;;
+ tv)
+- SIZES=("${SIZES[@]:0:3}")
++ SIZES=("${SIZES[@]:0:4}")
+ ;;
+ hd)
+- SIZES=("${SIZES[@]:0:4}")
++ SIZES=("${SIZES[@]:0:5}")
+ ;;
+ xhd)
+- SIZES=("${SIZES[@]:0:5}")
++ SIZES=("${SIZES[@]:0:6}")
+ ;;
+ xxhd)
+ SIZES=("${SIZES[@]:0:7}")
+ ;;
+ xxxhd)
+- SIZES=("${SIZES[@]:0:8}")
++ SIZES=("${SIZES[@]}")
+ ;;
+ *)
+ return 1
+@@ -68,7 +68,7 @@ function generate_in {
+ cur_name="$(basename "${spec%.*}")"
+ target="$BUILD_DIR/$cur_name.in"
+ if [ -f "$target" ]; then rm "$target"; fi
+- for size in "${SIZES[@]}"; do
++ for size in "${SIZES[@]}"; do
+ dim=$(echo "$SVG_DIM*$size" | bc)
+ xhot=$(echo "$xhot_spec*$size" | bc)
+ yhot=$(echo "$yhot_spec*$size" | bc)
+@@ -107,9 +107,22 @@ function render {
+ size=$(echo "$SVG_DIM*$1" | bc)
+ dpi=$(echo "$SVG_DPI*$1" | bc)
+
+- mkdir -p "$BUILD_DIR/$variant/$name"
+- find "$SRC/svg/$variant" -name "*.svg" -type f \
+- -exec sh -c 'inkscape -z -e "$1/$2/$3/$(basename ${0%.svg}).png" -w $4 -h $4 -d $5 $0' {} "$BUILD_DIR" "$variant" "$name" "$size" "$dpi" \;
++ size=${size%.*} dpi=${size%.*} # Strip decimal parts if any.
++
++ OUTPUT_DIR="$BUILD_DIR/$variant/$name"
++ mkdir -p "$OUTPUT_DIR"
++
++ # Set options for Inkscape depending on version.
++ INKSCAPE_OPTS=('-w' "$size" -h "$size" -d "$dpi" )
++ case $(inkscape -V | cut -d' ' -f2) in
++ # NB: The export option (-e or -o) must be the last option in the INKSCAPE_OPTS array.
++ 0.*) INKSCAPE_OPTS+=('-z' '-e');; # -z specifies not to launch GUI, -e is export
++ 1.*) INKSCAPE_OPTS+=('-o');; # v1.0+ uses no GUI by default, -e replaced by -o
++ esac
++
++ for svg_file in "$SRC/svg/$variant"/*.svg; do
++ inkscape "${INKSCAPE_OPTS[@]}" "$OUTPUT_DIR/$(basename "${svg_file%.svg}").png" "$svg_file"
++ done
+ }
+
+ # Assembles rendered PNGs into a cursor distribution.
+@@ -151,14 +164,18 @@ function assemble {
+
+ if [ -e "$to" ]; then continue; fi
+
+- ln -sr "$from" "$to"
++ ln -s "$from" "$to"
+ done < "$ALIASES"
+ popd > /dev/null || return 1
+
++ # Write the index.theme file.
+ if [ ! -e "$INDEX_FILE" ]; then
+ touch "$INDEX_FILE"
+ echo -e "[Icon Theme]\nName=$THEME_NAME\nComment=A stylish cursor for humans" > "$INDEX_FILE"
+ fi
++
++ # Copy a thumbnail.png to serve as a preview in some environments.
++ cp "$SRC/thumbnail-$variant.png" "$OUTPUT_DIR/thumbnail.png"
+ }
+
+ function show_usage {
+@@ -174,7 +191,7 @@ function show_usage {
+
+ function validate_option {
+ valid=0
+- case "$1" in
++ case "$1" in
+ variant)
+ for variant in "${VARIANTS[@]}"; do
+ if [[ "$2" == "$variant" ]]; then valid=1; fi
+@@ -191,6 +208,15 @@ function validate_option {
+ return $?
+ }
+
++# Check dependencies are present.
++DEPENDENCIES=(inkscape xcursorgen bc)
++for dep in "${DEPENDENCIES[@]}"; do
++ if ! command -v "$dep" >/dev/null; then
++ echo "$dep is not installed, exiting."
++ exit 1
++ fi
++done
++
+ # Parse options to script.
+ POSITIONAL_ARGS=()
+ VARIANT="${VARIANTS[0]}" # Default = dark
+diff --git a/src/thumbnail-dark.png b/src/thumbnail-dark.png
+new file mode 100644
+index 0000000..38ecc54
+Binary files /dev/null and b/src/thumbnail-dark.png differ
+diff --git a/src/thumbnail-light.png b/src/thumbnail-light.png
+new file mode 100644
+index 0000000..5021ddc
+Binary files /dev/null and b/src/thumbnail-light.png differ