addet some functionality
This commit is contained in:
parent
a77e07b6e0
commit
df727178f0
2 changed files with 72 additions and 69 deletions
37
config.fish
37
config.fish
|
@ -1,5 +1,5 @@
|
|||
if status is-interactive
|
||||
# ─< Commands to run in interactive sessions can go here >──────────────
|
||||
# ─< Commands to run in interactive sessions can go here >──────────────
|
||||
end
|
||||
|
||||
# ╭───────────────────────────────────────────────────╮
|
||||
|
@ -10,13 +10,13 @@ end
|
|||
# ╰───────────────────────────────────────────────────╯
|
||||
|
||||
# ────────────────────────────────────────< sources >──────────────────────────────────────
|
||||
source ./functions/setup.fish
|
||||
source $HOME/.config/fish/functions/setup.fish
|
||||
|
||||
# ─────────────────────────────────< Environment-Variables >───────────────────────────────
|
||||
set -p EDITOR (which nvim)
|
||||
|
||||
# ────────────────────────────────────< setup some stuff >────────────────────────────────────
|
||||
upin
|
||||
# set_alias
|
||||
dep_fisher
|
||||
check_fisher
|
||||
plugs_fisher
|
||||
|
@ -29,23 +29,23 @@ if command -v lsd >/dev/null 2>&1
|
|||
alias ll="lsd -lA"
|
||||
alias tree="lsd --tree"
|
||||
else
|
||||
# ─< exa >──────────────────────────────────────────────────────────────────────────────────
|
||||
if command -v exa >/dev/null 2>&1
|
||||
# ─< 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
|
||||
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 >─────────────────────────────────────────────────────
|
||||
else
|
||||
# ─< if nothing works -- plain old ls >─────────────────────────────────────────────────────
|
||||
alias ls="ls --color=always -lph"
|
||||
alias ll="ls --color=always -lAph"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# ─< colored everything >───────────────────────────────────────────────────────────────────
|
||||
|
@ -120,16 +120,16 @@ end
|
|||
if command -v fastfetch >/dev/null 2>&1
|
||||
alias ff="fastfetch"
|
||||
alias clearff="command clear & fastfetch"
|
||||
# ─< check for fastfetch module-existance >─────────────────────────────────────────────────
|
||||
# ─< check for fastfetch module-existance >─────────────────────────────────────────────────
|
||||
command fastfetch --config os >/dev/null 2>&1
|
||||
# ─< check the status >─────────────────────────────────────────────────────────────────────
|
||||
# ─< check the status >─────────────────────────────────────────────────────────────────────
|
||||
switch $status
|
||||
case 0
|
||||
alias f="fastfetch --config os"
|
||||
# ─< unsuccessfull, cloning repo >──────────────────────────────────────────────────────────
|
||||
# ─< 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 >────────────────────────────────────────────────
|
||||
# ─< execute fish to reinitialize aliasses >────────────────────────────────────────────────
|
||||
exec fish
|
||||
end
|
||||
clear & f
|
||||
|
@ -152,9 +152,9 @@ end
|
|||
|
||||
# ─< starship >─────────────────────────────────────────────────────────────────────────────
|
||||
if command -v starship >/dev/null 2>&1
|
||||
function starship_transient_prompt_func
|
||||
function starship_transient_prompt_func
|
||||
starship module character
|
||||
end
|
||||
end
|
||||
starship init fish | source
|
||||
enable_transience
|
||||
else
|
||||
|
@ -176,4 +176,3 @@ $toolbox
|
|||
$ALIASSES
|
||||
|
||||
"
|
||||
|
||||
|
|
|
@ -5,17 +5,17 @@ function upin
|
|||
|
||||
# ─< check for sudo/root >──────────────────────────────────────────────────────────────────
|
||||
if [ $USER = "root" ]
|
||||
set sudo ""
|
||||
set su ""
|
||||
else
|
||||
if command -v sudo >/dev/null 2>&1
|
||||
set sudo "sudo"
|
||||
set su "sudo"
|
||||
end
|
||||
end
|
||||
|
||||
# ─────────────────────────< START | distro/packagemanger detection >─────────────────────────
|
||||
# ─< DNF - Fedora >─────────────────────────────────────────────────────
|
||||
if command -v dnf
|
||||
set pkg "$sudo dnf"
|
||||
set pkg "$su dnf"
|
||||
set install "$pkg install"
|
||||
set update "$pkg update && $pkg upgrade"
|
||||
set search "$pkg search"
|
||||
|
@ -25,15 +25,15 @@ function upin
|
|||
|
||||
# ─< APT/NALA - Debian >────────────────────────────────────────────────
|
||||
if command -v nala >/dev/null 2>&1
|
||||
set pkg "$sudo nala"
|
||||
set pkg "$su nala"
|
||||
set install "$pkg update && $pkg install"
|
||||
set update "$pkg update && $pkg upgrade"
|
||||
set search "$pkg search"
|
||||
set remove "$pkg remove"
|
||||
set ALIASSES "-- You're using NALA aliases!! --"
|
||||
else
|
||||
if command -v apt-get >/dsudo ev/null 2>&1
|
||||
set pkg "$sudo apt-get"
|
||||
if command -v apt-get >/dev/null 2>&1
|
||||
set pkg "$su apt-get"
|
||||
set install "$pkg update && $pkg install"
|
||||
set update "$pkg update && $pkg upgrade"
|
||||
set search "$pkg search"
|
||||
|
@ -60,7 +60,7 @@ function upin
|
|||
set ALIASSES "-- You're using Arch!! - installed helper: yay --"
|
||||
else
|
||||
if command -v pacman >/dev/null 2>&1
|
||||
set pkg "$sudo pacman"
|
||||
set pkg "$su pacman"
|
||||
set install "$pkg -S"
|
||||
set update "$pkg -Syu"
|
||||
set search "$pkg -Ss"
|
||||
|
@ -72,7 +72,7 @@ function upin
|
|||
|
||||
# ─< Zypper - OpenSuse >────────────────────────────────────────────────────────────────────
|
||||
if command -v zypper >/dev/null 2>&1
|
||||
set pkg "$sudo zypper"
|
||||
set pkg "$su zypper"
|
||||
set install "$pkg in"
|
||||
set update "$pkg dup"
|
||||
set search "$pkg se"
|
||||
|
@ -84,15 +84,14 @@ function upin
|
|||
|
||||
# ─< APK - Alpine >─────────────────────────────────────────────────────────────────────────
|
||||
if command -v apk >/dev/null 2>&1
|
||||
set pkg "$sudo apk"
|
||||
set pkg "$su apk"
|
||||
set install "$pkg add"
|
||||
set update "$pkg update"
|
||||
set search "$pkg search"
|
||||
set ALIASSES "-- Alpine.. right, this fast os is evolving.. --"
|
||||
end
|
||||
if test -n "$install"
|
||||
set FISH_INSTALL "$install"
|
||||
|
||||
set -U FISH_INSTALL $install
|
||||
set vars "install" "update" "search" "remove"
|
||||
for env in $vars
|
||||
if not test -z "$env"
|
||||
|
@ -100,24 +99,8 @@ function upin
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# ╭───────────────────────────────────────────────╮
|
||||
# │ FUNCTION: alias detection || depends on: upin │
|
||||
# ╰───────────────────────────────────────────────╯
|
||||
# function set_alias
|
||||
# # ─< set variables to aliasses >────────────────────────────────────────────────────────────
|
||||
# if upin
|
||||
# set vars "install" "update" "search" "remove"
|
||||
# for env in $vars
|
||||
# if not test -z "$env"
|
||||
# alias "$env"="$$env"
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
# ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
# │ FUNCTION: Define function gsa (to ask the user which submodule to clone to which path and which name │
|
||||
# ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
@ -194,7 +177,8 @@ function dep_fisher
|
|||
if not command -v $dep >/dev/null 2>&1
|
||||
echo "Dependency $dep is not installed. Installing..."
|
||||
if test -n "$FISH_INSTALL"
|
||||
$FISH_INSTALL $dep
|
||||
alias fish_install="$FISH_INSTALL"
|
||||
fish_install $dep
|
||||
else
|
||||
echo "FISH_INSTALL is not defined: $FISH_INSTALL | Please install $dep manually."
|
||||
end
|
||||
|
@ -205,14 +189,34 @@ end
|
|||
# ╭───────────────────────────────────────────────────────╮
|
||||
# │ FUNCTION: check for fisher and install if not present │
|
||||
# ╰───────────────────────────────────────────────────────╯
|
||||
|
||||
function inst_fisher
|
||||
fisher install jorgebucaran/fisher
|
||||
end
|
||||
|
||||
function check_fisher
|
||||
if not test -e $HOME/.config/fish/functions/fisher.fish
|
||||
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source
|
||||
switch $CHECK_FISHER
|
||||
case true
|
||||
fisher update
|
||||
case '*'
|
||||
if test ! -e $HOME/.config/fish/functions/fisher.fish
|
||||
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish >> $HOME/.config/fish/functions/fisher.fish
|
||||
else
|
||||
fisher update >/dev/null 2>&1
|
||||
switch $status
|
||||
case 0
|
||||
set -U CHECK_FISHER "true"
|
||||
case '*'
|
||||
inst_fisher
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# ╭──────────────────────────────────╮
|
||||
# │ FUNCTION: install fisher plugins │
|
||||
# ╰──────────────────────────────────╯
|
||||
|
||||
function plugs_fisher
|
||||
# Define plugins to use with fisher
|
||||
set plugins "PatrickF1/fzf.fish" "jorgebucaran/autopair.fish"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue