Home

Awesome

<h1 align="center"> <a href="https://github.com/snakypy/zshpower"> <img alt="ZSHPower" src="https://raw.githubusercontent.com/snakypy/assets/master/zshpower/images/zshpower-transparent.png" width="auto"> </a> </h1> <h1 align="center"> A powerful theme for ZSH </h1>

Tests Python Versions Updates Python Whell PyPI PyPI - Implementation Isort Mypy Code style: Black PyPI - Downloads GitHub license


<div align="center"> <h4> | <a href="#features">Features</a> | <a href="#requirements">Requirements</a> | <a href="#pre-install">Pre-Install</a> | <a href="#installing">Install</a> | <a href="#post-install">Post-Install</a> | <a href="#theme-configuration">Theme configuration</a> | <a href="#reset-settings">Reset settings</a> | <a href="#upgrading">Upgrade</a> | <a href="#syncronize">Syncronize</a> | <a href="#deactivate-and-activate-theme-for-oh-my-zsh">Deactivate/Activate for Oh My ZSH</a> | <a href="#uninstalling">Uninstall</a> | <a href="#donation">Donation</a> | </h4> <h5> | <a href="#more-commands">More Commands</a> | </h5> </div> <div align="center"> <sub>Built with ❤︎ by: <a href="https://williamcanin.github.io" target="_blank">William Canin</a> in free time, to the sound of the playlist: <a href="https://open.spotify.com/playlist/48brJJZdVifY79QAFmEImq?si=GmsvfKqATpG4p72ZeVClIQ" target="_blank">Bursting Of The Tympanum</a></sub> </div> <br> <br>

ZSHPower is a theme for ZSH; especially for the developer of various programming languages and users Linux and macOS. Pleasant to look at, the ZSHPower comforts you with its vibrant colors and icons.

Installing ZSHPower is the easiest thing you will see in any existing theme for ZSH, because there is a manager.

The changes in the theme become more dynamic through a configuration file, where the user can make various combinations for the style of ZSHPower.

The ZSHPower supports installation along with Oh My ZSH, where changes to: enable and disable an Oh My ZSH theme are easier, all in a simplified command line, without opening any files or creating symbolic links.

In addition, the ZSHPower manager downloads Oh My Zsh and the zsh-autosuggestions and zsh-syntax-highlighting plugins automatically, everything to make your ZSH very power.

<div align="center"> <sub><strong>Note:</strong> While this project is in beta, it will present some difficulties in terms of performance. Currently a prototype.</sub> </div> <br> <br>

Here is an example of the installed ZSHPower:

<p align="center"> <img alt="ZSHPower in Terminator" src="https://raw.githubusercontent.com/snakypy/assets/master/zshpower/demo/gifs/example-zshpower.gif" width="980px"> </p>

Contributions

Features

*features if used with Oh My ZSH.

Requirements

To work correctly, you will first need:

Pre install

1 - Install the required packages in your distribution:

Arch Linux and derivatives

sudo pacman -S zsh vim curl git sqlite python python-pip

Debian and derivatives

sudo apt update
sudo apt install zsh vim curl git sqlite3 python3 python3-pip python3-venv

Fedora and derivatives

sudo dnf update
sudo dnf install zsh vim curl git sqlite python3 python3-pip util-linux-user

2 - Adding user's bin path to PATH:

Linux:

export PATH=$PATH:$HOME/.local/bin

macOS:

py_version=$(python3 -c 'import sys; sys.stdout.write(f"{sys.version_info[0]}.{sys.version_info[1]}")')
export PATH=$PATH:$HOME/Library/Python/${py_version}/bin

2.1 - Switch from Bash to Zsh and export PATH's (Optional):

sudo chsh -s /usr/bin/zsh $(whoami)
exec zsh
export PATH="$PATH:$HOME/.local/bin"

Note: By default, ZSHPower already performs this step at configuration time.

Installing

1 - It's time to install ZSHPower manager. To do this, do:

NOTE: Global installation is not recommended. The easiest and most convenient way to use ZSHPower is to install for each different user on the machine, including for the super user (root)

$ python3 -m pip install zshpower --user -U

NOTE: If you are installing to the user's local environment, be sure to add the environment variables to the zshrc file.

2 - After installing ZSHPower, you need to generate the configuration files, how you will use ZSHPower. You basically have two ways to use ZSHPower. The first is to use independently, and the second is to use with Oh My ZSH.

To use independently, without any framework, do:

$ zshpower init

NOTE: This option you will have to add the following code to the .zshrc file.

eval $(zshpower init --path)

If you want to use it with Oh My ZSH and, to make ZSHPower more powerfull, do:

$ zshpower init --omz

Post-Install

The ZSHPower project uses the "Nerd Font". You must install any of these fonts to terminally recognize the symbols.

However, by default, ZSHPower already downloads the font DejaVuSansMono Nerd Font in the folder ($HOME/.fonts) of user fonts using Linux system.

Editors, IDE and Terminal

After install ZSHPower and the DejaVuSansMono Nerd Font, you must configure your text editor and terminal to recognize the icons used by the ZSHPower.

Visual Studio Code:

