From 6a780b9c2e4868a9b1b33a90acf5e3f4d936399b Mon Sep 17 00:00:00 2001 From: Noon Silk Date: Thu, 12 Jan 2012 08:53:00 +1100 Subject: [PATCH 1/5] Adding first version of my theme --- themes/noon.zsh-theme | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 themes/noon.zsh-theme diff --git a/themes/noon.zsh-theme b/themes/noon.zsh-theme new file mode 100644 index 000000000..1b7c7e302 --- /dev/null +++ b/themes/noon.zsh-theme @@ -0,0 +1,48 @@ +# "noon" by Noon Silk. +# +# This theme is essentially "dieter", with a bit of stuff removed (git related +# prompt stuff). I also added the time into the prompt, and the date on the +# right prompt. The comments below are his. +# +# -- + +# the idea of this theme is to contain a lot of info in a small string, by +# compressing some parts and colorcoding, which bring useful visual cues, +# while limiting the amount of colors and such to keep it easy on the eyes. +# When a command exited >0, the timestamp will be in red and the exit code +# will be on the right edge. +# The exit code visual cues will only display once. +# (i.e. they will be reset, even if you hit enter a few times on empty command prompts) + +# local time, color coded by last return code +time_enabled="%(?.%{$fg[magenta]%}.%{$fg[red]%})%D{%I:%M %p}%{$reset_color%}" +time_disabled="%{$fg[magenta]%}%D{%I:%M %p}%{$reset_color%}" +time=$time_enabled + +# user part, color coded by privileges +local user="%(!.%{$fg[white]%}.%{$fg[white]%})%n@%{$reset_color%}" + +# Compacted $PWD +local pwd="%{$fg[yellow]%}%c>%{$reset_color%}" + +PROMPT='${time} ${user}${pwd}' + +# elaborate exitcode on the right when >0 +return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" +return_code_disabled="%{$fg[magenta]%}%D{%a %b %d}%{$reset_color%}" +return_code=$return_code_disabled + +RPROMPT='${return_code}' + +function accept-line-or-clear-warning () { + if [[ -z $BUFFER ]]; then + time=$time_disabled + return_code=$return_code_disabled + else + time=$time_enabled + return_code=$return_code_enabled + fi + zle accept-line +} +zle -N accept-line-or-clear-warning +bindkey '^M' accept-line-or-clear-warning From 199d65163671cae6071d34aa443314edfa072411 Mon Sep 17 00:00:00 2001 From: Noon Silk Date: Thu, 12 Jan 2012 09:01:02 +1100 Subject: [PATCH 2/5] Added link to screenshot for theme --- themes/noon.zsh-theme | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/noon.zsh-theme b/themes/noon.zsh-theme index 1b7c7e302..b3bac26c6 100644 --- a/themes/noon.zsh-theme +++ b/themes/noon.zsh-theme @@ -1,4 +1,6 @@ -# "noon" by Noon Silk. +# "noon" by Noon Silk - http://github.com/silky +# +# Screenshot: http://i.imgur.com/EoYZz.png # # This theme is essentially "dieter", with a bit of stuff removed (git related # prompt stuff). I also added the time into the prompt, and the date on the From 242612d7452d735557f416d04c69b90f4d48da0b Mon Sep 17 00:00:00 2001 From: Noon Silk Date: Fri, 13 Jan 2012 12:12:14 +1100 Subject: [PATCH 3/5] Added a lightning bolt, for no particular reason. --- themes/noon.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/noon.zsh-theme b/themes/noon.zsh-theme index b3bac26c6..26194822e 100644 --- a/themes/noon.zsh-theme +++ b/themes/noon.zsh-theme @@ -17,7 +17,7 @@ # (i.e. they will be reset, even if you hit enter a few times on empty command prompts) # local time, color coded by last return code -time_enabled="%(?.%{$fg[magenta]%}.%{$fg[red]%})%D{%I:%M %p}%{$reset_color%}" +time_enabled="%(?.%{$fg[magenta]%}.%{$fg[red]%}⚡ )%D{%I:%M %p}%{$reset_color%}" time_disabled="%{$fg[magenta]%}%D{%I:%M %p}%{$reset_color%}" time=$time_enabled From e31d34a747ab154921882dc57af93ce39c5cea10 Mon Sep 17 00:00:00 2001 From: Noon Silk Date: Sat, 14 Jan 2012 20:54:09 +1100 Subject: [PATCH 4/5] Added battery bar into my theme --- themes/noon.zsh-theme | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/themes/noon.zsh-theme b/themes/noon.zsh-theme index 26194822e..a2c3e1246 100644 --- a/themes/noon.zsh-theme +++ b/themes/noon.zsh-theme @@ -34,7 +34,7 @@ return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" return_code_disabled="%{$fg[magenta]%}%D{%a %b %d}%{$reset_color%}" return_code=$return_code_disabled -RPROMPT='${return_code}' +RPROMPT='${return_code} $(battery_charge)' function accept-line-or-clear-warning () { if [[ -z $BUFFER ]]; then @@ -46,5 +46,10 @@ function accept-line-or-clear-warning () { fi zle accept-line } + +function battery_charge () { + python ~/bin/scripts/batstate.py 2>/dev/null +} + zle -N accept-line-or-clear-warning bindkey '^M' accept-line-or-clear-warning From 48948a48f89150d6d2052f873322444daba88544 Mon Sep 17 00:00:00 2001 From: Noon Silk Date: Sat, 14 Jan 2012 21:04:09 +1100 Subject: [PATCH 5/5] Minor adjustment --- themes/noon.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/noon.zsh-theme b/themes/noon.zsh-theme index a2c3e1246..319d02ed2 100644 --- a/themes/noon.zsh-theme +++ b/themes/noon.zsh-theme @@ -34,7 +34,7 @@ return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" return_code_disabled="%{$fg[magenta]%}%D{%a %b %d}%{$reset_color%}" return_code=$return_code_disabled -RPROMPT='${return_code} $(battery_charge)' +RPROMPT='${return_code}$(battery_charge)' function accept-line-or-clear-warning () { if [[ -z $BUFFER ]]; then