diff --git a/configs/arch_config.fish b/configs/arch_config.fish index eea7411..0853c41 100755 --- a/configs/arch_config.fish +++ b/configs/arch_config.fish @@ -4,6 +4,78 @@ source $HOME/.config/fish/configs/uni.fish +# ------------------------------------------------------------------------------ +# Aliases & small utilities (kept after main for readability) +# ------------------------------------------------------------------------------ + +alias fixpacman='sudo rm -f /var/lib/pacman/db.lck' + +if test -e /usr/bin/expac + alias rip='expac --timefmt="%Y-%m-%d %T" "%l\t%n %v" | sort | tail -200 | nl' + alias big='expac -H M "%m\t%n" | sort -h | nl' +else + alias rip="echo 'expac is not installed. Install it to list last deinstalled packages.'" + alias big="echo 'expac is not installed. Install it to list biggest packages.'" +end + +function cleanup + while pacman -Qdtq >/dev/null 2>&1 + set orphans (pacman -Qdtq 2>/dev/null) + if test -z "$orphans" + break + end + sudo pacman -R $orphans + end + echo "No more orphaned packages." +end + +if test -x $HOME/.local/python-3.11.9/bin/python3.11 + alias py311="$HOME/.local/python-3.11.9/bin/python3.11" +end + +if test -e /usr/bin/tmux + function quickshell-reload + if command -q quickshell + tmux kill-session -t qs 2>/dev/null + tmux new-session -d -s qs 'quickshell' + else + echo "'quickshell' is not installed. Install it via your package manager." + end + end + function hypridle-reload + if command -q hypridle + tmux kill-session -t hypridle 2>/dev/null + tmux new-session -d -s hypridle 'hypridle' + else + echo "'hypridle' is not installed. Install it via your package manager." + end + end +else + function quickshell-reload + echo "'tmux' is not installed. Install it via your package manager." + end + function hypridle-reload + echo "'tmux' is not installed. Install it via your package manager." + end +end + +if test -e /usr/bin/reflector + alias mirror='sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist' + alias mirrora='sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist' + alias mirrord='sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist' + alias mirrors='sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist' +end + +function pacman-autoremove + set -l orphans (pacman -Qtdq) + if test (count $orphans) -gt 0 + sudo pacman -Rns $orphans + else + echo "No orphaned packages." + end +end + + # ------------------------------------------------------------------------------ # Helpers # ------------------------------------------------------------------------------ @@ -473,7 +545,9 @@ function updateall # ---------------------------------------------------------------------- echo "" set_color --bold cyan + echo "########################" echo "#### Update Summary ####" + echo "########################" set_color normal set -l max_len 0 for l in $_labels @@ -492,75 +566,4 @@ function updateall echo $stat set_color normal end -end - -# ------------------------------------------------------------------------------ -# Aliases & small utilities (kept after main for readability) -# ------------------------------------------------------------------------------ - -alias fixpacman='sudo rm -f /var/lib/pacman/db.lck' - -if test -e /usr/bin/expac - alias rip='expac --timefmt="%Y-%m-%d %T" "%l\t%n %v" | sort | tail -200 | nl' - alias big='expac -H M "%m\t%n" | sort -h | nl' -else - alias rip="echo 'expac is not installed. Install it to list last deinstalled packages.'" - alias big="echo 'expac is not installed. Install it to list biggest packages.'" -end - -function cleanup - while pacman -Qdtq >/dev/null 2>&1 - set orphans (pacman -Qdtq 2>/dev/null) - if test -z "$orphans" - break - end - sudo pacman -R $orphans - end - echo "No more orphaned packages." -end - -if test -x $HOME/.local/python-3.11.9/bin/python3.11 - alias py311="$HOME/.local/python-3.11.9/bin/python3.11" -end - -if test -e /usr/bin/tmux - function quickshell-reload - if command -q quickshell - tmux kill-session -t qs 2>/dev/null - tmux new-session -d -s qs 'quickshell' - else - echo "'quickshell' is not installed. Install it via your package manager." - end - end - function hypridle-reload - if command -q hypridle - tmux kill-session -t hypridle 2>/dev/null - tmux new-session -d -s hypridle 'hypridle' - else - echo "'hypridle' is not installed. Install it via your package manager." - end - end -else - function quickshell-reload - echo "'tmux' is not installed. Install it via your package manager." - end - function hypridle-reload - echo "'tmux' is not installed. Install it via your package manager." - end -end - -if test -e /usr/bin/reflector - alias mirror='sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist' - alias mirrora='sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist' - alias mirrord='sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist' - alias mirrors='sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist' -end - -function pacman-autoremove - set -l orphans (pacman -Qtdq) - if test (count $orphans) -gt 0 - sudo pacman -Rns $orphans - else - echo "No orphaned packages." - end -end +end \ No newline at end of file