2016-02-20 06:47:57 +00:00
|
|
|
# You can override some default right prompt options in your config.fish:
|
2015-11-22 15:48:49 +00:00
|
|
|
# set -g theme_date_format "+%a %H:%M"
|
|
|
|
|
2016-02-20 06:47:57 +00:00
|
|
|
function __bobthefish_cmd_duration -S -d 'Show command duration'
|
|
|
|
[ "$CMD_DURATION" -lt 100 ]; and return
|
|
|
|
|
|
|
|
if [ "$CMD_DURATION" -lt 5000 ]
|
|
|
|
echo -ns $CMD_DURATION 'ms '
|
|
|
|
else if [ "$CMD_DURATION" -lt 60000 ]
|
2016-02-23 06:06:55 +00:00
|
|
|
math "scale=1;$CMD_DURATION/1000" | sed 's/\\.0$//'
|
2016-03-30 06:28:25 +00:00
|
|
|
echo -n 's '
|
2016-02-20 06:47:57 +00:00
|
|
|
else if [ "$CMD_DURATION" -lt 3600000 ]
|
|
|
|
set_color $fish_color_error
|
2016-02-23 06:06:55 +00:00
|
|
|
math "scale=1;$CMD_DURATION/60000" | sed 's/\\.0$//'
|
2016-03-30 06:28:25 +00:00
|
|
|
echo -n 'm '
|
2016-02-20 06:47:57 +00:00
|
|
|
else
|
|
|
|
set_color $fish_color_error
|
2016-02-23 06:06:55 +00:00
|
|
|
math "scale=2;$CMD_DURATION/3600000" | sed 's/\\.0$//'
|
2016-03-30 06:28:25 +00:00
|
|
|
echo -n 'h '
|
2016-02-20 06:47:57 +00:00
|
|
|
end
|
|
|
|
|
2016-03-29 18:27:54 +00:00
|
|
|
set_color $fish_color_normal
|
2013-09-18 06:17:15 +00:00
|
|
|
set_color $fish_color_autosuggestion[1]
|
2016-02-20 06:47:57 +00:00
|
|
|
echo -n $__bobthefish_left_arrow_glyph
|
|
|
|
end
|
|
|
|
|
|
|
|
function __bobthefish_timestamp -S -d 'Show the current timestamp'
|
2016-03-30 06:28:25 +00:00
|
|
|
set -q theme_date_format
|
|
|
|
or set -l theme_date_format "+%c"
|
|
|
|
|
2016-02-20 06:47:57 +00:00
|
|
|
echo -n ' '
|
2015-10-13 20:39:52 +00:00
|
|
|
date $theme_date_format
|
2016-02-20 06:47:57 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function fish_right_prompt -d 'bobthefish is all about the right prompt'
|
2016-05-16 01:18:28 +00:00
|
|
|
set -l __bobthefish_left_arrow_glyph \uE0B3
|
|
|
|
if [ "$theme_powerline_fonts" = "no" ]
|
|
|
|
set __bobthefish_left_arrow_glyph '<'
|
2016-05-15 23:43:01 +00:00
|
|
|
end
|
2016-02-20 06:47:57 +00:00
|
|
|
|
|
|
|
set_color $fish_color_autosuggestion[1]
|
|
|
|
|
|
|
|
__bobthefish_cmd_duration
|
|
|
|
__bobthefish_timestamp
|
2016-04-04 15:36:11 +00:00
|
|
|
set_color normal
|
2013-09-18 06:17:15 +00:00
|
|
|
end
|