apple_cursor/README.md

277 lines
8.9 KiB
Markdown
Raw Permalink Normal View History

# Apple Cursor
2020-08-06 08:30:49 -04:00
2024-04-30 08:07:59 -04:00
![Apple Cursor](https://github.com/ful1e5/apple_cursor/assets/24286590/ad260d52-6534-441b-902d-440cb368b5c9)
Open source macOS Cursors for `Windows` and `Linux` with _HiDPI Support_ .
2020-08-06 09:03:32 -04:00
[![Build](https://github.com/ful1e5/apple_cursor/workflows/build/badge.svg)](https://github.com/ful1e5/apple_cursor/actions?query=workflow%3Abuild)
2020-08-06 09:03:32 -04:00
## Notes
2024-05-05 06:40:06 -04:00
- All cursor's SVG files are found in [svg](./svg) directory or you can also find them on [Figma](https://www.figma.com/file/OZw8Ylb9xPFw9h1uZYSMFa/apple_cursor?type=design&node-id=73%3A2&mode=design&t=dLILPgJJrLKeAcTE-1).
<!-- If you're interested, you can learn more about "sponsor-spotlight" on
https://dev.to/ful1e5/lets-give-recognition-to-those-supporting-our-work-on-github-sponsors-b00 -->
![shoutout-sponsors](https://sponsor-spotlight.vercel.app/sponsor?login=ful1e5)
2024-05-05 07:05:43 -04:00
- **2024-04-26**: c684a72e967b58d85492fae5fa68040beae47c10 Partitioned cursor build configuration into multiple files according to platform:
2024-05-05 06:05:06 -04:00
`build.toml` -> `configs/win_lg.build.toml`, `configs/win_rg.build.toml`, `configs/win_xl.build.toml`, `configs/x.build.toml`.
2024-05-05 07:05:43 -04:00
- **2024-02-23**: 07767c24b0c5dbf912cf37350b86adc11671a18e `bitmaps` directory removed, and `macOS Monterey` cursors deprecated.
---
![macOS](https://github.com/ful1e5/apple_cursor/assets/24286590/07018988-36ee-4913-adc7-365854629a20)
![macOS white](https://github.com/ful1e5/apple_cursor/assets/24286590/1d2bcdf5-d3d7-420a-8dae-68c31b191216)
## Cursor Sizes
### Xcursor Sizes:
2020-08-11 07:48:57 -04:00
<kbd>16</kbd>
<kbd>20</kbd>
2020-10-23 03:00:20 -04:00
<kbd>22</kbd>
2020-08-11 07:48:57 -04:00
<kbd>24</kbd>
<kbd>28</kbd>
<kbd>32</kbd>
<kbd>40</kbd>
<kbd>48</kbd>
<kbd>56</kbd>
<kbd>64</kbd>
<kbd>72</kbd>
<kbd>80</kbd>
<kbd>88</kbd>
<kbd>96</kbd>
### Windows Cursor Size:
2020-08-11 07:48:57 -04:00
| size | Regular (× ²⁄₃) | Large (× ⁴⁄₅) | Extra-Large (× 1) |
| ---: | --------------: | ------------: | ----------------: |
| 32 | 21.333 → 22 | 25.6 → 26 | 32 |
| 48 | 32 | 38.4 → 39 | 48 |
| 64 | 42.666 → 43 | 51.2 → 52 | 64 |
| 96 | 64 | 76.8 → 77 | 96 |
| 128 | 85.333 → 86 | 102.4 → 103 | 128 |
| 256 | 170.666 → 171 | 204.8 → 205 | 256 |
2020-08-11 07:48:57 -04:00
## Colors
2020-08-09 08:31:53 -04:00
### Default
2021-11-22 07:06:55 -05:00
- Base Color - `#000000` (Black)
- Outline Color - `#FFFFFF` (White)
2021-11-22 07:06:55 -05:00
### White
2021-11-22 07:06:55 -05:00
- Base Color - `#FFFFFF` (White)
- Outline Color - `#000000` (Black)
2021-11-22 07:06:55 -05:00
## How to get it
2021-11-22 07:06:55 -05:00
You can download latest `stable` & `development` releases from
[Release Page](https://github.com/ful1e5/apple_cursor/releases).
2021-11-22 07:06:55 -05:00
2022-10-15 01:43:07 -04:00
### Packages
> **Note**
> If you're having trouble with the packages please submit a request to the package maintainer
> before creating an issue.
#### Arch Linux/Manjaro
Arch Linux/Manjaro users can install from the [AUR](https://aur.archlinux.org/packages/apple_cursor)
currently maintained by [_ful1e5_](https://aur.archlinux.org/account/ful1e5) &
[_Grelek_](https://aur.archlinux.org/account/Grelek) .
Can be installed via Pamac (preinstalled in Manjaro), Paru or any other
[AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers).
```bash
paru -S apple_cursor
```
## Installing Apple Cursor
2021-11-22 07:06:55 -05:00
2020-08-11 07:48:57 -04:00
#### Linux/X11
**Installation:**
2021-11-22 07:06:55 -05:00
```bash
tar -xvf macOS.tar.gz # extract `.tar.gz`
mv macOS* ~/.icons/ # Install to local users
sudo mv macOS* /usr/share/icons/ # Install to all users
2021-11-22 07:06:55 -05:00
```
**Uninstallation:**
2021-11-22 07:06:55 -05:00
2020-08-11 07:48:57 -04:00
```bash
rm ~/.icons/macOS* # Remove from local users
sudo rm /usr/share/icons/macOS* # Remove from all users
2020-08-11 07:48:57 -04:00
```
2020-08-10 02:29:18 -04:00
#### Windows
**Installation:**
2021-11-22 07:06:55 -05:00
1. Unzip `.zip` file
2. Open unziped directory in Explorer, and **right click** on `install.inf`.
2020-10-23 02:39:24 -04:00
3. Click 'Install' from the context menu, and authorize the modifications to your system.
4. Open Control Panel > Personalization and Appearance > Change mouse pointers,
and select **macOS Cursors**.
2020-08-10 02:29:18 -04:00
5. Click '**Apply**'.
**Uninstallation:**
2020-08-07 09:08:30 -04:00
Run the `uninstall.bat` script packed with the `.zip` archive
2020-08-06 08:30:49 -04:00
**OR** follow these steps:
2022-01-24 10:07:26 -05:00
1. Go to **Registry Editor** by typing the same in the _start search box_.
2. Expand `HKEY_CURRENT_USER` folder and expand `Control Panel` folder.
3. Go to `Cursors` folder and click on `Schemes` folder - all the available custom cursors that are
installed will be listed here.
4. **Right Click** on the name of cursor file you want to uninstall; for eg.: _macOS Cursors_ and
click `Delete`.
5. Click '**yes**' when prompted.
2022-01-27 04:59:38 -05:00
## Build From Source
2022-01-27 04:59:38 -05:00
### Prerequisites
2022-01-27 04:59:38 -05:00
- Python version 3.7 or higher
- [clickgen](https://github.com/ful1e5/clickgen)>=2.2.2 (`pip install clickgen`)
- [yarn](https://github.com/yarnpkg/yarn)
2022-01-27 04:59:38 -05:00
### Quick start
2022-01-27 04:59:38 -05:00
1. Install [build prerequisites](#prerequisites) on your system
2. `git clone https://github.com/ful1e5/apple_cursor`
3. `cd apple_cursor`
4. `yarn install`
5. `yarn generate`
6. See [Installing Apple Cursor](#installing-apple-cursor).
2022-01-24 10:07:26 -05:00
### Getting Started
2022-01-27 04:59:38 -05:00
Once you have the [build prerequisites](#prerequisites) installed, You can personalize colors,
customize sizes, change target platforms, and more. This process involves using external tools,
as this repository only contains SVG files and configuration for these tools:
2022-01-27 04:59:38 -05:00
- [cbmp](https://github.com/ful1e5/cbmp): Used for customizing colors and generating PNG files.
- [ctgen](https://github.com/ful1e5/clickgen): Used for customizing sizes and building XCursor and Windows Cursors.
2022-01-27 04:59:38 -05:00
You can refer to the README of each tool for more information on their command-line options.
2022-01-24 10:07:26 -05:00
#### Crafting Your Apple Cursor
2020-08-06 08:30:49 -04:00
The process of creating custom cursor themes involves two main steps:
1. Rendering SVG files to PNG files.
2. Building cursor themes from PNG files.
#### Customize Colors
`cbmp` provides three options for changing colors:
1. `-bc`: Base color, which replaces the `#00FF00` color in the SVG.
2. `-oc`: Outlined color, which replaces the `#0000FF` color in the SVG.
3. `-wc` (optional): Watch Background color, which replaces the `#FF0000` color in the SVG.
2020-08-06 08:45:14 -04:00
```bash
npx cbmp [...] -bc '<hex>' -oc '<hex>' -wc '<hex>'
```
2020-08-06 08:45:14 -04:00
Alternatively, you can provide a JSON configuration file to render SVG files, which contains a sequence of `cbmp` commands:
2020-08-06 08:45:14 -04:00
```bash
npx cbmp render.json
```
#### Customize Sizes
##### Customize Windows Cursor size
2020-08-06 08:45:14 -04:00
To build Windows cursor with size `16`:
2020-08-06 08:45:14 -04:00
```bash
ctgen build.toml -s 16 -p windows -d "bitmaps/macOS" -n "macOS" -c "macOS Cursors with size 16"
2020-08-06 08:45:14 -04:00
```
You can also customize output directory with `-o` option:
2020-08-06 08:45:14 -04:00
```bash
ctgen build.toml -s 16 -p windows -d "bitmaps/macOS" -o "out" -n "macOS" -c "macOS Cursors with size 16"
2020-08-06 08:45:14 -04:00
```
2020-08-06 09:10:07 -04:00
##### Customize XCursor size
2020-08-06 09:10:07 -04:00
To build XCursor with size `16`:
```bash
ctgen build.toml -s 16 -p x11 -d "bitmaps/macOS" -n "macOS" -c "macOS XCursors with size 16"
```
You can also assign multiple sizes to `ctgen` for XCursors build:
2020-08-07 01:08:37 -04:00
```bash
ctgen build.toml -s 16 24 32 -p x11 -d "bitmaps/macOS" -n "macOS" -c "Custom Sizes macOS XCursors"
2020-08-12 01:32:47 -04:00
```
#### Examples
Lets generate macOS cursor with green and black colors:
2020-08-12 01:32:47 -04:00
2021-01-30 07:41:55 -05:00
```bash
npx cbmp -d "svg" -o "bitmaps/macOS-Hacker" -bc "#00FE00" -oc "#000000"
```
2020-08-12 01:32:47 -04:00
After rendering custom color you have to build cursor through `ctgen`:
2020-08-12 01:32:47 -04:00
```bash
ctgen build.toml -d "bitmaps/macOS-Hacker" -n "macOS-Hacker" -c "Green and Black macOS cursors."
2020-08-12 01:32:47 -04:00
```
Afterwards, Generated theme can be found in the `themes` directory.
###### macOS Gruvbox
2020-08-12 01:32:47 -04:00
2020-08-07 08:41:30 -04:00
```bash
npx cbmp -d "svg" -o "bitmaps/macOS-Gruvbox" -bc "#282828" -oc "#EBDBB2" -wc "#000000"
ctgen build.toml -d "bitmaps/macOS-Gruvbox" -n "macOS-Gruvbox" -c "Groovy macOS cursors."
2020-08-07 08:41:30 -04:00
```
###### macOS Solarized Dark
2020-08-10 02:29:18 -04:00
2020-08-12 01:32:47 -04:00
```bash
npx cbmp -d "svg" -o "bitmaps/macOS-Solarized-Dark" -bc "#002b36" -oc "#839496" -wc "#000000"
ctgen build.toml -d "bitmaps/macOS-Solarized-Dark" -n "macOS-Solarized-Dark" -c "Solarized Dark macOS cursors."
2020-08-12 01:32:47 -04:00
```
2020-08-07 08:41:30 -04:00
###### macOS Solarized Light
2020-08-11 07:22:42 -04:00
2020-08-07 08:41:30 -04:00
```bash
npx cbmp -d "svg" -o "bitmaps/macOS-Solarized-Light" -bc "#839496" -oc "#002b36"
ctgen build.toml -d "bitmaps/macOS-Solarized-Light" -n "macOS-Solarized-Light" -c "Solarized Light macOS cursors."
2020-08-07 08:41:30 -04:00
```
2020-08-07 09:04:59 -04:00
###### macOS Dracula
2020-08-07 09:04:59 -04:00
```bash
npx cbmp -d "svg" -o "bitmaas/macOS-Dracula" -bc "#282a36" -oc "#f8f8f2"
ctgen build.toml -d "bitmaps/macOS-Dracula" -n "macOS-Dracula" -c "Dracula macOS cursors."
```
2020-08-07 09:04:59 -04:00
## Testing Cursor
There are several websites that allow you to test your cursor states by hovering over buttons. This can be very useful when developing or verifying the behavior of a cursor. The following websites cover many of the most commonly used cursors, although they may not include all available options.
- [Cursor-Test](https://vibhorjaiswal.github.io/Cursor-Test/)
- [Mozilla CSS Cursor](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor)
For a blueprint for creating XCursors, you may also want to refer to [Cursor-demo](https://wiki.tcl-lang.org/page/Cursor+demo).
## Credit
2020-08-07 23:08:21 -04:00
[Adwaita](https://github.com/GNOME/adwaita-icon-theme) ·
[Dmz](https://github.com/GalliumOS/dmz-cursor-theme) ·
[Yaru](https://github.com/ubuntu/yaru)