271 lines
13 KiB
Fish
271 lines
13 KiB
Fish
if status is-interactive
|
|
# ─< Commands to run in interactive sessions can go here >──────────────
|
|
end
|
|
|
|
# __ _ __ _ _
|
|
# / _(_) / _(_) | |
|
|
# ___ ___ _ __ | |_ _ __ _ | |_ _ ___| |__
|
|
# / __/ _ \| '_ \| _| |/ _` | | _| / __| '_ \
|
|
# | (_| (_) | | | | | | | (_| |_| | | \__ \ | | |
|
|
# \___\___/|_| |_|_| |_|\__, (_)_| |_|___/_| |_|
|
|
# __/ |
|
|
# |___/
|
|
# _ ___ _ _
|
|
# | | / _ \| | |
|
|
# | |__ _ _ / /_\ \ | | ___ _____ ____ __
|
|
# | '_ \| | | | | _ | | |/ _ \/ _ \ \/ /\ \/ /
|
|
# | |_) | |_| | | | | | | | __/ __/> < > <
|
|
# |_.__/ \__, | \_| |_/_|_|\___|\___/_/\_\/_/\_\
|
|
# __/ |
|
|
# |___/
|
|
|
|
# ─────────────────────────────────< Environment-Variables >───────────────────────────────
|
|
set fish_greeting
|
|
set toolbox "The following tools are active:
|
|
"
|
|
set warnings "The following packages are NOT active:
|
|
|
|
"
|
|
|
|
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='pwd && lsd -lA && pwd'
|
|
alias tree='lsd --tree'
|
|
set -a toolbox " ls is using $(which lsd)
|
|
"
|
|
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'
|
|
set -a toolbox " ls is using $(which exa)
|
|
"
|
|
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'
|
|
set -a toolbox " ls is using $(which eza)
|
|
"
|
|
else
|
|
# ─< if nothing works -- plain old ls >─────────────────────────────────────────────────────
|
|
alias ls='ls --color=always -lph'
|
|
alias ll='ls --color=always -lAph'
|
|
set -a toolbox " using plain old ls, but with colors!!
|
|
"
|
|
set -a warnings " no ls helper is installed [lsd, eza, exa..]
|
|
"
|
|
end
|
|
end
|
|
end
|
|
|
|
# ─< colored everything >───────────────────────────────────────────────────────────────────
|
|
alias ip="ip -c"
|
|
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'
|
|
end
|
|
|
|
# ─< bat alias >────────────────────────────────────────────────────────────────────────────
|
|
if command -v batcat >/dev/null 2>&1
|
|
alias cat='batcat --color=always -p --paging=never'
|
|
set -a toolbox " cat is using $(which batcat)
|
|
"
|
|
else
|
|
|
|
# ─< batcat alias >─────────────────────────────────────────────────────────────────────────
|
|
if command -v bat >/dev/null 2>&1
|
|
alias cat='bat --color=always -p'
|
|
set -a toolbox " cat is using $(which bat)
|
|
"
|
|
else
|
|
set -a warnings " bat
|
|
"
|
|
end
|
|
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"
|
|
set -a toolbox " t is using $(which tmux)
|
|
"
|
|
else
|
|
set -a warnings " 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'
|
|
set -a toolbox " d is using $(which docker) [docker]
|
|
"
|
|
else
|
|
set -a warnings " docker
|
|
"
|
|
end
|
|
|
|
|
|
|
|
# ─< g stands for git >─────────────────────────────────────────────────────────────────────
|
|
if command -v git >/dev/null 2>&1
|
|
alias g='git'
|
|
alias gs='git status'
|
|
alias gc='git clone'
|
|
alias gsu='git submodule update --recursive && git submodule sync --recursive && git status'
|
|
alias ga='git add && gs'
|
|
alias gcm='git commit'
|
|
alias gp='git pull --recurse-submodule=on-demand'
|
|
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/pika/fastfetch $HOME/.local/share/fastfetch >/dev/null 2>&1
|
|
# ─< execute fish to reinitialize aliasses >────────────────────────────────────────────────
|
|
exec fish
|
|
end
|
|
clear & f
|
|
alias clear='clear & f && pwd'
|
|
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
|
|
|
|
"
|
|
|