changed spacing

This commit is contained in:
PieckA 2024-05-25 15:59:59 +02:00
parent 191c06b390
commit a77e07b6e0
2 changed files with 170 additions and 170 deletions

View file

@ -3,103 +3,103 @@
# ╰────────────────────────────────────╯
function upin
# ─< check for sudo/root >──────────────────────────────────────────────────────────────────
if [ $USER = "root" ]
set sudo ""
else
if command -v sudo >/dev/null 2>&1
set sudo "sudo"
end
end
# ─────────────────────────< START | distro/packagemanger detection >─────────────────────────
# ─< DNF - Fedora >─────────────────────────────────────────────────────
if command -v dnf
set pkg "$sudo dnf"
set install "$pkg install"
set update "$pkg update && $pkg upgrade"
set search "$pkg search"
set remove "$pkg remove"
set -a ALIASSES "-- You're using DNF aliases!! --"
end
# ─< APT/NALA - Debian >────────────────────────────────────────────────
if command -v nala >/dev/null 2>&1
set pkg "$sudo 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!! --"
# ─< check for sudo/root >──────────────────────────────────────────────────────────────────
if [ $USER = "root" ]
set sudo ""
else
if command -v apt-get >/dsudo ev/null 2>&1
set pkg "$sudo apt-get"
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 APT aliases!! --"
end
end
if command -v sudo >/dev/null 2>&1
set sudo "sudo"
end
end
# ─< Pacman - Arch >────────────────────────────────────────────────────
if command -v paru >/dev/null 2>&1
set pkg "paru"
set install "$pkg -S"
set update "$pkg -Syu"
set search "$pkg -Ss"
set remove "$pkg -R"
set ALIASSES "-- You're using Arch!! - installed helper: paru --"
else
if command -v yay >/dev/null 2>&1
set pkg "yay"
set install "$pkg -S"
set update "$pkg -Syu"
set search "$pkg -Ss"
set remove "$pkg -R"
set ALIASSES "-- You're using Arch!! - installed helper: yay --"
else
if command -v pacman >/dev/null 2>&1
set pkg "$sudo pacman"
set install "$pkg -S"
set update "$pkg -Syu"
set search "$pkg -Ss"
set remove "$pkg -R"
set ALIASSES "-- by the PACMAN - You're using Arch!! --"
end
end
end
# ─────────────────────────< START | distro/packagemanger detection >─────────────────────────
# ─< DNF - Fedora >─────────────────────────────────────────────────────
if command -v dnf
set pkg "$sudo dnf"
set install "$pkg install"
set update "$pkg update && $pkg upgrade"
set search "$pkg search"
set remove "$pkg remove"
set -a ALIASSES "-- You're using DNF aliases!! --"
end
# ─< Zypper - OpenSuse >────────────────────────────────────────────────────────────────────
if command -v zypper >/dev/null 2>&1
set pkg "$sudo zypper"
set install "$pkg in"
set update "$pkg dup"
set search "$pkg se"
set remove "$pkg rm"
alias lock="$pkg al"
set ALIASSES "-- I see.. you're using OpenSUSE. i like <3 --
-- ZYPPER -- "
end
# ─< APT/NALA - Debian >────────────────────────────────────────────────
if command -v nala >/dev/null 2>&1
set pkg "$sudo 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"
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 APT aliases!! --"
end
end
# ─< APK - Alpine >─────────────────────────────────────────────────────────────────────────
if command -v apk >/dev/null 2>&1
set pkg "$sudo 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"
# ─< Pacman - Arch >────────────────────────────────────────────────────
if command -v paru >/dev/null 2>&1
set pkg "paru"
set install "$pkg -S"
set update "$pkg -Syu"
set search "$pkg -Ss"
set remove "$pkg -R"
set ALIASSES "-- You're using Arch!! - installed helper: paru --"
else
if command -v yay >/dev/null 2>&1
set pkg "yay"
set install "$pkg -S"
set update "$pkg -Syu"
set search "$pkg -Ss"
set remove "$pkg -R"
set ALIASSES "-- You're using Arch!! - installed helper: yay --"
else
if command -v pacman >/dev/null 2>&1
set pkg "$sudo pacman"
set install "$pkg -S"
set update "$pkg -Syu"
set search "$pkg -Ss"
set remove "$pkg -R"
set ALIASSES "-- by the PACMAN - You're using Arch!! --"
end
end
end
set vars "install" "update" "search" "remove"
for env in $vars
if not test -z "$env"
alias "$env"="$$env"
end
end
end
# ─< Zypper - OpenSuse >────────────────────────────────────────────────────────────────────
if command -v zypper >/dev/null 2>&1
set pkg "$sudo zypper"
set install "$pkg in"
set update "$pkg dup"
set search "$pkg se"
set remove "$pkg rm"
alias lock="$pkg al"
set ALIASSES "-- I see.. you're using OpenSUSE. i like <3 --
-- ZYPPER -- "
end
# ─< APK - Alpine >─────────────────────────────────────────────────────────────────────────
if command -v apk >/dev/null 2>&1
set pkg "$sudo 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 vars "install" "update" "search" "remove"
for env in $vars
if not test -z "$env"
alias "$env"="$$env"
end
end
end
end
@ -122,64 +122,64 @@ end
# │ FUNCTION: Define function gsa (to ask the user which submodule to clone to which path and which name │
# ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
function gsa
set dir $PWD
echo "-- these are the current submodules --"
if command -v rg >/dev/null 2>&1
echo "-- for $dir --"
rg -i submodule (echo $dir/.gitmodules)
end
set dir $PWD
echo "-- these are the current submodules --"
if command -v rg >/dev/null 2>&1
echo "-- for $dir --"
rg -i submodule (echo $dir/.gitmodules)
end
# ─< Prompt the user to enter the repository URL to add as a submodule >────────────────────
echo "-- enter the repository to add as a submodule --"
read repo
# ─< Prompt the user to enter the repository URL to add as a submodule >────────────────────
echo "-- enter the repository to add as a submodule --"
read repo
# ─< Prompt the user to enter the branch to checkout (e.g., main, master) >─────────────────
echo "-- enter the branch to checkout (main/master..) --"
read branch
# ─< Prompt the user to enter the branch to checkout (e.g., main, master) >─────────────────
echo "-- enter the branch to checkout (main/master..) --"
read branch
# ─< Prompt the user to enter the relative path where the submodule will be cloned >────────
# ─< Advise not to use the leading / or ./ >────────────────────────────────────────────────
echo "-- enter the relative path, where the submodule will be cloned to. (!! do it like this: ./path/to/clone/to) --"
read -S path
# ─< Prompt the user to enter the relative path where the submodule will be cloned >────────
# ─< Advise not to use the leading / or ./ >────────────────────────────────────────────────
echo "-- enter the relative path, where the submodule will be cloned to. (!! do it like this: ./path/to/clone/to) --"
read -S path
echo "-- enter a name for the submodule --"
read -l name
echo "-- enter a name for the submodule --"
read -l name
# ─< Ask the user for confirmation if the constructed command looks correct >───────────────
echo "git submodule add --branch $branch $repo $path"
echo "-- does this command look right to you? [y/n] --"
read -l comm
# ─< Ask the user for confirmation if the constructed command looks correct >───────────────
echo "git submodule add --branch $branch $repo $path"
echo "-- does this command look right to you? [y/n] --"
read -l comm
# ─< Switch statement to handle the user's confirmation input >─────────────────────────────
switch $comm
# ─< If the user inputs 'y' or 'Y', execute the git submodule add command >─────────────────
# ─< Switch statement to handle the user's confirmation input >─────────────────────────────
switch $comm
# ─< If the user inputs 'y' or 'Y', execute the git submodule add command >─────────────────
case 'y' 'Y'
git submodule add --branch $branch --name $name $repo $path
git submodule update --init --recursive
git add .
git commit -m "Addet $name as a submodule"
git push
git submodule add --branch $branch --name $name $repo $path
git submodule update --init --recursive
git add .
git commit -m "Addet $name as a submodule"
git push
# ─< If the user inputs 'n' or 'N', notify them to try again >──────────────────────────────
# ─< If the user inputs 'n' or 'N', notify them to try again >──────────────────────────────
case 'n' 'N'
echo "-- all right, just try again :) --"
end
echo "-- all right, just try again :) --"
end
end
# ╭───────────────────────────────────────────────────╮
# │ FUNCTION: set tmux command to always work with ta │
# ╰───────────────────────────────────────────────────╯
if command -v tmux >/dev/null 2>&1
function ta
if command tmux list-sessions >/dev/null 2>&1
echo "Tmux session found. Entering it now! --"
sleep 0.5
tmux a
else
echo "No Tmux session found. Creating one now! --"
tmux
end
end
function ta
if command tmux list-sessions >/dev/null 2>&1
echo "Tmux session found. Entering it now! --"
sleep 0.5
tmux a
else
echo "No Tmux session found. Creating one now! --"
tmux
end
end
end
# ╭────────────────────────────────────────────╮