Skip to content

Commit

Permalink
macOSMonterey cursors added 🎊 fixed #66
Browse files Browse the repository at this point in the history
  • Loading branch information
ful1e5 committed Nov 22, 2021
1 parent eff6e95 commit 281bc18
Show file tree
Hide file tree
Showing 10 changed files with 187 additions and 32 deletions.
42 changes: 34 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,41 +57,67 @@ jobs:
run: cd svg && python link.py && cd ..
continue-on-error: false

- name: Generating `macOSBigSur` Cursor Theme
run: make bigsur
- name: Generating `macOS` Cursor Theme
run: make
continue-on-error: false

- name: Compressing UNIX theme
- name: Compressing `macOS` UNIX themes
run: |
tar -cvzf macOSBigSur.tar.gz themes/macOSBigSur
tar -cvzf macOSBigSur-White.tar.gz themes/macOSBigSur-White
tar -cvzf macOSMonterey.tar.gz themes/macOSMonterey
tar -cvzf macOSMonterey-White.tar.gz themes/macOSMonterey-White
- name: Uploading `bitmaps` artifact
- name: Uploading `macOSBigSur` bitmaps
uses: actions/upload-artifact@v2
with:
name: bitmaps
path: bitmaps/*

- name: Uploading `macOSBigSur` UNIX Theme artifact
- name: Uploading `macOSBigSur` UNIX Theme
uses: actions/upload-artifact@v2
with:
name: macOSBigSur
path: macOSBigSur.tar.gz

- name: Uploading `macOSBigSur-White` UNIX Theme artifact
- name: Uploading `macOSMonterey` UNIX Theme
uses: actions/upload-artifact@v2
with:
name: macOSMonterey
path: macOSMonterey.tar.gz

- name: Uploading `macOSBigSur-White` UNIX Theme
uses: actions/upload-artifact@v2
with:
name: macOSBigSur-White
path: macOSBigSur-White.tar.gz

- name: Uploading `macOSBigSur` Windows Theme artifact
- name: Uploading `macOSMonterey-White` UNIX Theme
uses: actions/upload-artifact@v2
with:
name: macOSMonterey-White
path: macOSMonterey-White.tar.gz

- name: Uploading `macOSBigSur` Windows Theme
uses: actions/upload-artifact@v2
with:
name: macOSBigSur-Windows
path: themes/macOSBigSur-Windows/*

- name: Uploading `macOSBigSur-White` Windows Theme artifact
- name: Uploading `macOSMonterey` Windows Theme
uses: actions/upload-artifact@v2
with:
name: macOSMonterey-Windows
path: themes/macOSMonterey-Windows/*

- name: Uploading `macOSBigSur-White` Windows Theme
uses: actions/upload-artifact@v2
with:
name: macOSBigSur-White-Windows
path: themes/macOSBigSur-White-Windows/*

- name: Uploading `macOSMonterey-White` Windows Theme
uses: actions/upload-artifact@v2
with:
name: macOSMonterey-White-Windows
path: themes/macOSMonterey-White-Windows/*
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- macOSMonterey cursors added 🎊 fixed #66
- Generate master `bitmaps.zip` inside `bin` directory
- `Makefile` binaries targets with variable
- pling docs: size and support info updated
Expand Down
60 changes: 42 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ clean:
@rm -rf bitmaps themes

render: bitmapper svg
@cd bitmapper && make install render_bigsur
@cd bitmapper && make install render_bigsur render_monterey

build: bitmaps
@cd builder && make setup build
Expand All @@ -29,11 +29,19 @@ render_bigsur: bitmapper svg
build_bigsur: bitmaps
@cd builder && make setup build_bigsur

# macOS Monterey
monterey: clean render_monterey build_monterey

render_monterey: bitmapper svg
@cd bitmapper && make install render_monterey

build_monterey: bitmaps
@cd builder && make setup build_monterey

# Installation
.ONESHELL:
SHELL:=/bin/bash
THEME_PREFIX = macOSBigSur
THEME_PREFIX = macOS

src := ./themes/

Expand All @@ -48,24 +56,32 @@ install: $(src)
@if [[ $EUID -ne 0 ]]; then
@echo "> Installing '$(THEME_PREFIX)' cursors inside $(local)/..."
@mkdir -p $(local)
@cp -r ./themes/$(THEME_PREFIX) $(local_dest)
@cp -r ./themes/$(THEME_PREFIX)-White $(local_dest) && echo "> Installed!"
@cp -r ./themes/$(THEME_PREFIX)BigSur $(local_dest)
@cp -r ./themes/$(THEME_PREFIX)BigSur -White $(local_dest) && echo "> Installed!"
@cp -r ./themes/$(THEME_PREFIX)Monterey $(local_dest)
@cp -r ./themes/$(THEME_PREFIX)Monterey -White $(local_dest) && echo "> Installed!"
@else
@echo "> Installing '$(THEME_PREFIX)' cursors inside $(root)/..."
@mkdir -p $(root)
@sudo cp -r ./themes/$(THEME_PREFIX) $(root_dest)
@sudo cp -r ./themes/$(THEME_PREFIX)-White $(root_dest) && echo "> Installed!"
@sudo cp -r ./themes/$(THEME_PREFIX)BigSur $(root_dest)
@sudo cp -r ./themes/$(THEME_PREFIX)BigSur-White $(root_dest) && echo "> Installed!"
@sudo cp -r ./themes/$(THEME_PREFIX)Monterey $(root_dest)
@sudo cp -r ./themes/$(THEME_PREFIX)Monterey-White $(root_dest) && echo "> Installed!"
@fi

uninstall:
@if [[ $EUID -ne 0 ]]; then
@echo "> Removing '$(THEME_PREFIX)' from '$(local)'..."
@rm -rf $(local)/$(THEME_PREFIX)
@rm -rf $(local)/$(THEME_PREFIX)-White
@rm -rf $(local)/$(THEME_PREFIX)BigSur
@rm -rf $(local)/$(THEME_PREFIX)BigSur-White
@rm -rf $(local)/$(THEME_PREFIX)Monterey
@rm -rf $(local)/$(THEME_PREFIX)Monterey-White
@else
@echo "> Removing '$(THEME_PREFIX)' from '$(root)'..."
@rm -rf $(root)/$(THEME_PREFIX)
@rm -rf $(root)/$(THEME_PREFIX)-White
@rm -rf $(root)/$(THEME_PREFIX)BigSur
@rm -rf $(root)/$(THEME_PREFIX)BigSur-White
@rm -rf $(root)/$(THEME_PREFIX)Monterey
@rm -rf $(root)/$(THEME_PREFIX)Monterey-White
@fi

reinstall: uninstall install
Expand All @@ -76,16 +92,24 @@ BIN_DIR = ../bin
THEMES = White
prepare: bitmaps themes
@rm -rf bin
@mkdir -p bin/$(THEME_PREFIX)
@$(foreach theme,$(THEMES), mkdir -p bin/$(THEME_PREFIX)-$(theme);)
@mkdir -p bin/$(THEME_PREFIX)BigSur
@$(foreach theme,$(THEMES), mkdir -p bin/$(THEME_PREFIX)BigSur-$(theme);)
@mkdir -p bin/$(THEME_PREFIX)Monterey
@$(foreach theme,$(THEMES), mkdir -p bin/$(THEME_PREFIX)Monterey-$(theme);)
@cd bitmaps
@zip -r $(BIN_DIR)/$(THEME_PREFIX)/bitmaps.zip $(THEME_PREFIX)
@$(foreach theme,$(THEMES), zip -r $(BIN_DIR)/$(THEME_PREFIX)-$(theme)/bitmaps.zip $(THEME_PREFIX)-$(theme);)
@zip -r $(BIN_DIR)/$(THEME_PREFIX)BigSur/bitmaps.zip $(THEME_PREFIX)BigSur
@$(foreach theme,$(THEMES), zip -r $(BIN_DIR)/$(THEME_PREFIX)BigSur-$(theme)/bitmaps.zip $(THEME_PREFIX)BigSur-$(theme);)
@zip -r $(BIN_DIR)/$(THEME_PREFIX)Monterey/bitmaps.zip $(THEME_PREFIX)Monterey
@$(foreach theme,$(THEMES), zip -r $(BIN_DIR)/$(THEME_PREFIX)Monterey-$(theme)/bitmaps.zip $(THEME_PREFIX)Monterey-$(theme);)
@zip -r $(BIN_DIR)/bitmaps.zip *
@cd ..
@cd themes
@tar -czvf $(BIN_DIR)/$(THEME_PREFIX)/$(THEME_PREFIX).tar.gz $(THEME_PREFIX)
@zip -r $(BIN_DIR)/$(THEME_PREFIX)/$(THEME_PREFIX)-Windows.zip $(THEME_PREFIX)-Windows
@$(foreach theme,$(THEMES), tar -czvf $(BIN_DIR)/$(THEME_PREFIX)-$(theme)/$(THEME_PREFIX)-$(theme).tar.gz $(THEME_PREFIX)-$(theme);)
@$(foreach theme,$(THEMES), zip -r $(BIN_DIR)/$(THEME_PREFIX)-$(theme)/$(THEME_PREFIX)-$(theme)-Windows.zip $(THEME_PREFIX)-$(theme)-Windows;)
@tar -czvf $(BIN_DIR)/$(THEME_PREFIX)BigSur/$(THEME_PREFIX)BigSur.tar.gz $(THEME_PREFIX)BigSur
@zip -r $(BIN_DIR)/$(THEME_PREFIX)BigSur/$(THEME_PREFIX)BigSur-Windows.zip $(THEME_PREFIX)BigSur-Windows
@tar -czvf $(BIN_DIR)/$(THEME_PREFIX)Monterey/$(THEME_PREFIX)Monterey.tar.gz $(THEME_PREFIX)Monterey
@zip -r $(BIN_DIR)/$(THEME_PREFIX)Monterey/$(THEME_PREFIX)Monterey-Windows.zip $(THEME_PREFIX)Monterey-Windows
@$(foreach theme,$(THEMES), tar -czvf $(BIN_DIR)/$(THEME_PREFIX)BigSur-$(theme)/$(THEME_PREFIX)BigSur-$(theme).tar.gz $(THEME_PREFIX)BigSur-$(theme);)
@$(foreach theme,$(THEMES), zip -r $(BIN_DIR)/$(THEME_PREFIX)BigSur-$(theme)/$(THEME_PREFIX)BigSur-$(theme)-Windows.zip $(THEME_PREFIX)BigSur-$(theme)-Windows;)
@$(foreach theme,$(THEMES), tar -czvf $(BIN_DIR)/$(THEME_PREFIX)Monterey-$(theme)/$(THEME_PREFIX)Monterey-$(theme).tar.gz $(THEME_PREFIX)Monterey-$(theme);)
@$(foreach theme,$(THEMES), zip -r $(BIN_DIR)/$(THEME_PREFIX)Monterey-$(theme)/$(THEME_PREFIX)Monterey-$(theme)-Windows.zip $(THEME_PREFIX)Monterey-$(theme)-Windows;)
@cd ..
5 changes: 4 additions & 1 deletion bitmapper/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ install: node_modules package.json
render_bigsur:
@yarn render:bigsur

render: render_bigsur
render_monterey:
@yarn render:monterey

render: render_bigsur render_monterey
3 changes: 2 additions & 1 deletion bitmapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"license": "GPL-3.0",
"private": true,
"scripts": {
"render:bigsur": "yarn workspace bigsur render"
"render:bigsur": "yarn workspace bigsur render",
"render:monterey": "yarn workspace monterey render"
},
"workspaces": [
"packages/*"
Expand Down
17 changes: 17 additions & 0 deletions bitmapper/packages/monterey/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "monterey",
"version": "1.2.2",
"description": "macOS Monterey cursors",
"main": "dist/index.js",
"scripts": {
"build": "npx tsc --build",
"render": "yarn build && node dist/index.js"
},
"author": "Kaiz Khatri",
"license": "GPL-3.0",
"private": true,
"devDependencies": {
"ts-node": "^9.1.1",
"typescript": "^4.1.5"
}
}
28 changes: 28 additions & 0 deletions bitmapper/packages/monterey/src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Colors } from "core/src/types";

interface Config {
themeName: string;
color: Colors;
}

const black = "#000000";
const white = "#FFFFFF";

const config: Config[] = [
{
themeName: "macOSMonterey",
color: {
base: black,
outline: white,
},
},
{
themeName: "macOSMonterey-White",
color: {
base: white,
outline: black,
},
},
];

export { config };
37 changes: 37 additions & 0 deletions bitmapper/packages/monterey/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import path from "path";

import { BitmapsGenerator, SVGHandler } from "core";
import { config } from "./config";

const root = path.resolve(__dirname, "../../../../");
const svgDir = path.resolve(root, "svg", "monterey");

const main = async () => {
for (const { themeName, color } of config) {
console.log("=>", themeName);

const bitmapsDir = path.resolve(root, "bitmaps", themeName);
const svg = new SVGHandler.SvgDirectoryParser(svgDir);

const png = new BitmapsGenerator(bitmapsDir);
const browser = await png.getBrowser();

for (let { key, content } of svg.getStatic()) {
console.log(" -> Saving", key, "...");

content = SVGHandler.colorSvg(content, color);
await png.generateStatic(browser, content, key);
}

for (let { key, content } of svg.getAnimated()) {
console.log(" -> Saving", key, "...");

content = SVGHandler.colorSvg(content, color);
await png.generateAnimated(browser, content, key);
}

await browser.close();
}
};

main();
10 changes: 10 additions & 0 deletions bitmapper/packages/monterey/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

{
"references": [{ "path": "../core" }],
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": ["src"]
}
16 changes: 12 additions & 4 deletions builder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,27 @@ THEMES = White
setup:
@python3 -m pip install clickgen --user

build: build_bigsur
build: build_bigsur build_monterey
build_bigsur: build.py
@python3 build.py -p "$(bitmaps_dir)/macOSBigSur" --xsizes $(X_SIZES) --win-size $(WIN_SIZE) --win-canvas-size $(WIN_CANVAS_SIZE)
@$(foreach theme,$(THEMES), python3 build.py -p "$(bitmaps_dir)/macOSBigSur-$(theme)" --xsizes $(X_SIZES) --win-size $(WIN_SIZE) --win-canvas-size $(WIN_CANVAS_SIZE);)
build_monterey: build.py
@python3 build.py -p "$(bitmaps_dir)/macOSMonterey" --xsizes $(X_SIZES) --win-size $(WIN_SIZE) --win-canvas-size $(WIN_CANVAS_SIZE)
@$(foreach theme,$(THEMES), python3 build.py -p "$(bitmaps_dir)/macOSMonterey-$(theme)" --xsizes $(X_SIZES) --win-size $(WIN_SIZE) --win-canvas-size $(WIN_CANVAS_SIZE);)


build_unix: build_bigsur_unix
build_unix: build_bigsur_unix build_monterey_unix
build_bigsur_unix: build.py
@python3 build.py unix -p "$(bitmaps_dir)/macOSBigSur" --xsizes $(X_SIZES)
@$(foreach theme,$(THEMES), python3 build.py unix -p "$(bitmaps_dir)/macOSBigSur-$(theme)" --xsizes $(X_SIZES);)
build_monterey_unix: build.py
@python3 build.py unix -p "$(bitmaps_dir)/macOSMonterey" --xsizes $(X_SIZES)
@$(foreach theme,$(THEMES), python3 build.py unix -p "$(bitmaps_dir)/macOSMonterey-$(theme)" --xsizes $(X_SIZES);)


build_windows: build_bigsur_windows
build_windows: build_bigsur_windows build_monterey_windows
build_bigsur_windows: build.py
@python3 build.py windows -p "$(bitmaps_dir)/macOSBigSur" --win-size $(WIN_SIZE) --win-canvas-size $(WIN_CANVAS_SIZE)
@$(foreach theme,$(THEMES), python3 build.py windows -p "$(bitmaps_dir)/macOSBigSur-$(theme)" --win-size $(WIN_SIZE) --win-canvas-size $(WIN_CANVAS_SIZE);)
build_monterey_windows: build.py
@python3 build.py windows -p "$(bitmaps_dir)/macOSMonterey" --win-size $(WIN_SIZE) --win-canvas-size $(WIN_CANVAS_SIZE)
@$(foreach theme,$(THEMES), python3 build.py windows -p "$(bitmaps_dir)/macOSMonterey-$(theme)" --win-size $(WIN_SIZE) --win-canvas-size $(WIN_CANVAS_SIZE);)

0 comments on commit 281bc18

Please sign in to comment.