Skip to content

Commit

Permalink
Merge pull request #51 from KaizIqbal/test
Browse files Browse the repository at this point in the history
Test Branch
  • Loading branch information
ful1e5 authored Dec 22, 2019
2 parents d3d40d2 + 3e68873 commit 1c98702
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 88 deletions.
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ Bibata is **OpenSource** ,Compact and Material Designed Cursor set.This project

- [git](https://git-scm.com/)
- [python3](https://www.python.org/)
- [pip](https://pypi.org/project/pip/)
- [pip](https://pypi.org/project/pip/)/[python-pillow](https://www.archlinux.org/packages/community/x86_64/python-pillow/)
- [Inkscape](https://inkscape.org/)
- [Xcursorgen](https://www.x.org/releases/X11R7.7/doc/man/man1/xcursorgen.1.xhtml)

### Install dependencies

**📝Note**: Snap/Flatpak packages raise issue in build(e.g. inkscape).

##### Debain/Ubuntu

```
Expand All @@ -77,13 +79,34 @@ sudo apt install git python3 python3-pip inkscape x11-apps
sudo dnf install git python37 python3-pip inkscape xcursorgen
```

##### ArchLinux/Manjaro
##### ArchLinux

```
sudo pacman -S git python python-pip inkscape xorg-xcursorgen
# Packages
sudo pacman -S git python inkscape xorg-xcursorgen
# AUR package with yaourt
yaourt -S python-pillow
```

**📝Note**: Snap/Flatpak packages raise issue in build(e.g. inkscape).
##### Manjaro

**📝Note**: enable AUR in ManjaroLinux for [python-pillow](https://www.archlinux.org/packages/community/x86_64/python-pillow/)

```
pamac install git python python-pillow inkscape xorg-xcursorgen
```

Install `python-pip` package in case python-pillow cause error or not installed on your arch based distro.

```
# Archlinux
sudo pacman -S python-pip
# Manjaro
pamac python-pip
```

## Install

Expand Down
177 changes: 101 additions & 76 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
#
#Bibata Build
#
#Released under the GNU General Public License, version 3.
#Author : KAiZ
#

# Bibata Build

# Released under the GNU General Public License, version 3.
# Author : KAiZ


echo -e "\n"
echo -e " ██████╗ ██╗██████╗ █████╗ ████████╗ █████╗ "
Expand All @@ -15,8 +15,8 @@ echo -e " ██████╔╝██║██████╔╝██║
echo -e " ╚═════╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ "
echo -e "\n"

#functions
#Color print function
# functions
# Color print function
show_Msg() {
echo -e "\033[1;37m$@\033[0m"
}
Expand Down Expand Up @@ -58,20 +58,20 @@ selectWithDefault() {
}

build(){
#get name of theme by argument
# get name of theme by argument
cursor=$1

#building cursor with python script
show_pre "\n"$cursor" : Generating bitmaps...\\r"
# building cursor with python script
show_pre "\n "$cursor" : 🏃 Generating bitmaps...\\r"

# if cursors source folder & file doesn't exist
if [ ! "src/"$cursor"/source-cursors.svg" ];
then
error "\n"$cursor" : Source not found"
error "\nAborting..."
error "\n "$cursor" : 😔 Source not found"
error "\n Aborting..."
exit 1
else
#for removing old build bitmaps(Not Recommended)
# for removing old build bitmaps(Not Recommended)
# if [ "$cursor" ];
# then
# show_pre "\nRemoving Old Build Files...\\r"
Expand All @@ -87,144 +87,169 @@ build(){
# fi
# fi

#-o for genrating hotspots
#-a for genrating config files
# -o for genrating hotspots
# -a for genrating config files
python render-cursors.py ./src/"$cursor"/source-cursors.svg -o -a --name $cursor
# $? = is the exit status of the most recently-executed command; by convention, 0 means success and anything else indicates failure.
if [ $? -eq 0 ]
then
show ""$cursor" : Generating bitmaps... DONE"
show " "$cursor" : 🙂 Generating bitmaps... DONE"
else
error ""$cursor" : Generating bitmaps... FAIL"
error "\nAborting..."
error " "$cursor" : 😔 Generating bitmaps... FAIL"
error "\n Aborting..."
exit 1
fi
show_pre "\n"$cursor" : Tweaking Animation...\\r"
show_pre "\n "$cursor" : Tweaking Animation...\\r"

sh tweak.sh "$cursor"

if [ $? -eq 0 ]
then
show ""$cursor" : Tweaking Animation... DONE"
show " "$cursor" : 💖 Tweaking Animation... DONE"
else
error ""$cursor" : Tweaking Animation... FAIL"
error "\nAborting..."
error " "$cursor" : 😔 Tweaking Animation... FAIL"
error "\n Aborting..."
exit 1
fi
show_pre "\n"$cursor" : Building X11 cursor...\\r"
#execute x11-make.sh file with theme_name argument
show_pre "\n "$cursor" : 📨 Building X11 cursor...\\r"
# execute x11-make.sh file with theme_name argument
sh x11-make.sh "$cursor"
#Copy .index files to out/$cursor
# Copy .index files to out/$cursor
cp src/"$cursor"/*.theme "$cursor"/out/X11/"$cursor"
if [ $? -eq 0 ]
then
show ""$cursor" : Building X11 cursor... DONE"
echo "OUT: $PWD/$cursor/out/X11"
show " "$cursor" : 📦 Building X11 cursor... DONE"
echo " OUT: $PWD/$cursor/out/X11"
else
error ""$cursor" : Building X11 cursor... FAIL"
error " "$cursor" : 😔 Building X11 cursor... FAIL"
error "\nAborting..."
exit 1
fi

show_pre "\n"$cursor" : Building Window cursor...\\r"
#execute x11-make.sh file with theme_name argument
show_pre "\n "$cursor" : 📨 Building Window cursor...\\r"
# execute x11-make.sh file with theme_name argument
sh w32-make.sh "$cursor"
if [ $? -eq 0 ]
then
show ""$cursor" : Building Window cursor... DONE"
echo "OUT: $PWD/$cursor/out/win"
show " "$cursor" : 📦 Building Window cursor... DONE"
echo " OUT: $PWD/$cursor/out/win"
else
error ""$cursor" : Building Window cursor... FAIL"
error "\nAborting..."
error " "$cursor" : 😔 Building Window cursor... FAIL"
error "\n Aborting..."
exit 1
fi
fi

}
installer(){
show_pre "Generating Installer...\\r"
show_pre "Generating Installer...\\r"

if [ "src/in.inst" ]; then
cp src/install install.sh
fi

if [ $? -eq 0 ]
then
show "Generating Installer... DONE"
show " 💌 Generating Installer... DONE"
else
error "Generating Installer... FAIL"
error " 💔 Generating Installer... FAIL"
error "\nAborting..."
exit 1
fi

show_pre "Making Installer Executable...\n"
show_pre " 😍 Making Installer Executable...\n"

if [ "install.sh" ]; then
sudo chmod +x install.sh
fi

if [ $? -eq 0 ]
then
show "Making Installer Executable... DONE"
show_Msg "For Installation Use Following Command:\n"
show " 😎 Making Installer Executable... DONE"
show_Msg " 🌈 For Installation Use Following Command:🚀 \n "
show_Msg "\t sudo ./install.sh\n\t\tOR\n\t./install.sh"
show_Msg "\n🎉 BUILD COMPLETE! 🎉"
else
error "Making Installer Executable... FAIL"
error "\nAborting..."
error " 😐 Making Installer Executable... FAIL"
error "\n Aborting..."
exit 1
fi
}

#main program

#Requirment checking
show_pre "Checking Requirements...\\r"
# main program

if ! type "inkscape" > /dev/null ; then
error "\\nFAIL: inkscape must be installed"
# Requirment checking
show "🔗 Dependencies"
# dependencies must be installed
if type "inkscape" > /dev/null;
then
show_Msg "✅ Inkscape"
else
error "\\n❌ Inkscape"
show " Follow Docs to install build dependencies \n https://github.com/KaizIqbal/Bibata_Cursor#build-dependencies"
exit 1
fi

if ! type "xcursorgen" > /dev/null ; then
error "\\nFAIL: xcursorgen must be installed"
if type "xcursorgen" > /dev/null;
then
show_Msg "✅ Xcursorgen"
else
error "\\n❌ Xcursorgen"
show " Follow Docs to install build dependencies \n https://github.com/KaizIqbal/Bibata_Cursor#build-dependencies"
exit 1
fi

if ! command -v python3 &>/dev/null; then
error "\\nFAIL: python3 must be installed"
if command -v python3 &> /dev/null;
then
show_Msg "✅ Python 3"
else
error "\\n❌ Python 3"
show " Follow Docs to install build dependencies \n https://github.com/KaizIqbal/Bibata_Cursor#build-dependencies"
exit 1
fi

if ! command pip &>/dev/null; then
error "\\nFAIL: pip must be installed"
exit 1
fi
show "Checking Requirements... DONE"
# check pillow is accessible from other package if not pip is require
if python3 -c 'from PIL import Image';
then
show_Msg "✅ Pillow"
show "Pillow requirement already satiesfied 😊"
else
show_Msg "🧐 Installing Pillow with pip"
# python-pillow not found
# python-pillow not found pip must be require
if command pip3 &> /dev/null;
then
show_Msg "✅ PiP 3"
# Install pip requirments
show_pre "Installing PiP Requirements...\\r"

#Install pip requirments
show_pre "Installing PiP Requirements...\\r"
if [ ! "requirements.txt" ];
then
error "\nBibata : requirements.txt not found"
error "\nAborting..."
exit 1
else
show_Msg "💬 Python Requirments installed as user"
pip3 install -r requirements.txt --user
fi

if [ ! "requirements.txt" ];
then
error "\n"$cursor" : requirements.txt not found"
error "\nAborting..."
if [ $? -eq 0 ]
then
show_Msg "✅ Pillow"
else
error "❌ Pillow"
error "\nAborting..."
exit 1
fi
else
error "\\n❌ PiP 3"
show " Follow Docs to install build dependencies \n https://github.com/KaizIqbal/Bibata_Cursor#build-dependencies"
exit 1
else
pip3 install -r requirements.txt --user
fi

if [ $? -eq 0 ]
then
show "Installing PiP Requirements... DONE"
else
error "Installing PiP Requirements... FAIL"
error "\nAborting..."
exit 1
fi
fi


#choice for build cursor
# choice for build cursor
selection "Cursor to build (Default is 'ALL')?"
cursors=("Bibata_Classic" "Bibata_Oil" "Bibata_Ice" "Bibata_Amber" "ALL" exit )
cursor=$(selectWithDefault "${cursors[@]}")
Expand Down
6 changes: 3 additions & 3 deletions tweak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ animate_fix(){
sort -k 4 -o "$path" "$path"
mv -f "$path" "$path.bak"

#j for total size 24,28,32,40,48,56,64,72,80,88,96 = 11
# j for total size 24,28,32,40,48,56,64,72,80,88,96 = 11
for j in {1..11}
do
for i in {1..60}
Expand All @@ -21,7 +21,7 @@ animate_fix(){
# echo "$line"
echo "$line" >> $path

#echo "$line"
# echo "$line"
done
done

Expand All @@ -39,7 +39,7 @@ else
fi


#if script generate error or success
# if script generate error or success
if [ $? -ne 0 ]
then
exit 1
Expand Down
6 changes: 3 additions & 3 deletions w32-make.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh

#get theme name from argument
# get theme name from argument
THEME=$1
#current Directory path
# current Directory path
DIR="../.."

# $@ is for the caller to be able to supply arguments to anicursorgen (-s, in particular)
Expand Down Expand Up @@ -77,7 +77,7 @@ ${GEN} xterm$s.in $DIR/"$THEME"/out/win/xterm.cur
${GEN} zoom-in$s.in $DIR/"$THEME"/out/win/zoom-in.cur
${GEN} zoom-out$s.in $DIR/"$THEME"/out/win/zoom-out.cur

#if script generate error or success
# if script generate error or success
if [ $? -ne 0 ]
then
exit 1
Expand Down
4 changes: 2 additions & 2 deletions x11-make.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh

#get theme name from argument
# get theme name from argument
THEME=$1
#current Directory path
# current Directory path
DIR="../.."

# enter bitmaps folder
Expand Down

0 comments on commit 1c98702

Please sign in to comment.