mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Merge branch 'master' of git://github.com/peterhoeg/oh-my-zsh
This commit is contained in:
commit
82840ba66d
2 changed files with 12 additions and 6 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
if [[ $(acpi | grep -c ^Battery) -gt 0 ]] ; then
|
if [[ $(acpi 2&>/dev/null | grep -c ^Battery) -gt 0 ]] ; then
|
||||||
function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
|
function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
|
||||||
function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
|
function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
|
||||||
function battery_pct_prompt() { echo "%{$fg[red]%}[$(battery_pct_remaining)]%{$reset_color%}" }
|
function battery_pct_prompt() { echo "%{$fg[red]%}[$(battery_pct_remaining)]%{$reset_color%}" }
|
||||||
|
|
@ -6,4 +6,5 @@ else
|
||||||
error_msg='no battery'
|
error_msg='no battery'
|
||||||
function battery_pct_remaining() { echo $error_msg }
|
function battery_pct_remaining() { echo $error_msg }
|
||||||
function battery_time_remaining() { echo $error_msg }
|
function battery_time_remaining() { echo $error_msg }
|
||||||
|
function battery_pct_prompt() { echo '' }
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,13 @@ if [ -d $rbenvdir ] ; then
|
||||||
alias rubies="rbenv versions"
|
alias rubies="rbenv versions"
|
||||||
alias gemsets="rbenv gemset list"
|
alias gemsets="rbenv gemset list"
|
||||||
|
|
||||||
current_ruby=$(rbenv version | cut -f1 -d ' ')
|
function current_ruby() {
|
||||||
current_gemset=$($benv gemset active 2&>/dev/null | grep -v 'no active gemsets')
|
echo "$(rbenv version | cut -f1 -d ' ')"
|
||||||
|
}
|
||||||
|
|
||||||
|
function current_gemset() {
|
||||||
|
echo "$(rbenv gemset active 2&>/dev/null | grep -v 'no active gemsets')"
|
||||||
|
}
|
||||||
|
|
||||||
function gems {
|
function gems {
|
||||||
local rbenv_path=$(rbenv prefix)
|
local rbenv_path=$(rbenv prefix)
|
||||||
|
|
@ -19,10 +24,10 @@ if [ -d $rbenvdir ] ; then
|
||||||
}
|
}
|
||||||
|
|
||||||
function rbenv_prompt_info() {
|
function rbenv_prompt_info() {
|
||||||
if [[ -n $current_gemset ]] ; then
|
if [[ -n $(current_gemset) ]] ; then
|
||||||
echo "${current_ruby}@${current_gemset}"
|
echo "$(current_ruby)@$(current_gemset)"
|
||||||
else
|
else
|
||||||
echo "${current_ruby}"
|
echo "$(current_ruby)"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue