diff --git a/.config/fish/conf.d/dracula.fish b/.config/fish/conf.d/dracula.fish index 583315c..a396547 100644 --- a/.config/fish/conf.d/dracula.fish +++ b/.config/fish/conf.d/dracula.fish @@ -1,25 +1,33 @@ +# Dracula Color Palette set -l foreground f8f8f2 -set -l selection 44475a -set -l comment 6272a4 - -set -l red ff5555 +set -l selection 44475a +set -l comment 6272a4 +set -l red ff5555 set -l orange ffb86c -set -l yellow f4f99d -set -l green 50fa7b -set -l cyan 8be9fd -set -l pink ff79c6 +set -l yellow f1fa8c +set -l green 50fa7b set -l purple bd93f9 +set -l cyan 8be9fd +set -l pink ff79c6 +# Syntax Highlighting Colors +set -g fish_color_normal $foreground +set -g fish_color_command $cyan +set -g fish_color_quote $yellow +set -g fish_color_redirection $foreground +set -g fish_color_end $orange +set -g fish_color_error $red +set -g fish_color_param $purple +set -g fish_color_comment $comment +set -g fish_color_match --background=$selection +set -g fish_color_selection --background=$selection +set -g fish_color_search_match --background=$selection +set -g fish_color_operator $green +set -g fish_color_escape $pink set -g fish_color_autosuggestion $comment -set -g fish_color_command $cyan -set -g fish_color_comment $comment -set -g fish_color_end $orange -set -g fish_color_error $red -set -g fish_color_escape $pink -set -g fish_color_normal $foreground -set -g fish_color_operator $green -set -g fish_color_param $purple -set -g fish_color_quote $yellow -set -g fish_color_redirection $foreground -set -g fish_color_search_match --background=$selection -set -g fish_color_selection --background=$selection + +# Completion Pager Colors +set -g fish_pager_color_progress $comment +set -g fish_pager_color_prefix $cyan +set -g fish_pager_color_completion $foreground +set -g fish_pager_color_description $comment diff --git a/.config/fish/conf.d/omf.fish b/.config/fish/conf.d/omf.fish deleted file mode 100644 index 3e0f6d6..0000000 --- a/.config/fish/conf.d/omf.fish +++ /dev/null @@ -1,7 +0,0 @@ -# Path to Oh My Fish install. -set -q XDG_DATA_HOME - and set -gx OMF_PATH "$XDG_DATA_HOME/omf" - or set -gx OMF_PATH "$HOME/.local/share/omf" - -# Load Oh My Fish configuration. -source $OMF_PATH/init.fish diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 5237461..ce2d152 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,48 +1,127 @@ -############### -# FISH PROMPT # -############### -# Color Scripts -/bin/bash /opt/shell-color-scripts/colorscript.sh -r +############ +# GREETING # +############ +/opt/shell-color-scripts/colorscript.sh random # Color Scripts +set fish_greeting "¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>" # Fish Greeting -########### -# ALIASES # -########### -# dotfiles repo -alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' +############# +# VARIABLES # +############# +set -U fish_user_paths $fish_user_paths $HOME/.local/bin/ ########### # EXPORTS # ########### -export EDITOR="code -w" -export TERM=xterm-256color -export XDG_CONFIG_HOME=$HOME/.config +export TERM=xterm-256color # Sets the terminal type +export EDITOR="code -w" # $EDITOR use vscode in terminal +export XDG_CONFIG_HOME=$HOME/.config # Set Config directory -############################ -# BOBTHEFISH CONFIGURATION # -############################ -# Git -set -g theme_display_git yes -set -g theme_display_git_dirty yes -set -g theme_display_git_untracked yes -set -g theme_display_git_ahead_verbose yes -set -g theme_display_git_dirty_verbose yes -set -g theme_display_git_stashed_verbose yes -set -g theme_display_git_master_branch yes +########### +# ALIASES # +########### +# pacman and yay +alias pacsyu='sudo pacman -Syyu' # update only standard pkgs +alias yaysua='yay -Sua --noconfirm' # update only AUR pkgs +alias yaysyu='yay -Syu --noconfirm' # update standard pkgs and AUR pkgs +alias unlock='sudo rm /var/lib/pacman/db.lck' # remove pacman lock +alias cleanup='sudo pacman -Rns (pacman -Qtdq)' # remove orphaned packages -# Fonts -set -g theme_nerd_fonts yes +# get fastest mirrors +alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist" +alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist" +alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist" +alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist" -# Prompt -set -g theme_display_user yes -set -g fish_prompt_pwd_dir_length 0 -set -g theme_newline_cursor yes -set -g theme_title_display_process yes -set -g theme_title_display_user yes -set -g theme_display_hostname yes +# Colorize grep output (good for log files) +alias grep='grep --color=auto' +alias egrep='egrep --color=auto' +alias fgrep='fgrep --color=auto' -# Theme -set -g theme_color_scheme dracula +# confirm before overwriting something +alias cp="cp -i" +alias mv='mv -i' +alias rm='rm -i' -# Python -set -g theme_display_virtualenv yes -set -x VIRTUAL_ENV_DISABLE_PROMPT 1 +# gpg encryption +# verify signature for isos +alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify" +# receive the key of a developer +alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys" + +# bare git repo alias for dotfiles +alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' + +############### +# FISH PROMPT # +############### +# This was the 'sashimi' prompt from oh-my-fish. +function fish_prompt + source ~/.config/fish/conf.d/dracula.fish + set -l last_status $status + set -l cyan (set_color -o $fish_color_command) + set -l yellow (set_color -o $fish_color_quote) + set -g red (set_color -o $fish_color_error) + set -g blue (set_color -o blue) + set -l green (set_color -o $fish_color_operator) + set -g normal (set_color $fish_color_escape) + + set -l ahead (_git_ahead) + set -g whitespace ' ' + + if test $last_status = 0 + set initial_indicator "$green◆" + set status_indicator "$normal❯$cyan❯$green❯" + else + set initial_indicator "$red✖ $last_status" + set status_indicator "$red❯$red❯$red❯" + end + set -l cwd $cyan(basename (prompt_pwd)) + + if [ (_git_branch_name) ] + if test (_git_branch_name) = 'master' + set -l git_branch (_git_branch_name) + set git_info "$normal git:($red$git_branch$normal)" + else + set -l git_branch (_git_branch_name) + set git_info "$normal git:($blue$git_branch$normal)" + end + if [ (_is_git_dirty) ] + set -l dirty "$yellow ✗" + set git_info "$git_info$dirty" + end + end + # Notify if a command took more than 5 minutes + if [ "$CMD_DURATION" -gt 300000 ] + echo The last command took (math "$CMD_DURATION/1000") seconds. + end + + echo -n -s $initial_indicator $whitespace $cwd $git_info $whitespace $ahead $status_indicator $whitespace +end + +function _git_ahead + set -l commits (command git rev-list --left-right '@{upstream}...HEAD' ^/dev/null) + if [ $status != 0 ] + return + end + set -l behind (count (for arg in $commits; echo $arg; end | grep '^<')) + set -l ahead (count (for arg in $commits; echo $arg; end | grep -v '^<')) + switch "$ahead $behind" + case '' # no upstream + case '0 0' # equal to upstream + return + case '* 0' # ahead of upstream + echo "$blue↑$normal_c$ahead$whitespace" + case '0 *' # behind upstream + echo "$red↓$normal_c$behind$whitespace" + case '*' # diverged from upstream + echo "$blue↑$normal$ahead $red↓$normal_c$behind$whitespace" + end +end + +function _git_branch_name + echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') +end + +function _is_git_dirty + echo (command git status -s --ignore-submodules=dirty ^/dev/null) +end diff --git a/.config/fish/functions/fish_greeting.fish b/.config/fish/functions/fish_greeting.fish deleted file mode 100644 index 433ad3c..0000000 --- a/.config/fish/functions/fish_greeting.fish +++ /dev/null @@ -1,5 +0,0 @@ -function fish_greeting - set_color $fish_color_autosuggestion - echo "¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>" - set_color normal -end \ No newline at end of file diff --git a/.config/fish/functions/fish_prompt.fish b/.config/fish/functions/fish_prompt.fish deleted file mode 120000 index 62e385d..0000000 --- a/.config/fish/functions/fish_prompt.fish +++ /dev/null @@ -1 +0,0 @@ -/home/sravan/.local/share/omf/themes/bobthefish/fish_prompt.fish \ No newline at end of file diff --git a/.config/oh-my-fish b/.config/oh-my-fish deleted file mode 160000 index 4ff9981..0000000 --- a/.config/oh-my-fish +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4ff9981ac2082e2c06f37ce5c8ac344ee51605ad diff --git a/.gitmodules b/.gitmodules index e61c0fb..0d58cf3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,3 @@ [submodule ".config/slstatus"] path = .config/slstatus url = https://github.com/balajsra/slstatus.git -[submodule ".config/oh-my-fish"] - path = .config/oh-my-fish - url = git@github.com:oh-my-fish/oh-my-fish.git