From 6efad291f4cdaf77081a62b3db3075959eff3170 Mon Sep 17 00:00:00 2001 From: Milind Shakya Date: Thu, 12 Apr 2012 17:16:48 -0500 Subject: [PATCH 1/7] added my version of pygmalion that has battery status info --- themes/pygmalion-batt.zsh-theme | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 themes/pygmalion-batt.zsh-theme diff --git a/themes/pygmalion-batt.zsh-theme b/themes/pygmalion-batt.zsh-theme new file mode 100644 index 000000000..73aff1fd0 --- /dev/null +++ b/themes/pygmalion-batt.zsh-theme @@ -0,0 +1,30 @@ +# Yay! High voltage and arrows! + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ⚡%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +setprompt(){ +if which acpi &> /dev/null; then + local BATTSTATE="$(acpi -b)" + local BATTPRCNT="$(echo ${BATTSTATE[(w)4]}|sed -r 's/(^[0-9]+).*/\1/')" + if [[ -z "${BATTPRCNT}" ]]; then + PR_BATTERY="" + elif [[ "${BATTPRCNT}" -lt 15 ]]; then + PR_BATTERY="${fg[red]} batt:${BATTPRCNT}%%" + elif [[ "${BATTPRCNT}" -lt 60 ]]; then + PR_BATTERY="${fg[yellow]} batt:${BATTPRCNT}%%" + elif [[ "${BATTPRCNT}" -lt 96 ]]; then + PR_BATTERY="${fg[green]} batt:${BATTPRCNT}%%" + else + PR_BATTERY="" + fi + fi + +PROMPT='$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|${PR_BATTERY%}%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} ' +} + + precmd() { PS1= setprompt } + + setprompt From b78de9038db3a6b947c13d24653c419b21e4720b Mon Sep 17 00:00:00 2001 From: Milind Shakya Date: Fri, 13 Apr 2012 13:21:31 -0500 Subject: [PATCH 2/7] added support for svn repos --- themes/milind.zsh-theme | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 themes/milind.zsh-theme diff --git a/themes/milind.zsh-theme b/themes/milind.zsh-theme new file mode 100644 index 000000000..f6e9b0ab1 --- /dev/null +++ b/themes/milind.zsh-theme @@ -0,0 +1,37 @@ +#Added some cool stuff to pygmalion theme +# Yay! High voltage and arrows! + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ⚡%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +ZSH_THEME_SVN_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" +ZSH_THEME_SVN_PROMPT_SUFFIX="%{$reset_color%} " + +ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}" +ZSH_THEME_SVN_PROMPT_CLEAN=" " + +setprompt(){ +if which acpi &> /dev/null; then + local BATTSTATE="$(acpi -b)" + local BATTPRCNT="$(echo ${BATTSTATE[(w)4]}|sed -r 's/(^[0-9]+).*/\1/')" + if [[ -z "${BATTPRCNT}" ]]; then + PR_BATTERY="" + elif [[ "${BATTPRCNT}" -lt 15 ]]; then + PR_BATTERY="${fg[red]} batt:${BATTPRCNT}%%" + elif [[ "${BATTPRCNT}" -lt 60 ]]; then + PR_BATTERY="${fg[yellow]} batt:${BATTPRCNT}%%" + elif [[ "${BATTPRCNT}" -lt 96 ]]; then + PR_BATTERY="${fg[green]} batt:${BATTPRCNT}%%" + else + PR_BATTERY="" + fi + fi + +PROMPT='$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|${PR_BATTERY%}%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)$(svn_prompt_info)%{$reset_color%}%{$fg[cyan]%}⇒%{$reset_color%} ' +} + + precmd() { PS1= setprompt } + + setprompt From 3b868aa50ccf07b328e8c83ddb302c7b902062bc Mon Sep 17 00:00:00 2001 From: Milind Shakya Date: Fri, 13 Apr 2012 13:41:55 -0500 Subject: [PATCH 3/7] Please enter the commit message for your changes. Lines starting --- themes/milind.zsh-theme | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/themes/milind.zsh-theme b/themes/milind.zsh-theme index f6e9b0ab1..2ba538f77 100644 --- a/themes/milind.zsh-theme +++ b/themes/milind.zsh-theme @@ -1,4 +1,3 @@ -#Added some cool stuff to pygmalion theme # Yay! High voltage and arrows! ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" @@ -6,6 +5,8 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ⚡%{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="" +#ZSH_THEME_SVN_PROMPT_PREFIX="svn:(" +#ZSH_THEME_SVN_PROMPT_SUFFIX=")" ZSH_THEME_SVN_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" ZSH_THEME_SVN_PROMPT_SUFFIX="%{$reset_color%} " @@ -22,7 +23,7 @@ if which acpi &> /dev/null; then PR_BATTERY="${fg[red]} batt:${BATTPRCNT}%%" elif [[ "${BATTPRCNT}" -lt 60 ]]; then PR_BATTERY="${fg[yellow]} batt:${BATTPRCNT}%%" - elif [[ "${BATTPRCNT}" -lt 96 ]]; then + elif [[ "${BATTPRCNT}" -lt 100 ]]; then PR_BATTERY="${fg[green]} batt:${BATTPRCNT}%%" else PR_BATTERY="" From 3ebe5cba18297de7cd2e0423a780074ea4368cbb Mon Sep 17 00:00:00 2001 From: Milind Shakya Date: Fri, 13 Apr 2012 13:45:33 -0500 Subject: [PATCH 4/7] battery fix --- themes/milind.zsh-theme | 2 -- 1 file changed, 2 deletions(-) diff --git a/themes/milind.zsh-theme b/themes/milind.zsh-theme index 2ba538f77..75a949c77 100644 --- a/themes/milind.zsh-theme +++ b/themes/milind.zsh-theme @@ -5,8 +5,6 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ⚡%{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="" -#ZSH_THEME_SVN_PROMPT_PREFIX="svn:(" -#ZSH_THEME_SVN_PROMPT_SUFFIX=")" ZSH_THEME_SVN_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" ZSH_THEME_SVN_PROMPT_SUFFIX="%{$reset_color%} " From a73817c66b710857182d38a7bfe592e9cf732d38 Mon Sep 17 00:00:00 2001 From: Milind Shakya Date: Fri, 13 Apr 2012 15:58:56 -0500 Subject: [PATCH 5/7] battery status shows only when discharging --- themes/milind.zsh-theme | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/themes/milind.zsh-theme b/themes/milind.zsh-theme index 75a949c77..bc16825ef 100644 --- a/themes/milind.zsh-theme +++ b/themes/milind.zsh-theme @@ -15,22 +15,29 @@ setprompt(){ if which acpi &> /dev/null; then local BATTSTATE="$(acpi -b)" local BATTPRCNT="$(echo ${BATTSTATE[(w)4]}|sed -r 's/(^[0-9]+).*/\1/')" - if [[ -z "${BATTPRCNT}" ]]; then - PR_BATTERY="" - elif [[ "${BATTPRCNT}" -lt 15 ]]; then - PR_BATTERY="${fg[red]} batt:${BATTPRCNT}%%" - elif [[ "${BATTPRCNT}" -lt 60 ]]; then - PR_BATTERY="${fg[yellow]} batt:${BATTPRCNT}%%" - elif [[ "${BATTPRCNT}" -lt 100 ]]; then - PR_BATTERY="${fg[green]} batt:${BATTPRCNT}%%" + local BATTSTATUS="$(echo ${BATTSTATE[(w)3]})" + if [[ "${BATTSTATUS}" = "Discharging," ]]; then + if [[ -z "${BATTPRCNT}" ]]; then + PR_BATTERY="" + elif [[ "${BATTPRCNT}" -lt 15 ]]; then + PR_BATTERY="${fg[red]%}|${fg[red]} batt:${BATTPRCNT}%%" + elif [[ "${BATTPRCNT}" -lt 60 ]]; then + PR_BATTERY="${fg[red]%}|${fg[yellow]} batt:${BATTPRCNT}%%" + elif [[ "${BATTPRCNT}" -lt 100 ]]; then + PR_BATTERY="${fg[red]%}|${fg[green]} batt:${BATTPRCNT}%%" + else + PR_BATTERY="" + + fi else PR_BATTERY="" fi fi -PROMPT='$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|${PR_BATTERY%}%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)$(svn_prompt_info)%{$reset_color%}%{$fg[cyan]%}⇒%{$reset_color%} ' +PROMPT='$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}${PR_BATTERY%}%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)$(svn_prompt_info)%{$reset_color%}%{$fg[cyan]%}⇒%{$reset_color%} ' } precmd() { PS1= setprompt } setprompt + From 607c2171bc56a2c21ad43b9954c8549086d49912 Mon Sep 17 00:00:00 2001 From: Milind Shakya Date: Fri, 13 Apr 2012 16:00:22 -0500 Subject: [PATCH 6/7] deleted pygmalion-batt --- themes/pygmalion-batt.zsh-theme | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 themes/pygmalion-batt.zsh-theme diff --git a/themes/pygmalion-batt.zsh-theme b/themes/pygmalion-batt.zsh-theme deleted file mode 100644 index 73aff1fd0..000000000 --- a/themes/pygmalion-batt.zsh-theme +++ /dev/null @@ -1,30 +0,0 @@ -# Yay! High voltage and arrows! - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -setprompt(){ -if which acpi &> /dev/null; then - local BATTSTATE="$(acpi -b)" - local BATTPRCNT="$(echo ${BATTSTATE[(w)4]}|sed -r 's/(^[0-9]+).*/\1/')" - if [[ -z "${BATTPRCNT}" ]]; then - PR_BATTERY="" - elif [[ "${BATTPRCNT}" -lt 15 ]]; then - PR_BATTERY="${fg[red]} batt:${BATTPRCNT}%%" - elif [[ "${BATTPRCNT}" -lt 60 ]]; then - PR_BATTERY="${fg[yellow]} batt:${BATTPRCNT}%%" - elif [[ "${BATTPRCNT}" -lt 96 ]]; then - PR_BATTERY="${fg[green]} batt:${BATTPRCNT}%%" - else - PR_BATTERY="" - fi - fi - -PROMPT='$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|${PR_BATTERY%}%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} ' -} - - precmd() { PS1= setprompt } - - setprompt From cb8a3fa71686e8322dc9fb9494810689958abb58 Mon Sep 17 00:00:00 2001 From: Milind Shakya Date: Mon, 16 Apr 2012 15:37:59 -0500 Subject: [PATCH 7/7] added a comment --- themes/milind.zsh-theme | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/milind.zsh-theme b/themes/milind.zsh-theme index bc16825ef..c5f5646b7 100644 --- a/themes/milind.zsh-theme +++ b/themes/milind.zsh-theme @@ -1,4 +1,5 @@ -# Yay! High voltage and arrows! +#Some cool additions to the awesome pygmalion theme +#Milind Shakya ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "