Skip to content

Commit

Permalink
switched to new build system, updated assets, preparing for new release
Browse files Browse the repository at this point in the history
  • Loading branch information
phisch committed Apr 4, 2024
1 parent 8cbbc55 commit 9aa60df
Show file tree
Hide file tree
Showing 436 changed files with 56 additions and 9,748 deletions.
83 changes: 48 additions & 35 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,64 @@
on: workflow_dispatch

jobs:
generate_cursor_theme_job:
export_cursor_theme:
runs-on: ubuntu-latest
name: Build phinger-cursors, publish assets and draft release
name: Export the latest theme and its assets from the Figma file
env:
EXPORT_DIRECTORY: export
OUTPUT_DIRECTORY: theme
outputs:
version: ${{ steps.figma_export.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Generate variants and assets from Figma file
id: figma_cursor_theme
uses: phisch/figma-cursor-theme-action@v1.1
uses: actions/checkout@v4
- name: Export
id: figma_export
uses: phisch/cursor-theme-builder/action/export@v1.0
with:
figma_access_token: ${{ secrets.FIGMA_ACCESS_TOKEN }}
figma_file_key: ${{ secrets.FIGMA_FILE_KEY }}
alias_component_set_id: ${{ secrets.ALIAS_COMPONENT_SET_ID }}
sprite_component_set_id: ${{ secrets.SPRITE_COMPONENT_SET_ID }}
theme_name: 'Phinger Cursors'
theme_comment: 'The most over engineered cursor theme.'
theme_directory: 'build/themes'
export_directory: 'build/exports'
svg_directory: 'build/exports/svg'

- name: Update assets
access_token: ${{ secrets.FIGMA_ACCESS_TOKEN }}
file_key: ${{ secrets.FIGMA_FILE_KEY }}
theme_name: Phinger Cursors
theme_author: Philipp Schaffrath (phisch)
theme_comment: Most likely the most over engineered cursor theme.
output_directory: ${{ env.EXPORT_DIRECTORY }}
- name: Replace theme
run: |
rm -rf assets
mv build/exports assets
- name: Push updated assets
uses: EndBug/add-and-commit@v7
rm -rf $OUTPUT_DIRECTORY
mv $EXPORT_DIRECTORY $OUTPUT_DIRECTORY
- name: Commit and push latest theme
uses: EndBug/add-and-commit@v9
with:
add: 'assets'
add: ${{ env.OUTPUT_DIRECTORY }}
default_author: github_actor
message: 'updated assets from figma file version ${{ steps.figma_cursor_theme.outputs.version }}'
message: "exported theme from figma file ${{ secrets.FIGMA_FILE_KEY }} version ${{ steps.figma_export.outputs.version }}"

- name: Compress variants
run: tar -cjf build/phinger-cursors-variants.tar.bz2 -C build/themes .

- name: Upload cursor variants artifact
uses: actions/upload-artifact@v2
build_cursor_theme_job:
runs-on: ubuntu-latest
name: Build cursor theme
needs: export_cursor_theme
env:
ARCHIVE_NAME: phinger-cursors-variants.tar.bz2
BUILD_DIRECTORY: build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Cursor Theme
uses: phisch/cursor-theme-builder/action/build@v1.0
with:
cursor_theme_json: theme/cursor-theme.json
output_directory: ${{ env.BUILD_DIRECTORY }}/themes
- name: Create artifact
working-directory: ${{ env.BUILD_DIRECTORY }}
run: tar -cjf ${{ env.ARCHIVE_NAME }} -C themes .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: phinger-cursors-variants
path: build/phinger-cursors-variants.tar.bz2

path: ${{ env.BUILD_DIRECTORY }}/${{ env.ARCHIVE_NAME }}
- name: Draft Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: build/phinger-cursors-variants.tar.bz2
files: ${{ env.BUILD_DIRECTORY }}/${{ env.ARCHIVE_NAME }}
draft: true
tag_name: ${{ steps.figma_cursor_theme.outputs.version }}
tag_name: ${{ job.export_cursor_theme.outputs.version }}
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,29 @@ Each part is designed on a base grid of 24 and 32:

which means will be pixel perfect for any reasonable size:

| 24 | 32 | 48 | 64 | 96 | 128 |
|:-:|:-:|:-:|:-:|:-:|:-:|
| ![24](assets/sprite__24.png) | ![32](assets/sprite__32.png) | ![48](assets/sprite__48.png) | ![64](assets/sprite__64.png) | ![96](assets/sprite__96.png) | ![128](assets/sprite__128.png) |
| 24 | 32 | 48 | 64 | 72 | 96 | 128 |
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
| ![24](assets/sprite_24.png) | ![32](assets/sprite_32.png) | ![48](assets/sprite_48.png) | ![64](assets/sprite_64.png) | ![72](assets/sprite_72.png) | ![96](assets/sprite_96.png) | ![128](assets/sprite_128.png) |

If possible, parts are designed very modular, which lets you create multiple different icons from one part. A good example is the hand part that comes with multiple variations for each single phinger:

![phingers](assets/phingers.png)

### Sprites

The parts are assembled, and styled into sprites. Those sprites are named and contain metadata necessary to generate a cursor theme from them. Each sprite contains a name, information about the cursor hotspot, animation and which kind of variant it is.
The parts are assembled, and styled into sprites. Those sprites are named and contain metadata necessary to generate a cursor theme from them.

### Build process

This repository contains a GitHub workflow, that generates a fully functional X11 cursor theme and variants from the linked figma file. The workflow is defined in [.github/workflows/main.yml](.github/workflows/main.yml).
Each cursor contains information about which cursor and variant it belongs to, what its cursors aliases should be, how to transform it into a left-handed cursor, a hotspot element and instructions on how it should be animated.

It uses the custom made GitHub Action [phisch/figma-cursor-theme-action](https://github.com/phisch/figma-cursor-theme-action) to do that.
### Build process

This action exports assets from the Figma file and commits them to [assets](assets), then renders the sprites into pngs and packs them into proper (and if necessary animated) x11 cursor files. It also generates symlinks and variants, bundles them, and creates a release.
Phinger cursors are built using my [Cursor Theme Builder](https://github.com/phisch/cursor-theme-builder). It provides a JSON schema to describe a cursor theme, an exporter, that can create such a JSON file and assets from a Figma file, and a builder, which makes fully functioning X11 cursor theme variants from that. It also allows to transform cursors into left-handed versions, comes with an animation system and more.

Please refer to the actions [README.md](https://github.com/phisch/figma-cursor-theme-action#readme) for a detailed documentation.
This repository contains [workflows](.github/workflows) to extract a cursor-theme.json and assets, and drafts a release with built cursor theme variants.

## License & Credits
All assets, including the Figma document are licensed under the [CC-BY-SA-4.0 License](LICENSE).

The X11 and Wayland cursors are designed from scratch, and not copied. The original logos belong to X11 and Wayland respectively though.

Although designed from scratch, phinger cursors drew inspiration from [capitaine-cursors](https://github.com/keeferrourke/capitaine-cursors), which is based on the KDE Breeze cursors. So this is a special thanks to them, and all other amazing cursor themes out there!

## Contribute
Expand Down
Binary file modified assets/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/grid sizes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/parts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/phingers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/sprite.png
Binary file not shown.
Binary file added assets/sprite_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sprite_24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sprite_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sprite_48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sprite_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sprite_72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sprite_96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/sprite__128.png
Binary file not shown.
Binary file removed assets/sprite__24.png
Binary file not shown.
Binary file removed assets/sprite__32.png
Binary file not shown.
Binary file removed assets/sprite__48.png
Binary file not shown.
Binary file removed assets/sprite__64.png
Binary file not shown.
Binary file removed assets/sprite__96.png
Binary file not shown.
Binary file added assets/sprites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 0 additions & 23 deletions assets/svg/24/default/alias.svg

This file was deleted.

22 changes: 0 additions & 22 deletions assets/svg/24/default/all-scroll.svg

This file was deleted.

21 changes: 0 additions & 21 deletions assets/svg/24/default/bottom_left_corner.svg

This file was deleted.

Loading

0 comments on commit 9aa60df

Please sign in to comment.