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'
|
2016-07-15 23:14:19 +00:00
|
|
|
[ "$theme_display_cmd_duration" = "no" ]; and return
|
2017-01-21 13:12:59 +00:00
|
|
|
[ -z "$CMD_DURATION" -o "$CMD_DURATION" -lt 100 ]; and return
|
2016-02-20 06:47:57 +00:00
|
|
|
|
|
|
|
if [ "$CMD_DURATION" -lt 5000 ]
|
2016-06-08 08:17:19 +00:00
|
|
|
echo -ns $CMD_DURATION 'ms'
|
2016-02-20 06:47:57 +00:00
|
|
|
else if [ "$CMD_DURATION" -lt 60000 ]
|
2017-09-03 06:29:47 +00:00
|
|
|
math -s1 "$CMD_DURATION/1000" | string replace -r '\\.0$' ''
|
2016-06-08 08:17:19 +00:00
|
|
|
echo -n 's'
|
2016-02-20 06:47:57 +00:00
|
|
|
else if [ "$CMD_DURATION" -lt 3600000 ]
|
|
|
|
set_color $fish_color_error
|
2017-09-03 06:29:47 +00:00
|
|
|
math -s1 "$CMD_DURATION/60000" | string replace -r '\\.0$' ''
|
2016-06-08 08:17:19 +00:00
|
|
|
echo -n 'm'
|
2016-02-20 06:47:57 +00:00
|
|
|
else
|
|
|
|
set_color $fish_color_error
|
2017-09-03 06:29:47 +00:00
|
|
|
math -s2 "$CMD_DURATION/3600000" | string replace -r '(\\.0)?0$' ''
|
2016-06-08 08:17:19 +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
|
2016-05-15 22:55:44 +00:00
|
|
|
set_color $fish_color_autosuggestion
|
2016-06-08 08:17:19 +00:00
|
|
|
|
|
|
|
[ "$theme_display_date" = "no" ]
|
|
|
|
or echo -ns ' ' $__bobthefish_left_arrow_glyph
|
2016-02-20 06:47:57 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function __bobthefish_timestamp -S -d 'Show the current timestamp'
|
2016-06-07 07:31:34 +00:00
|
|
|
[ "$theme_display_date" = "no" ]; and return
|
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'
|
|
|
|
set -l __bobthefish_left_arrow_glyph \uE0B3
|
2016-05-16 01:18:28 +00:00
|
|
|
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
|
|
|
|
2016-05-15 22:55:44 +00:00
|
|
|
set_color $fish_color_autosuggestion
|
2016-02-20 06:47:57 +00:00
|
|
|
|
|
|
|
__bobthefish_cmd_duration
|
2016-06-07 07:31:34 +00:00
|
|
|
__bobthefish_timestamp
|
2016-04-04 15:36:11 +00:00
|
|
|
set_color normal
|
2013-09-18 06:17:15 +00:00
|
|
|
end
|