diff --git a/themes/bira/README.md b/themes/bira/README.md index e97e8e2..0714bbe 100644 --- a/themes/bira/README.md +++ b/themes/bira/README.md @@ -3,12 +3,10 @@ Theme imported from Oh my ZSH: https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/bira.zsh-theme Contains traces of nuts and code from other Oh my fish themes. -Display username, hostname, current path and git status: +Display username, hostname, current path and git status. Display the latest error status in the right prompt. ![bira theme](https://raw.github.com/vincent-psarga/oh-my-fish/master/themes/bira/screenshot.png) TODO: - - display latest return code - - display escalated privileges - display Ruby version - display Python version diff --git a/themes/bira/fish_prompt.fish b/themes/bira/fish_prompt.fish index 097770f..6c75524 100644 --- a/themes/bira/fish_prompt.fish +++ b/themes/bira/fish_prompt.fish @@ -2,7 +2,13 @@ # Some code stolen from oh-my-fish clearance theme: https://github.com/bpinto/oh-my-fish/blob/master/themes/clearance/ function __user_host - echo -n (set_color --bold green)$USER@(hostname|cut -d . -f 1) (set color normal) + set -l content + if [ (id -u) = "0" ]; + echo -n (set_color red) + else + echo -n (set_color green) + end + echo -n $USER@(hostname|cut -d . -f 1) (set color normal) end function __current_path @@ -39,3 +45,11 @@ function fish_prompt echo -e '' echo (set_color white)"╰─"(set_color --bold white)"\$ "(set_color normal) end + +function fish_right_prompt + set -l st $status + + if [ $st != 0 ]; + echo (set_color red) ↵ $st(set_color normal) + end +end diff --git a/themes/bira/screenshot.png b/themes/bira/screenshot.png index be4679e..232d739 100644 Binary files a/themes/bira/screenshot.png and b/themes/bira/screenshot.png differ