Skip to content

Commit

Permalink
Merge pull request #26 from ful1e5/dev
Browse files Browse the repository at this point in the history
🎉 Version 1.0.3 Merge Request
  • Loading branch information
ful1e5 authored Aug 30, 2020
2 parents 66503e3 + a3f073c commit 56033f8
Show file tree
Hide file tree
Showing 117 changed files with 801 additions and 601 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,23 @@ jobs:
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
continue-on-error: false

- name: Generating `macOS Big Sur` Cursor Theme
- name: Generating `macOSBigSur` Cursor Theme
run: python build.py

- name: Uploading `macOSBigSur` Build Log artifact
uses: actions/upload-artifact@v2
with:
name: logs
path: build.log

- name: Uploading `bitmaps` artifact
uses: actions/upload-artifact@v2
with:
name: bitmaps
path: bitmaps/*

- name: Uploading `macOS Big Sur` Packages artifact
- name: Uploading `macOSBigSur` Theme artifact
uses: actions/upload-artifact@v2
with:
name: macOS Big Sur
path: packages
name: macOSBigSur
path: themes
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
########## Custom
bitmaps
packages
themes

########## Python

Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Color palette Icons Changed to Semi-Circle
- Node Script with `yarn-or-npm` package ([2b026ea](https://github.com/ful1e5/apple_cursor/commit/2b026eab2cb96ff89839176297eacf80b340c7d6))
- Window **Config** Sorted ([acbbea2](https://github.com/ful1e5/apple_cursor/commit/acbbea24238fbfd43b405e4af73cc9f8b0101a59))
- Store actual data in `install.inf` in Windows Cursors.
- Build Logs stored to the `build.log` file
- Out Directories are `themes` and `bitmaps`
- Windows Cursors Package is Redesign
- `config.ts` cleanup

### Added

- Table Of Content in `README.md`([476c64a](https://github.com/ful1e5/apple_cursor/commit/476c64afda50ec48c576b566ce729b575608c529#diff-04c6e90faac2675aa89e2176d2eec7d8))
- Builder Version in `build` script
- Main method in `render`
- Bitmaps **Pixel** check in `Animated Cursors`
- New `utils` for **Frames Save**
- **OCS** Install support **as default** for Linux users

## [1.0.2] - 10 August 2020

Expand All @@ -37,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- CODE_OF_CONDUCT.md
- Quick Install (Windows & Linux) Documents @ [README.md](https://github.com/ful1e5/apple_cursor/blob/master/README.md) ([686bde5](https://github.com/ful1e5/apple_cursor/commit/686bde5eda5c4d913dd8c9df49aa94c20d24d9bf), [f36656d](https://github.com/ful1e5/apple_cursor/commit/f36656d1fbcce5c822d78f5964938daf1ad0c4c0))
- **install.sh** and **windows.inf**(automated installtion files) added in `scripts` directory.
- Table Of Content in `README.md`([476c64a](https://github.com/ful1e5/apple_cursor/commit/476c64afda50ec48c576b566ce729b575608c529#diff-04c6e90faac2675aa89e2176d2eec7d8))

## [1.0.1-beta] - 3 August 2020

Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ bash <(wget -qO- "https://raw.githubusercontent.com/ful1e5/apple_cursor/master/s
</p> -->

```bash
# extract `macOSBigSur.tar`
mkdir macOSBigSur && tar -xvf macOSBigSur.tar -C macOSBigSur
# extract `macOSBigSur.tar.gz`
tar -xvf macOSBigSur.tar.gz

# For local users
mv macOSBigSur ~/.icons/
Expand Down Expand Up @@ -226,6 +226,8 @@ sudo dnf install libx11-devel libxcursor-devel libpng-devel
#### devDependencies

- [@types/puppeteer](https://www.npmjs.com/package/@types/puppeteer)
- [@types/pngjs](https://www.npmjs.com/package/@types/pngjs)
- [@types/pixelmatch](https://www.npmjs.com/package/@types/pixelmatch)
- [nodemon](https://www.npmjs.com/package/nodemon)
- [ts-node](https://www.npmjs.com/package/ts-node)
- [tslint](https://www.npmjs.com/package/tslint)
Expand All @@ -234,6 +236,8 @@ sudo dnf install libx11-devel libxcursor-devel libpng-devel
#### dependencies

- [puppeteer](https://www.npmjs.com/package/puppeteer)
- [pngjs](https://www.npmjs.com/package/pngjs)
- [pixelmatch](https://www.npmjs.com/package/pixelmatch)

### PyPi Packages

Expand Down Expand Up @@ -270,7 +274,6 @@ deactivate
yarn install # Install all Node Packages
yarn py_install # Install all PyPi Packages
yarn compile # Compile the cursor theme
yarn unpack # To extract`./packages/macOSBigSur.tar` file
```

##### Using npm
Expand All @@ -279,19 +282,18 @@ yarn unpack # To extract`./packages/mac
npm install # Install all Node Packages
npm py_install # Install all PyPi Packages
npm compile # Compile the cursor theme
npm unpack # To extract`./packages/macOSBigSur.tar` file
```

After build `bitmaps` and `packages` directory are generated at project **root**.
After build `bitmaps` and `themes` directory are generated at project **root**.

### Install Build Theme

All builded cursor packages are available inside `packages` directory.
All builded cursor themes are available inside `themes` directory.

#### Linux

```bash
cd ./packages
cd ./themes
rm -rf ~/.icons/macOSBigSur && cp macOSBigSur ~/.icons/ # installing Theme to local user(recommend)
```

Expand Down
1 change: 1 addition & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import log
from clickgen import build_cursor_theme

from config import name, sizes, delay, bitmaps_dir, temp_folder
Expand Down
36 changes: 18 additions & 18 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
import json

# Build Config
delay = 35
delay = 50
name = "macOSBigSur"
sizes = [24, 28, 32, 40, 48, 56, 64, 72, 80, 88, 96]

bitmaps_dir = "./bitmaps"
package_dir = "./themes"
temp_folder = tempfile.mkdtemp()

# Cleanup Configs
Expand All @@ -20,26 +21,25 @@

# Windows Cursors Config
windows_cursors = {
"all-scroll.cur": "move.cur",
"bd_double_arrow.cur": "diagonal-resize-1.cur",
"bottom_left_corner.cur": "diagonal-resize-2.cur",
"bottom_side.cur": "vertical-resize.cur",
"circle.cur": "unavailable.cur",
"crosshair.cur": "precision-select.cur",
"dnd-ask.cur": "help-select.cur",
"hand2.cur": "link-select.cur",
"left_ptr.cur": "normal-select.cur",
"left_ptr_watch.ani": "working-in-background.ani",
"pencil.cur": "handwriting.cur",
"right_side.cur": "horizontal-resize.cur",
"sb_up_arrow.cur": "alt-select.cur",
"wait.ani": "busy.ani",
"x_cursor.cur": "pirate.cur",
"xterm.cur": "text-select.cur"
"left_ptr_watch.ani": "AppStarting.ani",
"left_ptr.cur": "Arrow.cur",
"crosshair.cur": "Cross.cur",
"hand2.cur": "Hand.cur",
"pencil.cur": "Handwriting.cur",
"dnd-ask.cur": "Help.cur",
"xterm.cur": "IBeam.cur",
"circle.cur": "NO.cur",
"all-scroll.cur": "SizeAll.cur",
"bd_double_arrow.cur": "SizeNESW.cur",
"sb_v_double_arrow.cur": "SizeNS.cur",
"fd_double_arrow.cur": "SizeNWSE.cur",
"sb_h_double_arrow.cur": "SizeWE.cur",
"sb_up_arrow.cur": "UpArrow.cur",
"wait.ani": "Wait.ani",
}

# Windows install.inf file content
with open("./scripts/windows.inf") as f:
data = f.read()
window_install_inf = data.replace(
window_install_inf_content = data.replace(
"<inject_theme_name>", name+" Cursors").replace("<inject_author_name>", author)
20 changes: 3 additions & 17 deletions helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import json
import sys

from config import name, temp_folder, bitmaps_dir, win_out, x11_out, window_install_inf, windows_cursors
from config import name, temp_folder, bitmaps_dir, win_out, x11_out, window_install_inf_content, windows_cursors, package_dir
from os import path, listdir, rename, remove


package_dir = "./packages"
x11_out_dir = path.join(package_dir, x11_out)
win_out_dir = path.join(package_dir, win_out)

Expand All @@ -26,7 +25,7 @@ def window_bundle() -> None:
# creating install.inf file
install_inf_path = path.join(win_out_dir, "install.inf")
with open(install_inf_path, "w") as file:
file.write(install_inf_path)
file.write(window_install_inf_content)


def init_build() -> None:
Expand All @@ -37,7 +36,7 @@ def init_build() -> None:
with open("./package.json", "r") as package_file:
data = json.loads(package_file.read())
version = data['version']
print("⚡ Build Version %s" % version)
print("⚡ Apple Cursor Version %s" % version)

# cleanup old packages
if path.exists(package_dir):
Expand All @@ -60,16 +59,3 @@ def pack_it() -> None:

# create install.inf file in Windows Theme
window_bundle()

# Packaging
# - .tar archive for X11
# - .zip archive for Windows
shutil.make_archive(x11_out_dir, "tar", x11_out_dir)
shutil.make_archive(win_out_dir, "zip", win_out_dir)

# Clenaup
shutil.rmtree(temp_folder)
for f in listdir(package_dir):
f_path = path.join(package_dir, f)
if path.isdir(f_path):
shutil.rmtree(f_path)
6 changes: 6 additions & 0 deletions log.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env python

import logging

logging.basicConfig(filename='build.log', filemode='w',
format='%(name)s - %(levelname)s - %(message)s', level=logging.DEBUG)
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"name": "apple_cursor",
"version": "1.0.2",
"version": "1.0.3",
"description": "Enjoy upcoming `macOS Big Sur` Cursor Theme 🥳",
"main": "index.js",
"scripts": {
"install:clean": "sudo rm -rf ~/.icons/macOSBigSur /usr/share/icons/macOSBigSur",
"unpack": "cd ./packages && mkdir macOSBigSur && tar -xvf macOSBigSur.tar -C macOSBigSur && cd ..",
"compile": "yon clean && yon render && yon build",
"clean": "rm -rf packages bitmaps",
"clean": "rm -rf bitmaps themes",
"dev": "nodemon src/index.ts",
"watch": "nodemon --inspect src/index.ts",
"py_install": "pip install -r requirements.txt",
"render": "npx ts-node src/index.ts",
"build": "python build.py",
"dev": "nodemon src/index.ts",
"dev:debug": "nodemon --inspect src/index.ts",
"py_install": "pip install -r requirements.txt"
"compile": "yon clean && yon render && yon build"
},
"repository": "[email protected]:ful1e5/apple_cursor.git",
"author": "Kaiz Khatri",
Expand All @@ -27,6 +25,10 @@
"yarn-or-npm": "^3.0.1"
},
"dependencies": {
"@types/pixelmatch": "^5.2.1",
"@types/pngjs": "^3.4.2",
"pixelmatch": "^5.2.1",
"pngjs": "^5.0.0",
"puppeteer": "^5.2.1"
}
}
26 changes: 12 additions & 14 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ INPUT=$1

ROOT_UID=0
DEST_DIR=
URL="https://github.com/ful1e5/apple_cursor/releases/download/1.0.2/macOSBigSur.tar"
URL="https://github.com/ful1e5/apple_cursor/releases/download/1.0.3/macOSBigSur.tar.gz"
macOSBigSur="./macOSBigSur"
DOWNLOAD_FILE_NAME="$macOSBigSur.tar"
DOWNLOAD_FILE_NAME="$macOSBigSur.tar.gz"

cd "$( dirname "${BASH_SOURCE[0]}" )" || exitt

Expand Down Expand Up @@ -45,13 +45,13 @@ end() {
# -------------------- Helpers --------------------
continue() {
case ${INPUT} in
'-a' )
( '-a' )
:
;;
'-h' )
( '-h' )
echo " -a - Auto-install for all users!"
;;
* )
( * )
show_question "\nDo you want to continue? (Y)es, (N)o : \n"
read INPUT
case $INPUT in
Expand Down Expand Up @@ -101,13 +101,11 @@ function download {
function unpack {
echo -e "\nUnpacking Theme..."
file=$1
dir=${file%.*}

echo "$dir"
# creating dir and extract .tar file content to it
mkdir "$dir" && tar -xvf "$file" -C "$dir"
# extract .tar.gz file content to it
tar -xvf "$file"

# remove .tar file
# remove .tar.gz file
rm -rf $file

if [ $? -eq 0 ]; then
Expand All @@ -121,7 +119,7 @@ install() {

# Cecking old version exits or not
if [ -f "$DOWNLOAD_FILE_NAME" ] || [ -f "$macOSBigSur" ]; then
echo -e "\nmacOSBigSur.tar file already exists"
echo -e "\nmacOSBigSur.tar.gz file already exists"
show_question "\nDownload Fresh Theme OR Continue with existing file? (D)ownload File (recommended), (E)xisting File : \n "
read INPUT
case $INPUT in
Expand Down Expand Up @@ -198,13 +196,13 @@ remove() {
main() {
# Cases
case ${INPUT} in
'-a' )
( '-a' )
install
;;
'-h' )
( '-h' )
echo " -a - Auto-install for all users!"
;;
* )
( * )
show_question "What you want to do: (I)nstall, (R)emove : \n"
read INPUT
case $INPUT in
Expand Down
Loading

0 comments on commit 56033f8

Please sign in to comment.