From d2f8ef5b5947dbf17b189589bab052fcc1eff86a Mon Sep 17 00:00:00 2001 From: Remy Goldschmidt Date: Wed, 17 Dec 2014 02:37:46 -0600 Subject: [PATCH 1/3] Added taktoa theme --- themes/taktoa/README.md | 10 +++++ themes/taktoa/fish_prompt.fish | 81 ++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 themes/taktoa/README.md create mode 100644 themes/taktoa/fish_prompt.fish diff --git a/themes/taktoa/README.md b/themes/taktoa/README.md new file mode 100644 index 0000000..f379f3f --- /dev/null +++ b/themes/taktoa/README.md @@ -0,0 +1,10 @@ +## taktoa + +A theme by taktoa + +#### Characteristics + +* Shows current git information +* Shows hostname if you are connected via ssh +* Show current terminal multiplexer status (screen/tmux pane name and number) +* Arrow is a lambda diff --git a/themes/taktoa/fish_prompt.fish b/themes/taktoa/fish_prompt.fish new file mode 100644 index 0000000..b16a145 --- /dev/null +++ b/themes/taktoa/fish_prompt.fish @@ -0,0 +1,81 @@ +# name: taktoa +# by taktoa (Remy Goldschmidt) +# License: public domain + +function _git_branch_name + echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') +end + +function _git_status_symbol + set -l git_status (git status --porcelain ^/dev/null) + if test -n "$git_status" + if git status --porcelain ^/dev/null | grep '^.[^ ]' >/dev/null + echo '*' # dirty + else + echo '#' # all staged + end + else + echo '' # clean + end +end + +function _remote_hostname + echo (whoami) + if test -n "$SSH_CONNECTION" + echo " (ssh)" + end +end + +function _get_tmux_window + tmux lsw | grep active | sed 's/\*.*$//g;s/: / /1' | awk '{ print $2 "-" $1 }' - +end + +function _get_screen_window + set initial (screen -Q windows; screen -Q echo "") + set middle (echo $initial | sed 's/ /\n/g' | grep '\*' | sed 's/\*\$ / /g') + echo $middle | awk '{ print $2 "-" $1 }' - +end + +function _is_multiplexed + set multiplexer "" + if test -z $TMUX + else + set multiplexer "tmux" + end + if test -z $WINDOW + else + set multiplexer "screen" + end + echo $multiplexer +end + +function fish_prompt + set -l cyan (set_color cyan) + set -l brown (set_color brown) + set -l normal (set_color normal) + + set -l arrow "λ" + set -l cwd (set_color $fish_color_cwd)(prompt_pwd) + set -l git_status (_git_status_symbol)(_git_branch_name) + + if test -n "$git_status" + set git_status " $git_status" + end + + set multiplexer (_is_multiplexed) + + switch $multiplexer + case screen + set pane (_get_screen_window) + case tmux + set pane (_get_tmux_window) + end + + if test -z $pane + set window "" + else + set window " ($pane)" + end + + echo -n -s (_remote_hostname) ' ' $cwd $brown $window $cyan $git_status $normal ' ' $arrow ' ' +end \ No newline at end of file From f65699beef57c04bb6fdb9dd9ebd045166d17c25 Mon Sep 17 00:00:00 2001 From: Remy Goldschmidt Date: Wed, 24 Dec 2014 05:02:53 -0600 Subject: [PATCH 2/3] Revised taktoa theme README --- themes/taktoa/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/taktoa/README.md b/themes/taktoa/README.md index f379f3f..fc633af 100644 --- a/themes/taktoa/README.md +++ b/themes/taktoa/README.md @@ -8,3 +8,5 @@ A theme by taktoa * Shows hostname if you are connected via ssh * Show current terminal multiplexer status (screen/tmux pane name and number) * Arrow is a lambda + +![taktoa theme](https://taktoa.me/oh-my-fish/images/taktoa-screenshot.png) From 75300c5445803e6bbcc7c32384676e36443d5de9 Mon Sep 17 00:00:00 2001 From: Remy Goldschmidt Date: Wed, 24 Dec 2014 05:04:13 -0600 Subject: [PATCH 3/3] Fixed https image link --- themes/taktoa/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/taktoa/README.md b/themes/taktoa/README.md index fc633af..2a946c7 100644 --- a/themes/taktoa/README.md +++ b/themes/taktoa/README.md @@ -9,4 +9,4 @@ A theme by taktoa * Show current terminal multiplexer status (screen/tmux pane name and number) * Arrow is a lambda -![taktoa theme](https://taktoa.me/oh-my-fish/images/taktoa-screenshot.png) +![taktoa theme](http://taktoa.me/oh-my-fish/images/taktoa-screenshot.png)