2014-08-22 01:58:10 +08:00
###############################################################################
#
2014-09-07 04:08:09 +08:00
# prompt theme name:
2014-08-22 01:58:10 +08:00
# budspencer
#
2014-09-07 04:08:09 +08:00
# description:
2014-08-22 01:58:10 +08:00
# a sophisticated airline/powerline theme
#
2014-09-07 04:08:09 +08:00
# author:
# joseph tannhuber <sepp.tannhuber@yahoo.de>
2014-08-22 01:58:10 +08:00
#
2014-09-07 04:08:09 +08:00
# sections:
# -> Color definitions
2014-08-22 01:58:10 +08:00
# -> Functions
# -> Help
2014-09-07 04:08:09 +08:00
# -> Environment
# -> Window title
2014-08-22 01:58:10 +08:00
# -> Welcome message
#
###############################################################################
2014-09-07 04:08:09 +08:00
###############################################################################
# => Color definitions
###############################################################################
# Define colors
set -U budspencer_night 000000 083743 445659 fdf6e3 b58900 cb4b16 dc121f af005f 6c71c4 268bd2 2aa198 859900
set -U budspencer_day 000000 333333 666666 ffffff ffff00 ff6600 ff0000 ff0033 3300ff 00aaff 00ffff 00ff00
if not set -q budspencer_colors
2014-08-22 01:58:10 +08:00
# Values are: black dark_gray light_gray white yellow orange red magenta violet blue cyan green
set -U budspencer_colors $budspencer_night
2014-09-07 04:08:09 +08:00
end
# Cursor color changes according to vi-mode
# Define values for: normal_mode insert_mode visual_mode
set - U budspencer_cursors " \033]12;# $budspencer_colors [10]\007 " " \033]12;# $budspencer_colors [5]\007 " " \033]12;# $budspencer_colors [8]\007 " " \033]12;# $budspencer_colors [9]\007 "
# Some terminals cannot change the cursor color
set -l unsupported_terminals 'fbterm' 'st' 'linux' 'screen'
if contains $TERM $unsupported_terminals
2014-08-22 01:58:10 +08:00
set budspencer_cursors '' '' '' ''
2014-09-07 04:08:09 +08:00
end
2014-08-22 01:58:10 +08:00
###############################################################################
# => Functions
###############################################################################
#########
# => Help
#########
2014-09-07 04:08:09 +08:00
function budspencer_help -d 'Show helpfile'
2014-08-22 01:58:10 +08:00
set -l readme_file " $fish_path /themes/budspencer/README.md "
if set -q PAGER
if [ - e $readme_file ]
eval $PAGER $readme_file
else
set_color $fish_color_error [ 1 ]
echo " $readme_file wasn't found. "
end
else
open $readme_file
end
2014-09-07 04:08:09 +08:00
end
################
# => Environment
################
function day -d "Set color palette for bright environment."
2014-08-22 01:58:10 +08:00
set budspencer_colors $budspencer_day
set budspencer_cursors " \033]12;# $budspencer_colors [10]\007 " " \033]12;# $budspencer_colors [5]\007 " " \033]12;# $budspencer_colors [8]\007 " " \033]12;# $budspencer_colors [9]\007 "
2014-09-07 04:08:09 +08:00
end
function night -d "Set color palette for dark environment."
2014-08-22 01:58:10 +08:00
set budspencer_colors $budspencer_night
set budspencer_cursors " \033]12;# $budspencer_colors [10]\007 " " \033]12;# $budspencer_colors [5]\007 " " \033]12;# $budspencer_colors [8]\007 " " \033]12;# $budspencer_colors [9]\007 "
2014-09-07 04:08:09 +08:00
end
#################
# => Window title
#################
function wt -d 'Set window title'
2014-08-22 01:58:10 +08:00
set -g window_title $argv
function fish_title
echo -n $window_title
end
2014-08-22 01:58:10 +08:00
end
####################
# => Welcome message
####################
2014-09-07 04:08:09 +08:00
function fish_greeting -d 'Show greeting in login shell.'
2014-08-22 01:58:10 +08:00
if not set -q budspencer_nogreeting
if begin
not set -q -x LOGIN
and not set -q -x RANGER_LEVEL
and not set -q -x VIM
end
echo This is ( set_color -b $budspencer_colors [ 2 ] $budspencer_colors [ 10 ] ) budspencer( set_color normal) theme for fish , a theme for the 70s.
echo Type ( set_color -b $budspencer_colors [ 2 ] $budspencer_colors [ 6 ] ) »budspencer_help«( set_color normal) in order to see how you can speed up your workflow.
end
end
2014-08-22 01:58:10 +08:00
end