diff options
| author | Omar Magdy <omar.professional8777@gmail.com> | 2022-05-01 20:44:50 +0200 |
|---|---|---|
| committer | Omar Magdy <omar.professional8777@gmail.com> | 2022-05-01 20:44:50 +0200 |
| commit | eb0b9810327ef76c6239dc5ae1b3a7f8f6f4e503 (patch) | |
| tree | a56d57dd16dcc801e3d6b7c85df28bd0675d2246 /fish/.config | |
| parent | a259cfdb27261d30922609f975342d320703bff7 (diff) | |
| download | dotfiles-eb0b9810327ef76c6239dc5ae1b3a7f8f6f4e503.tar.xz dotfiles-eb0b9810327ef76c6239dc5ae1b3a7f8f6f4e503.zip | |
Added fish config
Diffstat (limited to 'fish/.config')
| -rw-r--r-- | fish/.config/fish/conf.d/omf.fish | 7 | ||||
| -rwxr-xr-x | fish/.config/fish/config.fish | 186 | ||||
| -rw-r--r-- | fish/.config/fish/fish_variables | 86 | ||||
| l--------- | fish/.config/fish/functions/fish_prompt.fish | 1 |
4 files changed, 280 insertions, 0 deletions
diff --git a/fish/.config/fish/conf.d/omf.fish b/fish/.config/fish/conf.d/omf.fish new file mode 100644 index 0000000..3e0f6d6 --- /dev/null +++ b/fish/.config/fish/conf.d/omf.fish @@ -0,0 +1,7 @@ +# 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/fish/.config/fish/config.fish b/fish/.config/fish/config.fish new file mode 100755 index 0000000..145fdc2 --- /dev/null +++ b/fish/.config/fish/config.fish @@ -0,0 +1,186 @@ +## Set values +# Hide welcome message +fish_vi_key_bindings +set VIRTUAL_ENV_DISABLE_PROMPT "1" +set -x MANPAGER "sh -c 'col -bx | bat -l man -p'" + +## Export variable need for qt-theme +if type "qtile" >> /dev/null 2>&1 + set -x QT_QPA_PLATFORMTHEME "qt5ct" +end + +# Set settings for https://github.com/franciscolourenco/done +set -U __done_min_cmd_duration 10000 +set -U __done_notification_urgency_level low + + +## Environment setup +# Apply .profile: use this to put fish compatible .profile stuff in +if test -f ~/.fish_profile + source ~/.fish_profile +end + +# Add ~/.local/bin to PATH +if test -d ~/.local/bin + if not contains -- ~/.local/bin $PATH + set -p PATH ~/.local/bin + end +end + +# Add depot_tools to PATH +if test -d ~/Applications/depot_tools + if not contains -- ~/Applications/depot_tools $PATH + set -p PATH ~/Applications/depot_tools + end +end + +set -p PATH ~/.scripts +set -p PATH /home/omar/eclipse/java-2021-12/eclipse +set -p PATH ~/bin + + + +## Starship prompt +if status --is-interactive + source ("/usr/bin/starship" init fish --print-full-init | psub) +end + +## Advanced command-not-found hook +#source /usr/share/doc/find-the-command/ftc.fish + +## Functions +# Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang +function __history_previous_command + switch (commandline -t) + case "!" + commandline -t $history[1]; commandline -f repaint + case "*" + commandline -i ! + end +end + +function __history_previous_command_arguments + switch (commandline -t) + case "!" + commandline -t "" + commandline -f history-token-search-backward + case "*" + commandline -i '$' + end +end + +if [ "$fish_key_bindings" = fish_vi_key_bindings ]; + bind -Minsert ! __history_previous_command + bind -Minsert '$' __history_previous_command_arguments +else + bind ! __history_previous_command + bind '$' __history_previous_command_arguments +end + +# Fish command history +function history + builtin history --show-time='%F %T ' +end + +function backup --argument filename + cp $filename $filename.bak +end + +# Copy DIR1 DIR2 +function copy + set count (count $argv | tr -d \n) + if test "$count" = 2; and test -d "$argv[1]" + set from (echo $argv[1] | trim-right /) + set to (echo $argv[2]) + command cp -r $from $to + else + command cp $argv + end +end + +## Useful aliases +#Aliases to setbrightness +alias setbright1='xrandr --output HDMI-0 --brightness 1.00' #Sets the brightness to 1.00 +alias setbright75='xrandr --output HDMI-0 --brightness 0.75' #Sets the brightness to 0.75 +alias setbright50='xrandr --output HDMI-0 --brightness 0.50' #Sets the brightness to 0.50 +alias setbright40='xrandr --output HDMI-0 --brightness 0.40' #Sets the brightness to 0.40 +alias setbright30='xrandr --output HDMI-0 --brightness 0.30' #Sets the brightness to 0.30 + +# Replace ls with exa +alias ls='exa -al --color=always --group-directories-first --icons' # preferred listing +alias la='exa -a --color=always --group-directories-first --icons' # all files and dirs +alias ll='exa -l --color=always --group-directories-first --icons' # long format +alias lt='exa -aT --color=always --group-directories-first --icons' # tree listing +alias l.="exa -a | egrep '^\.'" # show only dotfiles + +# Aliases for quickly accessing config files(fish, bash, alacritty,etc..) +alias cf='vim ~/.config/fish/config.fish' # for quickly accessing fish config file +alias cb='vim .bashrc' # for quickly accessing bash config file +alias ca='vim ~/.config/alacritty/alacritty.yml' # for quickly acssesing alacritty config file +alias ck='vim ~/.config/kitty/kitty.conf' +alias cw='vim ~/.config/awesome/rc.lua' + +# Replace some more things with better alternatives +alias cat='bat --style header --style rules --style snip --style changes --style header' +[ ! -x /usr/bin/yay ] && [ -x /usr/bin/paru ] && alias yay='paru' + +#Media player utilities +alias pause='playerctl -p spotify pause' +alias play='playerctl -p spotify play' +# Common use +alias book='/home/omar/.scripts/books.sh' +alias poweroff='systemctl poweroff' +alias reboot='systemctl reboot' +alias grubup="sudo update-grub" +alias fixpacman="sudo rm /var/lib/pacman/db.lck" +alias tarnow='tar -acf ' +alias untar='tar -zxvf ' +alias wget='wget -c ' +alias rmpkg="sudo pacman -Rdd" +alias psmem='ps auxf | sort -nr -k 4' +alias psmem10='ps auxf | sort -nr -k 4 | head -10' +alias upd='/usr/bin/update' +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' +alias .....='cd ../../../..' +alias ......='cd ../../../../..' +alias dir='dir --color=auto' +alias vdir='vdir --color=auto' +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' +alias hw='hwinfo --short' # Hardware Info +alias big="expac -H M '%m\t%n' | sort -h | nl" # Sort installed packages according to size in MB +alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # List amount of -git packages + +# 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" + +# Help people new to Arch +alias apt='man pacman' +alias apt-get='man pacman' +alias please='sudo' +alias tb='nc termbin.com 9999' + +# Cleanup orphaned packages +alias cleanup='sudo pacman -Rns (pacman -Qtdq)' + +# Get the error messages from journalctl +alias jctl="journalctl -p 3 -xb" + +# Recent installed packages +alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl" + +#Cool terminal stuff(pipes, convo, etc...) +alias pipes='cd pipes.sh;./pipes.sh';cd + +# Run paleofetch if session is interactive +if status --is-interactive + colorscript random +end + +#export booksh="/run/media/omar/New Volume/Omar/Self learning/Books/English books/Self help/PDF/" diff --git a/fish/.config/fish/fish_variables b/fish/.config/fish/fish_variables new file mode 100644 index 0000000..9b83804 --- /dev/null +++ b/fish/.config/fish/fish_variables @@ -0,0 +1,86 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR __done_min_cmd_duration:10000 +SETUVAR __done_notification_urgency_level:low +SETUVAR __fish_initialized:3400 +SETUVAR dangerous_colors:000000\x1e083743\x1e445659\x1efdf6e3\x1eb58900\x1ecb4b16\x1edc121f\x1eaf005f\x1e6c71c4\x1e268bd2\x1e2aa198\x1e859900 +SETUVAR dangerous_cursors:\x5c033\x5d12\x3b\x23268bd2\x5c007\x1e\x5c033\x5d12\x3b\x23b58900\x5c007\x1e\x5c033\x5d12\x3b\x23af005f\x5c007\x1e\x5c033\x5d12\x3b\x236c71c4\x5c007 +SETUVAR dangerous_day:000000\x1e333333\x1e666666\x1effffff\x1effff00\x1eff6600\x1eff0000\x1eff0033\x1e3300ff\x1e00aaff\x1e00ffff\x1e00ff00 +SETUVAR dangerous_night:000000\x1e083743\x1e445659\x1efdf6e3\x1eb58900\x1ecb4b16\x1edc121f\x1eaf005f\x1e6c71c4\x1e268bd2\x1e2aa198\x1e859900 +SETUVAR dangerous_nocmdhist:c\x1ed\x1ell\x1els\x1em\x1es +SETUVAR dangerous_pwdstyle:short\x1elong\x1enone +SETUVAR dangerous_sessions_active:\x1d +SETUVAR dangerous_sessions_active_pid:\x1d +SETUVAR fish_color_autosuggestion:555\x1ebrblack +SETUVAR fish_color_cancel:\x2dr +SETUVAR fish_color_command:005fd7 +SETUVAR fish_color_comment:990000 +SETUVAR fish_color_cwd:green +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:009900 +SETUVAR fish_color_error:ff0000 +SETUVAR fish_color_escape:00a6b2 +SETUVAR fish_color_history_current:\x2d\x2dbold +SETUVAR fish_color_host:normal +SETUVAR fish_color_host_remote:yellow +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:00a6b2 +SETUVAR fish_color_param:00afff +SETUVAR fish_color_quote:999900 +SETUVAR fish_color_redirection:00afff +SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_status:red +SETUVAR fish_color_user:brgreen +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_key_bindings:fish_vi_key_bindings +SETUVAR fish_pager_color_completion:\x1d +SETUVAR fish_pager_color_description:B3A06D\x1eyellow +SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan +SETUVAR fish_pager_color_selected_background:\x2dr +SETUVAR pure_begin_prompt_with_current_directory:true +SETUVAR pure_check_for_new_release:false +SETUVAR pure_color_at_sign:pure_color_mute +SETUVAR pure_color_command_duration:pure_color_warning +SETUVAR pure_color_current_directory:pure_color_primary +SETUVAR pure_color_danger:red +SETUVAR pure_color_dark:black +SETUVAR pure_color_git_branch:pure_color_mute +SETUVAR pure_color_git_dirty:pure_color_mute +SETUVAR pure_color_git_stash:pure_color_info +SETUVAR pure_color_git_unpulled_commits:pure_color_info +SETUVAR pure_color_git_unpushed_commits:pure_color_info +SETUVAR pure_color_hostname:pure_color_mute +SETUVAR pure_color_info:cyan +SETUVAR pure_color_jobs:pure_color_normal +SETUVAR pure_color_light:white +SETUVAR pure_color_mute:brblack +SETUVAR pure_color_normal:normal +SETUVAR pure_color_prefix_root_prompt:pure_color_danger +SETUVAR pure_color_primary:blue +SETUVAR pure_color_prompt_on_error:pure_color_danger +SETUVAR pure_color_prompt_on_success:pure_color_success +SETUVAR pure_color_success:magenta +SETUVAR pure_color_system_time:pure_color_mute +SETUVAR pure_color_username_normal:pure_color_mute +SETUVAR pure_color_username_root:pure_color_light +SETUVAR pure_color_virtualenv:pure_color_mute +SETUVAR pure_color_warning:yellow +SETUVAR pure_enable_git:true +SETUVAR pure_enable_single_line_prompt:false +SETUVAR pure_reverse_prompt_symbol_in_vimode:true +SETUVAR pure_separate_prompt_on_error:false +SETUVAR pure_show_jobs:false +SETUVAR pure_show_prefix_root_prompt:false +SETUVAR pure_show_subsecond_command_duration:false +SETUVAR pure_show_system_time:false +SETUVAR pure_symbol_git_dirty:\x2a +SETUVAR pure_symbol_git_stash:\u2261 +SETUVAR pure_symbol_git_unpulled_commits:\u21e3 +SETUVAR pure_symbol_git_unpushed_commits:\u21e1 +SETUVAR pure_symbol_prefix_root_prompt:\x23 +SETUVAR pure_symbol_prompt:\u276f +SETUVAR pure_symbol_reverse_prompt:\u276e +SETUVAR pure_symbol_title_bar_separator:\x2d +SETUVAR pure_threshold_command_duration:5 diff --git a/fish/.config/fish/functions/fish_prompt.fish b/fish/.config/fish/functions/fish_prompt.fish new file mode 120000 index 0000000..32a6684 --- /dev/null +++ b/fish/.config/fish/functions/fish_prompt.fish @@ -0,0 +1 @@ +/home/peng/.local/share/omf/themes/flash/fish_prompt.fish
\ No newline at end of file |
