diff options
| -rwxr-xr-x | .zshrc | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -224,7 +224,7 @@ alien_prompt_section_prompt() { ) } -alien_battery_stat(){ # overrides the default implementation +alien_battery_stat(){ __os=$(uname) if [[ ${__os} = "Linux" ]]; then if command -v upower > /dev/null 2>&1 ; then @@ -243,6 +243,19 @@ alien_battery_stat(){ # overrides the default implementation unset __os __bat_power __bat_power_ind __bat_per } +alien_prompt_section_battery() { + local __to_return=" " + if [ $(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep state) ]; then + __to_return=" $(alien_battery_stat) " + fi + __section=( + content $__to_return + foreground $ALIEN_SECTION_BATTERY_FG + background $ALIEN_SECTION_BATTERY_BG + separator 1 + ) +} + # ------------------------------------------------------------------------------ # Aliases # ------------------------------------------------------------------------------ @@ -278,3 +291,4 @@ if [[ -x "$(command -v vimx)" ]]; then alias vim='vimx'; fi alias v="vim" alias cdp="cd ~/Programming/GitHub-repos/" + |
