Last active
December 27, 2015 07:48
-
-
Save unstabler/7291276 to your computer and use it in GitHub Desktop.
oh my zsh theme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.014; | |
use strict; | |
my $switch = $ARGV[0]; | |
my $battery_state = `acpi`; | |
if ($battery_state =~ m{Battery \d: (?<status>\w+), (?<percentage>\d+)}) { | |
my ($status, $percentage); | |
$percentage = $+{percentage}; | |
if ($+{status} =~ /(Full|Charging|Unknown)/) {#!/usr/bin/env perl | |
use 5.014; | |
use strict; | |
my $switch = $ARGV[0]; | |
my $battery_state = `acpi`; | |
if ($battery_state =~ m{Battery \d: (?<status>\w+), (?<percentage>\d+)}) { | |
my ($status, $percentage); | |
$percentage = $+{percentage}; | |
if ($+{status} =~ /(Full|Charging|Unknown)/) { | |
$status = '⚡'; | |
} else { | |
$status = '☀' if $+{percentage} >= 70; | |
$status = '☼'if $+{percentage} < 70; | |
$status = '☁'if $+{percentage} < 50; | |
$status = '☔' if $+{percentage} < 30; | |
$status = '☹'if $+{percentage} < 10; | |
} | |
printf("%s]─[%d", $status, $percentage); | |
} | |
$status = '⚡'; | |
} else { | |
$status = '☀' if $+{percentage} >= 70; | |
$status = '☼'if $+{percentage} < 70; | |
$status = '☁'if $+{percentage} < 50; | |
$status = '☔' if $+{percentage} < 30; | |
$status = '☹'if $+{percentage} < 10; | |
} | |
printf("%s]─[%d", $status, $percentage); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROMPT='[%(?.%{$fg_bold[green]%} OK .%{$fg_bold[red]%}fail)%{$reset_color%}]─[%{$fg_bold[yellow]%}%n@%m%{$reset_color%} : %{$fg_bold[blue]%}%~%{$reset_color%}]─[$(_battery_status)%%] | |
$(git_prompt_info)'"' ')> " | |
RPROMPT='[%T%{$reset_color%}]' | |
ZSH_THEME_GIT_PROMPT_PREFIX="[%{$fg[cyan]%}git:(%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="] %{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[cyan]%})%{$fg_bold[yellow]%}!%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[cyan]%})%{$reset_color%}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment