My Current Zsh Theme
So, recently I began using the Zsh for the first time and surprisingly the switch from Bash to the Zsh has been pretty smooth. I discovered an awesome community driven framework, oh-my-zsh, that helps in managing your zsh configurations. I was playing with one particular theme called pygmalion and it looked pretty neat. It utilized the git features when you add git as one of the plugins.
![]()
If the git project, is dirty, it adds a lightning icon to notify you.
![]()
Nowadays, for projects, i am forced to use svn, so thought it would be cool to add something similar for svn.
![]()
Apparently, if you add svn as one of the plugins in your .zshrc, you can then add the following to your theme file and get something similar for svn projects.
BATTERY PERCENT IN PROMPT:
For people who mostly work in terminals, and on battery power, I thought it would be useful to show the battery percentage in your prompt. So, i added some code in the theme that would display the battery percentage in the prompt, only if the laptop is running on battery power. Also, made it so that battery percentage changes from green to yellow to red depending on the battery left.
Battery Percentage shows green when 60% <battery life < 100%
![]()
Battery Percentage shows yellow when 15 % <battery life < 60%
![]()
Battery Percentage shows red when battery life < 15 %.
![]()
The battery status code is show below. Basically I am just getting the battery percent and battery status. Battery status can be, Charging, Discharging etc. Depending on the percent i specify the color for batt:${BATTPRCNT}. And i only show the battery percent if the battery is discharging. I did not see the use of showing the battery percent in the prompt if the laptop was charged, but you can change it according to your needs.
If you want to try using this theme, just fork https://github.com/milin/oh-my-zsh. and copy the theme milind.zsh-theme into your ~/.oh-my-zsh theme folder.