oh-my-fish_theme-bobthefish/functions/fish_title.fish

35 lines
975 B
Fish
Raw Normal View History

2015-10-27 18:05:01 +00:00
# You can override some default title options in your config.fish:
# set -g theme_title_display_process no
# set -g theme_title_display_path no
# set -g theme_title_display_user yes
2015-10-27 18:05:01 +00:00
# set -g theme_title_use_abbreviated_path no
function __bobthefish_title_user -S -d 'Display actual user if different from $default_user'
2019-01-13 17:56:20 +00:00
if [ "$theme_title_display_user" = 'yes' ]
if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ]
set -l IFS .
2023-03-26 14:22:17 +00:00
uname -n | read -l host __
echo -ns (whoami) '@' $host ' '
2019-01-13 17:56:20 +00:00
end
2017-01-09 23:55:09 +00:00
end
end
2013-09-18 06:17:15 +00:00
function fish_title
2019-01-13 17:56:20 +00:00
__bobthefish_title_user
2017-01-09 23:55:09 +00:00
2019-01-13 17:56:20 +00:00
if [ "$theme_title_display_process" = 'yes' ]
status current-command
2019-01-13 17:56:20 +00:00
[ "$theme_title_display_path" != 'no' ]
and echo ' '
end
2015-10-27 18:05:01 +00:00
2019-01-13 17:56:20 +00:00
if [ "$theme_title_display_path" != 'no' ]
if [ "$theme_title_use_abbreviated_path" = 'no' ]
echo $PWD
else
prompt_pwd
end
2015-10-27 18:05:01 +00:00
end
end