if status is-interactive # ─< Commands to run in interactive sessions can go here >────────────── end # ╭───────────────────────────────────────────────────╮ # │ FISH CONFIG BY PIKA │ # │ │ # │ If you have any questions, check the git page at: │ # │ https://git.k4li.de/pika/fish.git │ # ╰───────────────────────────────────────────────────╯ # ────────────────────────────────────────< sources >────────────────────────────────────── source ./functions/git.fish # ─────────────────────────────────< Environment-Variables >─────────────────────────────── set -p EDITOR (which nvim) # ─────────────────────────< START | distro/packagemanger detection >───────────────────────── # ─< DNF - Fedora >───────────────────────────────────────────────────── if command -v dnf alias install='sudo dnf install' alias update='sudo dnf update && sudo dnf upgrade' alias search='sudo dnf search' alias remove='sudo dnf remove' set -a ALIASSES "-- You're using DNF aliases!! --" end # ─< APT/NALA - Debian >──────────────────────────────────────────────── if command -v nala >/dev/null 2>&1 alias install='sudo nala update && sudo nala install' alias update='sudo nala update && sudo nala upgrade' alias search='nala search' alias remove='sudo nala remove' set ALIASSES "-- You're using NALA aliases!! --" else if command -v apt >/dev/null 2>&1 alias install='sudo apt update && sudo apt install' alias update='sudo apt update && sudo apt upgrade' alias search='apt search' alias remove='sudo apt remove' set ALIASSES "-- You're using APT aliases!! --" end end # ─< Pacman - Arch >──────────────────────────────────────────────────── if command -v yay >/dev/null 2>&1 alias install='yay -S' alias update='yay -Syu' alias search='yay -Ss' alias remove='yay -R' set ALIASSES "-- You're using Arch!! - installed helper: yay --" else if command -v paru >/dev/null 2>&1 alias install='paru -S' alias update='paru -Syu' alias search='paru -Ss' alias remove='paru -R' set ALIASSES "-- You're using Arch!! - installed helper: paru --" else if command -v pacman >/dev/null 2>&1 alias install='sudo pacman -S' alias update='sudo pacman -Syu' alias remove='sudo pacman -R' set ALIASSES "-- by the PACMAN - You're using Arch!! --" end end end # ─< Zypper - OpenSuse >──────────────────────────────────────────────────────────────────── if command -v zypper >/dev/null 2>&1 alias install='sudo zypper in' alias update='sudo zypper dup' alias search='sudo zypper se' alias lock='sudo zypper al' alias remove='sudo zypper rm' set ALIASSES "-- I see.. you're using OpenSUSE. i like <3 -- -- ZYPPER -- " end # ─< APK - Alpine >───────────────────────────────────────────────────────────────────────── if command -v apk >/dev/null 2>&1 alias install='sudo apk add' alias update='sudo apk update' alias search='sudo apk search' set ALIASSES "-- Alpine.. right, this fast os is evolving.. --" end # ──────────────────────────< END | distro/packagemanger detection >────────────────────────── # ─< colorized ls >───────────────────────────────────────────────────────────────────────── # ─< lsd >────────────────────────────────────────────────────────────────────────────────── if command -v lsd >/dev/null 2>&1 alias ls='lsd -l' alias ll='lsd -lA' alias tree='lsd --tree' else # ─< exa >────────────────────────────────────────────────────────────────────────────────── if command -v exa >/dev/null 2>&1 alias ls='exa --icons -l' alias ll='exa --icons -laa' alias tree='exa --icons -l -tree' else # ─< eza >────────────────────────────────────────────────────────────────────────────────── if command -v eza >/dev/null 2>&1 alias ls='eza --icons -l' alias ll='eza --icons -laa' alias tree='eza --icons -l -tree' else # ─< if nothing works -- plain old ls >───────────────────────────────────────────────────── alias ls='ls --color=always -lph' alias ll='ls --color=always -lAph' end end end # ─< colored everything >─────────────────────────────────────────────────────────────────── alias ip="ip --color=always" alias grep="grep --color=always" # ─< weather >────────────────────────────────────────────────────────────────────────────── alias www='curl wttr.in/Ulm' # ─< rsync >──────────────────────────────────────────────────────────────────────────────── if command -v rsync >/dev/null 2>&1 alias cp='rsync -avP' alias scp='rsync -avP' end # ─< bat alias >──────────────────────────────────────────────────────────────────────────── if command -v batcat >/dev/null 2>&1 alias cat='batcat --color=always -p --paging=never' end # ─< batcat alias >───────────────────────────────────────────────────────────────────────── if command -v bat >/dev/null 2>&1 alias cat='bat --color=always -p' end # ─< t stands for tmux >──────────────────────────────────────────────────────────────────── if command -v tmux >/dev/null 2>&1 alias ts="tmux source $HOME/.tmux.conf" alias ta="tmux a" alias t="tmux" end # ─< d stands for docker >────────────────────────────────────────────────────────────────── if command -v docker >/dev/null 2>&1 alias up='docker compose up' alias down='docker compose down' alias pull='docker compose pull' alias d='docker' alias dr='docker run --rm -it' alias ds='docker ps -a' alias dc='docker compose' alias appudpate='docker pull && docker compose up -d --force-recreate' end # ─< g stands for git >───────────────────────────────────────────────────────────────────── if command -v git >/dev/null 2>&1 alias g='git' alias gs='git status' alias gf='git fetch' alias gf='git fetch && git merge' alias gc='git clone --recurse-submodule' alias ga='git add' alias gp='git pull --recurse-submodule' alias gsu='git submodule foreach git pull && git add . && git commit -m " updated 📌submodules" && echo "-- Committed changes, pushing now.." && sleep 1.5 && git push' alias gcm='git commit -m' alias gpu='git push --recurse-submodule=on-demand' end # ─< fastfetch >──────────────────────────────────────────────────────────────────────────── if command -v fastfetch >/dev/null 2>&1 alias ff='fastfetch' alias clearff='command clear & fastfetch' # ─< check for fastfetch module-existance >───────────────────────────────────────────────── command fastfetch --config os >/dev/null 2>&1 # ─< check the status >───────────────────────────────────────────────────────────────────── switch $status case 0 alias f='fastfetch --config os' # ─< unsuccessfull, cloning repo >────────────────────────────────────────────────────────── case '*' git clone https://git.k4li.de/mirror/fastfetch $HOME/.local/share/fastfetch >/dev/null 2>&1 # ─< execute fish to reinitialize aliasses >──────────────────────────────────────────────── exec fish end clear & f alias clear='clear & f' end # ─< set nmap-alias >─────────────────────────────────────────────────────────────────────── if command -v nmap >/dev/null 2>&1 alias scanvuln='sudo nmap --script vuln -vvv' alias sv='scanvuln' alias portscan='sudo nmap -sT' alias ps='portscan' end # ────────────────────────────────────────< functions >───────────────────────────────────── # ─< z stands for Zoxide >────────────────────────────────────────────────────────────────── if command -v zoxide >/dev/null 2>&1 zoxide init fish | source end # ─< starship >───────────────────────────────────────────────────────────────────────────── if command -v starship >/dev/null 2>&1 function starship_transient_prompt_func starship module character end starship init fish | source enable_transience end #set colorscheme for bobthefish #if test -d $HOME/.config/fish/functions/ # set -g theme_nerd_fonts yes # set -g defaults_user ($USER) # # available options: dark, light, solarized(-dark/-light), base16(-dark/-light), zenburn, gruvbox(-light), dracula, nord, catppuccin-(latte/frappe/macchiato/mocha) # set -g theme_color_scheme catppuccin-mocha #end set -a TOOLBOX "$warnings  $toolbox  $ALIASSES  "