-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Beau Hastings <[email protected]>
- Loading branch information
Beau Hastings
committed
Nov 7, 2016
0 parents
commit 28c7181
Showing
17 changed files
with
379 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 Beau Hastings | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# kawasaki | ||
|
||
`kawasaki` is a [fish][fish] theme that emphasizes a simple and useful prompt without useless cluttter. | ||
|
||
[](https://github.com/oh-my-fish/oh-my-fish) | ||
[](/LICENSE) | ||
|
||
![kawasaki][screenshot] | ||
|
||
|
||
## Installation | ||
|
||
#### Requirements | ||
* [Fish shell][fish] - a smart and user-friendly command line | ||
shell for OS X, Linux, and the rest of the family | ||
* [Oh My Fish][omf] - The Fishshell Framework | ||
|
||
Once Oh My Fish is installed: | ||
|
||
omf install kawasaki | ||
|
||
This theme was inspired by [bira][bira]. | ||
|
||
#### Notes | ||
|
||
To use kawasaki's virtualenv prompt instead of the default virtualenv prompt append `set -x VIRTUAL_ENV_DISABLE_PROMPT 1` to your [init.fish][dotfiles] | ||
|
||
|
||
## Features | ||
|
||
* Completely customizable. | ||
* Display status of the working tree for Git projects. | ||
* Read/write indicator of the current working directory. | ||
* Background jobs indicator. | ||
* Virtualenv prompt indicator. | ||
|
||
|
||
## Customizing | ||
|
||
#### Override defaults | ||
|
||
You can override the default display settings by specifying any of the following settings in your [init.fish][dotfiles]: | ||
|
||
```fish | ||
## Enable the time to be displayed. | ||
set -g theme_display_time yes | ||
## Disable playing the user's current group. | ||
set -g theme_display_group no | ||
## Disable Git-awareness. | ||
set -g theme_display_git no | ||
## Don't disable jobs indicator. | ||
set -g theme_display_jobs no | ||
## Always display the jobs indicator, even if there are no jobs. | ||
set -g theme_display_jobs_always yes | ||
## Hide the current directory read/write indicator. | ||
set -g theme_display_rwt no | ||
## Don't display the VirtualEnv prompt. | ||
set -g theme_display_virtualent no | ||
``` | ||
|
||
#### Look and feel | ||
|
||
Nearly every aspect of kawasaki can be customized. The following can be set to adjust the look and feel of kawasaki: | ||
|
||
```fish | ||
set -g theme_color_error red | ||
set -g theme_color_superuser red | ||
set -g theme_color_user white | ||
set -g theme_color_group 666666 | ||
set -g theme_color_host brgreen | ||
set -g theme_color_separator brblack | ||
set -g theme_color_bracket brblue | ||
set -g theme_color_normal normal | ||
set -g theme_color_time 666666 | ||
set -g theme_color_path brwhite | ||
set -g theme_color_prompt white | ||
set -g theme_color_virtualenv bryellow | ||
set -g theme_color_status_prefix brblue | ||
set -g theme_color_status_jobs brgreen | ||
set -g theme_color_status_rw brwhite | ||
set -g theme_prompt_char_normal '$' | ||
set -g theme_prompt_char_superuser '#' | ||
set -g theme_prompt_char "$theme_prompt_char_normal" | ||
set -g theme_prompt_superuser_glyph \u2605 | ||
set -g theme_prompt_userhost_separator ':' | ||
set -g theme_prompt_segment_separator_char ' ' | ||
set -g theme_prompt_segment_separator_color normal | ||
set -g theme_prompt_status_jobs_char '%' | ||
set -g theme_prompt_status_rw_char '.' | ||
set -g theme_prompt_status_separator_char '/' | ||
set -g theme_prompt_virtualenv_char_begin '(' | ||
set -g theme_prompt_virtualenv_char_end ')' | ||
set -g theme_prompt_virtualenv_color_char_begin normal | ||
set -g theme_prompt_virtualenv_color_char_end normal | ||
set -g theme_display_time_format '+%I:%M' | ||
set -g __fish_git_prompt_color_merging red | ||
set -g __fish_git_prompt_color_branch brblue | ||
set -g __fish_git_prompt_showcolorhints yes | ||
set -g __fish_git_prompt_show_informative_status yes | ||
set -g __fish_git_prompt_char_stateseparator ' ' | ||
set -g __fish_git_prompt_char_branch_begin '' | ||
set -g __fish_git_prompt_char_branch_end '' | ||
set -g __fish_git_prompt_color_branch_begin bryellow | ||
set -g __fish_git_prompt_color_branch_end bryellow | ||
``` | ||
|
||
## License | ||
|
||
kawasaki is released under [The MIT License (MIT)][license] | ||
|
||
Copyright (c) 2016 Beau Hastings | ||
|
||
[license]: /LICENSE | ||
[fish]: https://github.com/fish-shell/fish-shell | ||
[omf]: https://github.com/oh-my-fish/oh-my-fish | ||
[screenshot]: https://cloud.githubusercontent.com/assets/195790/20061473/9545bd4c-a4c5-11e6-83da-8b0a954b8a5a.gif | ||
[bira]: https://github.com/oh-my-fish/theme-bira | ||
[dotfiles]: https://github.com/oh-my-fish/oh-my-fish#dotfiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
function fish_greeting;end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
#!/usr/bin/fish | ||
# | ||
# kawasaki.theme | ||
# | ||
# A theme for the fish shell. | ||
# | ||
# Copyright (c) 2016 Beau Hastings. | ||
# License: GNU General Public License v2 | ||
# | ||
# Author: Beau Hastings <[email protected]> | ||
# | ||
|
||
# | ||
# Notes: | ||
# To use the theme's virtualenv prompt indicator you should add the following to your init.fish (https://github.com/oh-my-fish/oh-my-fish#dotfiles) | ||
# set --export VIRTUAL_ENV_DISABLE_PROMPT 1 | ||
|
||
# Override default options | ||
# | ||
## Display the local time | ||
#set -g theme_display_time yes | ||
# | ||
## Display the user's current group | ||
#set -g theme_display_group no | ||
# | ||
## Display git branch status | ||
#set -g theme_display_git no | ||
# | ||
## Display job count | ||
#set -g theme_display_jobs no | ||
# | ||
## By default job count won't display if there are no jobs | ||
#set -g theme_display_jobs_always yes | ||
# | ||
## Don't display if the current working directory is readable/writable | ||
#set -g theme_display_rw no | ||
# | ||
## Don't display virtualenv | ||
#set -g theme_display_virtualenv no | ||
# | ||
|
||
# Colors | ||
# TODO: consider displaying colors in the following order: cyan, green, yellow, orange, purple | ||
# | ||
set -g theme_color_error red | ||
set -g theme_color_superuser red | ||
set -g theme_color_user white | ||
set -g theme_color_group 666666 | ||
set -g theme_color_host brgreen | ||
set -g theme_color_separator brblack | ||
set -g theme_color_bracket brblue | ||
set -g theme_color_normal normal | ||
set -g theme_color_time 666666 | ||
set -g theme_color_path brwhite | ||
set -g theme_color_prompt white | ||
set -g theme_color_virtualenv bryellow | ||
|
||
set -g theme_color_status_prefix brblue | ||
set -g theme_color_status_jobs brgreen | ||
set -g theme_color_status_rw brwhite | ||
|
||
set -g theme_prompt_char_normal '$' | ||
set -g theme_prompt_char_superuser '#' | ||
set -g theme_prompt_char "$theme_prompt_char_normal" | ||
|
||
set -g theme_prompt_superuser_glyph \u2605 | ||
set -g theme_prompt_userhost_separator ':' | ||
|
||
set -g theme_prompt_segment_separator_char ' ' | ||
set -g theme_prompt_segment_separator_color normal | ||
|
||
set -g theme_prompt_status_jobs_char '%' | ||
set -g theme_prompt_status_rw_char '.' | ||
set -g theme_prompt_status_separator_char '/' | ||
|
||
set -g theme_prompt_virtualenv_char_begin '(' | ||
set -g theme_prompt_virtualenv_char_end ')' | ||
set -g theme_prompt_virtualenv_color_char_begin normal | ||
set -g theme_prompt_virtualenv_color_char_end normal | ||
|
||
set -g theme_display_time_format '+%I:%M' | ||
|
||
#set -g __fish_git_prompt_color_prefix | ||
#set -g __fish_git_prompt_color_suffix | ||
#set -g __fish_git_prompt_color_bare | ||
set -g __fish_git_prompt_color_merging red | ||
set -g __fish_git_prompt_color_branch brblue | ||
#set -g __fish_git_prompt_color_flags | ||
#set -g __fish_git_prompt_color_upstream | ||
# | ||
#__fish_git_prompt_describe_style default|contains|describe|branch | ||
set -g __fish_git_prompt_showcolorhints yes | ||
set -g __fish_git_prompt_show_informative_status yes | ||
set -g __fish_git_prompt_char_stateseparator ' ' | ||
|
||
# Unofficial fish_git_prompt settings | ||
set -g __fish_git_prompt_char_branch_begin '' | ||
set -g __fish_git_prompt_char_branch_end '' | ||
set -g __fish_git_prompt_color_branch_begin bryellow | ||
set -g __fish_git_prompt_color_branch_end bryellow | ||
|
||
|
||
function fish_prompt | ||
set -l sep (set_color $theme_prompt_segment_separator_color)$theme_prompt_segment_separator_char(__theme_reset_color) | ||
set -l line1 (string join "$sep" \ | ||
(__theme_print_time) \ | ||
(__theme_print_userhost) \ | ||
(__theme_print_pwd) \ | ||
(__theme_print_git_status) \ | ||
(__theme_print_jobs) \ | ||
(__theme_print_pwd_rw) \ | ||
) | ||
set -l line2 (string join " " \ | ||
(__theme_print_virtualenv) \ | ||
(__theme_print_prompt_char)\ | ||
) | ||
|
||
echo "$line1" | ||
echo "$line2 " | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function fish_right_prompt | ||
set -l st $status | ||
|
||
if [ $status != 0 ] | ||
echo (set_color $theme_color_error) ↵ $st(set_color $theme_color_normal) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function fish_title | ||
# Customize terminal window title | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function __theme_print_git_status | ||
[ "$theme_display_git" = 'no' ]; and return | ||
set -l git_prompt (__fish_git_prompt | command sed -e 's/^ (//' -e 's/)$//') | ||
|
||
[ "$git_prompt" = "" ]; and return | ||
|
||
print_colored $__fish_git_prompt_char_branch_begin $__fish_git_prompt_color_branch_begin | ||
printf '%s' $git_prompt | ||
print_colored $__fish_git_prompt_char_branch_end $__fish_git_prompt_color_branch_end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function __theme_print_jobs | ||
[ "$theme_display_jobs" = 'no' ]; and return | ||
set -l num_jobs (jobs -l | command wc -l) | ||
|
||
if [ $num_jobs -gt 0 -o "$theme_display_jobs_always" = "yes" ] | ||
print_colored "$theme_prompt_status_jobs_char" $theme_color_status_prefix | ||
print_colored "$theme_prompt_status_separator_char" $theme_color_separator | ||
print_colored "$num_jobs" $theme_color_status_jobs | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function __theme_print_prompt_char | ||
print_colored $theme_prompt_char $theme_color_prompt | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function __theme_print_pwd | ||
print_colored (prompt_pwd) $theme_color_path | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function __theme_print_pwd_rw | ||
[ "$theme_display_rw" = 'no' ]; and return; | ||
set -l rw_chars | ||
|
||
if [ -r . ]; set rw_chars r; end | ||
if [ -w . ]; set rw_chars $rw_chars"w"; end | ||
|
||
print_colored $theme_prompt_status_rw_char $theme_color_status_prefix | ||
print_colored $theme_prompt_status_separator_char $theme_color_separator | ||
print_colored $rw_chars $theme_color_status_rw | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
function __theme_print_superuser | ||
if [ (command id -u) = "0" ] | ||
set theme_prompt_char "$theme_prompt_char_superuser" | ||
print_colored $theme_prompt_superuser_glyph $theme_color_superuser | ||
else | ||
set theme_prompt_char "$theme_prompt_char_normal" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function __theme_print_time | ||
[ "$theme_display_time" = 'yes' ]; or return; | ||
print_colored (command date $theme_display_time_format) $theme_color_time | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function __theme_print_userhost | ||
echo -ns (__theme_print_superuser) $USER (__theme_reset_color) | ||
|
||
if [ "$theme_display_group" != 'no' ] | ||
print_colored $theme_prompt_userhost_separator $theme_color_separator | ||
print_colored (id -gn) $theme_color_group | ||
end | ||
|
||
set -l hostname (command hostname | cut -d '.' -f 1) | ||
|
||
print_colored "@" $theme_color_separator | ||
print_colored "$hostname" $theme_color_host | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function __theme_print_virtualenv | ||
[ "$theme_display_virtualenv" = 'no' -o -z "$VIRTUAL_ENV" ]; and return | ||
|
||
set -l basename (basename "$VIRTUAL_ENV") | ||
|
||
# special case for Aspen magic directories (http://www.zetadev.com/software/aspen/) | ||
if test "$basename" = "__" | ||
set basename (basename (dirname "$VIRTUAL_ENV")) | ||
end | ||
|
||
print_colored $theme_prompt_virtualenv_char_begin $theme_prompt_virtualenv_color_char_begin | ||
print_colored $basename $theme_color_virtualenv | ||
print_colored $theme_prompt_virtualenv_char_end $theme_prompt_virtualenv_color_char_end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function __theme_reset_color | ||
set_color $theme_color_normal | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function print_colored | ||
set -l bgcolor normal | ||
set -l fgcolor normal | ||
set -l text | ||
|
||
if contains -- -b in $argv[1] | ||
set bgcolor $argv[2] | ||
set fgcolor $argv[-1] | ||
set text $argv[3..-2] | ||
else | ||
set fgcolor $argv[-1] | ||
set text $argv[1..-2] | ||
end | ||
|
||
printf '%s%s%s' (set_color -b $bgcolor $fgcolor) (string join " " $text) (__theme_reset_color) | ||
end |