Add the font family in Visual Studio Code, opening the global settings for Visual Studio Code and add this information:

{
	"terminal.integrated.fontFamily": "'<Your main source>', 'DejaVuSansMono Nerd Font'"
}

Atom:

For the Atom editor, there are no secrets either. In the family font settings, do:

editor:
    fontFamily: "Menlo, Consolas, DejaVu Sans Mono, monospace, DejaVuSansMono Nerd Font"

PyCharm:

For PyCharm, you must make the following font settings:

File > Settings > Editor > Color Schema > Console Font > Font: DejaVuSansMono Nerd Font

Terminator:

If you use Terminator as the default terminal, change its font to the DejaVuSansMono Nerd Font Book font.

For other terminals, do the same, changing the font to DejaVuSansMono Nerd Font Book.

NOTE: You can install any font from "Nerd Font". They are compatible with the ZSHPower.

Theme configuration

About

ZSHPower allows you to open its settings in the terminal itself using vim, nano or emacs. After exiting the editor, ZSHPower will reload the settings in case there are any changes, it will take effect.

$ zshpower config --open

In the keys containing the call "color", you must enter a color that is in accordance with Ansi Escape Color . By default, the supported values are:

black|white|blue|red|cyan|magenta|green|yellow

The "enable" keys must receive Boolean values supported by TOML. The values for these keys are true or false (In lower case).

The symbol keys, receive icons or their values in Unicode. By default, the icons will only be shown via localhost, if the connection is via SSH, the icons will be disabled.

Configuration file

The configuration file is found in $HOME/.zshpower/config/zshpower.toml.

By default, most settings are set to false.

The ZSHPower configuration file is very intuitive, and just a glance gives you an idea of what each option does. But even so, note some of the main keys:

Synchronize

ZSHPower stores some information in a database (SQLite 3) to obtain better performance and speed in the display of data. This data is currently the versions of the applications that ZSHPower shows on the console. Before, ZSHPower showed this information in real time, but it compromised performance and display time.

With that, every time you update the program you work on (or even the entire system), you need to synchronize. To synchronize you have two options, the first is manual and the other automatically using a task scheduler, such as Cronie.

Sync manually:

$ zshpower sync

If you always want manual synchronization, it would be interesting whenever you update the system or a particular package that ZSHPower supports, add the synchronization command as well. For example:

# Debian and derivatives
$ sudo apt upgrade && zshpower sync
# Arch Linux and derivatives
$ sudo pacman -Syu && zshpower sync
# Fedora and derivatives
$ sudo dnf update && zshpower sync

Automatically sync:

IMPORTANT: Only if you have root permission.

ZSHPower has an option to create the task for database synchronization. This option is via the command:

zshpower cron --create

With this command, a ZSHPower task will be created in Cron, however you need to have Cron installed and have superuser (root) permission to perform the task creation, otherwise, nothing will happen.

By default, the task is created with comment, and you will have to set the values. For this, ZSHPower provides a command to open the Cron task file, with the command:

zshpower cron --open

As stated before, you can use a task scheduler. Just access Cron to schedule a task at any time and call this script. You can use the Crontab Guru website to make it easier to understand Cron.

You can get more information about Cron through sample sites like these:

or use the Crontab main:

$ man crontab

An example using the Cronie scheduling synchronization every 2 hours:

Create or changing a file (with superuser)/etc/cron.d/zshpower and put the following line

# ZSHPower Task - BEGIN
SHELL=/bin/zsh
PATH=/home/<USER>/.local/bin:/bin:/usr/local/bin:$PATH
export PATH
# Every 2 hours
0 */2 * * * <USER> zshpower sync
# ZSHPower Task - END

In <USER> put the logged in user on the machine.

Upgrading

If ZSHPower has any new features, please update the command line below:

$ python3 -m pip install zshpower --user -U
$ zshpower init [--omz]

Reset settings

If you made any changes to the configuration file and regretted it, you can reset everything with the command below:

$ zshpower reset --config

You can also reset the ZSHPower database if it is corrupted with the command below:

$ zshpower reset --db

Deactivate and Activate theme for Oh My ZSH

You can activate and deactivate ZSHPower at any time, without opening any files, if using with Oh My ZH. To do this, follow the steps below:

$ zshpower deactivate

When deactivate, the manager will return to the default Oh My Zsh theme, the robbyrussell. If you want to deactivate with another theme already installed, use the --theme option. Example:

$ zshpower deactivate --theme=agnoster
$ zshpower activate

Uninstalling

We will be sad if you want to stop using ZSHPower, but for an easier and more effective uninstall, we also have the command:

$ zshpower uninstall

NOTE: If you installed "ZSHPower" with 'sudo', use 'sudo' to uninstall as well.

$ sudo zshpower uninstall

More Commands

For more command information, use:

$ zshpower --help

Donation

Click on the image below to be redirected the donation forms:

<div class="donate"> <a href="https://github.com/snakypy/donations/blob/main/README.md"> <img width="160" height="100" src="https://raw.githubusercontent.com/snakypy/donations/main/svg/donate/donate-hand.svg" alt="Donations"> </a> </div>

License

The project is available as open source under the terms of the MIT License ©

Credits

See, AUTHORS.