addet notification

This commit is contained in:
pika 2024-05-29 00:02:33 +02:00
parent ff58249281
commit 3f6854977f

View file

@ -1,9 +1,6 @@
# ╭────────────────────────────────────╮ # ─────────────< Check for packagemanager and alias everything for easy use :) >───────────
# │ FUNCTION: packagemanager detection │
# ╰────────────────────────────────────╯
function upin function upin
# ─< check for sudo/root >────────────────────────────────────────────────────────────────── # ─< check for sudo/root >──────────────────────────────────────────────────────────────────
if [ $USER = "root" ] if [ $USER = "root" ]
set su "" set su ""
@ -14,6 +11,7 @@ function upin
end end
# ─────────────────────────< START | distro/packagemanger detection >───────────────────────── # ─────────────────────────< START | distro/packagemanger detection >─────────────────────────
# ─< DNF - Fedora >───────────────────────────────────────────────────── # ─< DNF - Fedora >─────────────────────────────────────────────────────
if command -v dnf if command -v dnf
set pkg "$su dnf" set pkg "$su dnf"
@ -22,7 +20,6 @@ function upin
set search "$pkg search" set search "$pkg search"
set remove "$pkg remove" set remove "$pkg remove"
set unattendet "$pkg install -y" set unattendet "$pkg install -y"
set -a ALIASES "-- You're using DNF aliases!! --"
end end
# ─< APT/NALA - Debian >──────────────────────────────────────────────── # ─< APT/NALA - Debian >────────────────────────────────────────────────
@ -33,7 +30,6 @@ function upin
set search "$pkg search" set search "$pkg search"
set remove "$pkg remove" set remove "$pkg remove"
set unattendet "$pkg install --assume-yes" set unattendet "$pkg install --assume-yes"
set ALIASES "-- You're using NALA aliases!! --"
else else
if command -v apt-get >/dev/null 2>&1 if command -v apt-get >/dev/null 2>&1
set pkg "$su apt-get" set pkg "$su apt-get"
@ -42,7 +38,6 @@ function upin
set search "$pkg search" set search "$pkg search"
set remove "$pkg remove" set remove "$pkg remove"
set unattendet "$pkg install --assume-yes" set unattendet "$pkg install --assume-yes"
set ALIASES "-- You're using APT aliases!! --"
end end
end end
@ -54,7 +49,6 @@ function upin
set search "$pkg -Ss" set search "$pkg -Ss"
set remove "$pkg -R" set remove "$pkg -R"
set unattendet "$pkg install --noconfirm" set unattendet "$pkg install --noconfirm"
set ALIASES "-- You're using Arch!! - installed helper: paru --"
else else
if command -v yay >/dev/null 2>&1 if command -v yay >/dev/null 2>&1
set pkg "yay" set pkg "yay"
@ -63,7 +57,6 @@ function upin
set search "$pkg -Ss" set search "$pkg -Ss"
set remove "$pkg -R" set remove "$pkg -R"
set unattendet "$pkg install --noconfirm" set unattendet "$pkg install --noconfirm"
set ALIASES "-- You're using Arch!! - installed helper: yay --"
else else
if command -v pacman >/dev/null 2>&1 if command -v pacman >/dev/null 2>&1
set pkg "$su pacman" set pkg "$su pacman"
@ -72,7 +65,6 @@ function upin
set search "$pkg -Ss" set search "$pkg -Ss"
set remove "$pkg -R" set remove "$pkg -R"
set unattendet "$pkg install --noconfirm" set unattendet "$pkg install --noconfirm"
set ALIASES "-- by the PACMAN - You're using Arch!! --"
end end
end end
end end
@ -85,8 +77,7 @@ function upin
set search "$pkg se" set search "$pkg se"
set remove "$pkg rm" set remove "$pkg rm"
alias lock="$pkg al" alias lock="$pkg al"
set ALIASES "-- I see.. you're using OpenSUSE. i like <3 -- set unattendet "$pkg install --non-interactive"
-- ZYPPER -- "
end end
# ─< APK - Alpine >───────────────────────────────────────────────────────────────────────── # ─< APK - Alpine >─────────────────────────────────────────────────────────────────────────
@ -95,7 +86,6 @@ function upin
set install "$pkg add" set install "$pkg add"
set update "$pkg update" set update "$pkg update"
set search "$pkg search" set search "$pkg search"
set ALIASES "-- Alpine.. right, this fast os is evolving.. --"
end end
if set -q unattendet if set -q unattendet
set -U FISH_INSTALL $unattendet set -U FISH_INSTALL $unattendet
@ -115,6 +105,7 @@ end
# ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ # ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮
# │ FUNCTION: Define function gsa (to ask the user which submodule to clone to which path and which name │ # │ FUNCTION: Define function gsa (to ask the user which submodule to clone to which path and which name │
# ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ # ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
function gsa function gsa
set dir $PWD set dir $PWD
echo "-- these are the current submodules --" echo "-- these are the current submodules --"
@ -163,16 +154,26 @@ end
# ╭───────────────────────────────────────────────────╮ # ╭───────────────────────────────────────────────────╮
# │ FUNCTION: set tmux command to always work with ta │ # │ FUNCTION: set tmux command to always work with ta │
# ╰───────────────────────────────────────────────────╯ # ╰───────────────────────────────────────────────────╯
if command -v tmux >/dev/null 2>&1 if command -v tmux >/dev/null 2>&1
set tmux_y "tmux-session active!"
set tmux_n "No tmux-session found!"
function ta function ta
command tmux list-sessions >/dev/null 2>&1 command tmux list-sessions >/dev/null 2>&1
switch $status switch $status
case 0 case 0
echo "Tmux session found. Entering it now! --" if command -v notify-send >/dev/null 2>&1
notify-send "$tmux_y"
end
echo "$tmux_y"
sleep 0.5 sleep 0.5
tmux a tmux a
case '*' case '*'
if command -v notify-send >/dev/null 2>&1
notify-send "$tmux_n"
end
echo "No Tmux session found. Creating one now! --" echo "No Tmux session found. Creating one now! --"
sleep 0.5
tmux tmux
end end
end end
@ -181,6 +182,7 @@ end
# ╭────────────────────────────────────────────╮ # ╭────────────────────────────────────────────╮
# │ FUNCTION: check fisher plugin dependencies │ # │ FUNCTION: check fisher plugin dependencies │
# ╰────────────────────────────────────────────╯ # ╰────────────────────────────────────────────╯
function dep_fisher function dep_fisher
# ─< Define dependencies for the plugins used by fisher >─────────────────────────────────── # ─< Define dependencies for the plugins used by fisher >───────────────────────────────────
set dependencies "fzf" "btop" "fastfetch" "curl" "wget" "cmatrix" set dependencies "fzf" "btop" "fastfetch" "curl" "wget" "cmatrix"