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_time_remaining() { echo $(acpi | cut -f3 -d ',') }
|
||||
function battery_pct_prompt() { echo "%{$fg[red]%}[$(battery_pct_remaining)]%{$reset_color%}" }
|
||||
|
|
@ -6,4 +6,5 @@ else
|
|||
error_msg='no battery'
|
||||
function battery_pct_remaining() { echo $error_msg }
|
||||
function battery_time_remaining() { echo $error_msg }
|
||||
function battery_pct_prompt() { echo '' }
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -6,8 +6,13 @@ if [ -d $rbenvdir ] ; then
|
|||
alias rubies="rbenv versions"
|
||||
alias gemsets="rbenv gemset list"
|
||||
|
||||
current_ruby=$(rbenv version | cut -f1 -d ' ')
|
||||
current_gemset=$($benv gemset active 2&>/dev/null | grep -v 'no active gemsets')
|
||||
function current_ruby() {
|
||||
echo "$(rbenv version | cut -f1 -d ' ')"
|
||||
}
|
||||
|
||||
function current_gemset() {
|
||||
echo "$(rbenv gemset active 2&>/dev/null | grep -v 'no active gemsets')"
|
||||
}
|
||||
|
||||
function gems {
|
||||
local rbenv_path=$(rbenv prefix)
|
||||
|
|
@ -19,10 +24,10 @@ if [ -d $rbenvdir ] ; then
|
|||
}
|
||||
|
||||
function rbenv_prompt_info() {
|
||||
if [[ -n $current_gemset ]] ; then
|
||||
echo "${current_ruby}@${current_gemset}"
|
||||
if [[ -n $(current_gemset) ]] ; then
|
||||
echo "$(current_ruby)@$(current_gemset)"
|
||||
else
|
||||
echo "${current_ruby}"
|
||||
echo "$(current_ruby)"
|
||||
fi
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue