diff --git a/stow/fish/.config/fish/config.fish b/fish/.config/fish/config.fish similarity index 71% rename from stow/fish/.config/fish/config.fish rename to fish/.config/fish/config.fish index 8ee0c606..91323c05 100644 --- a/stow/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -1,7 +1,7 @@ #set -U fish_greeting "" #set -U fish_history "" #set -U fish_user_paths -#set -U BROWSER "waterfox" +#set -x BROWSER "waterfox" fish_vi_key_bindings @@ -20,3 +20,10 @@ alias t="tree -L 1" alias todo="rg TODO" alias pwd="pwd | sed -e 's!$HOME!~!g'" + +# Start X at login +if status --is-login + if test -z "$DISPLAY" -a $XDG_VTNR = 1 + exec startx -- -keeptty + end +end diff --git a/fish/.config/fish/functions/fish_prompt.fish b/fish/.config/fish/functions/fish_prompt.fish new file mode 100644 index 00000000..850a2956 --- /dev/null +++ b/fish/.config/fish/functions/fish_prompt.fish @@ -0,0 +1,37 @@ +set __fish_git_prompt_showdirtystate 'yes' +set __fish_git_prompt_showstashstate 'yes' +set __fish_git_prompt_showupstream 'yes' +set __fish_git_prompt_color_branch magenta + +set __fish_git_prompt_char_dirtystate '! ' +set __fish_git_prompt_char_stagedstate '→ ' +set __fish_git_prompt_char_stashstate '↩ ' +set __fish_git_prompt_char_upstream_ahead '↑ ' +set __fish_git_prompt_char_upstream_behind '↓ ' + +function fish_prompt + set -l color_cwd + set -l suffix + set host (prompt_hostname) + set pwd (basename $PWD) + if [ $pwd = $USER ] + set pwd "~" + end + switch "$USER" + case root toor + if set -q fish_color_cwd_root + set color_cwd $fish_color_cwd_root + else + set color_cwd $fish_color_cwd + end + set suffix '#' + case '*' + set color_cwd $fish_color_cwd + set suffix "" + end + + set git (__fish_git_prompt) + # $USER@$host + echo -n "$pwd$git ➤➤➤ " + # printf '%s@%s %s%s%s%s> ' (whoami) (hostname) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) (__fish_git_prompt) +end diff --git a/stow/fish/.config/fish/functions/fish_prompt.fish b/stow/fish/.config/fish/functions/fish_prompt.fish deleted file mode 100644 index 3e5e4463..00000000 --- a/stow/fish/.config/fish/functions/fish_prompt.fish +++ /dev/null @@ -1,25 +0,0 @@ -function fish_prompt - set -l color_cwd - set -l suffix - set host (prompt_hostname) - set pwd (basename $PWD) - if [ $pwd = $USER ] - set pwd "~" - end - switch "$USER" - case root toor - if set -q fish_color_cwd_root - set color_cwd $fish_color_cwd_root - else - set color_cwd $fish_color_cwd - end - set suffix '#' - case '*' - set color_cwd $fish_color_cwd - set suffix "" - end - - # $USER@$host - echo -n "$pwd ➤➤➤ " -end -