Created
September 2, 2021 22:58
-
-
Save polypoyo/dc2ca78c4d4aa8366bac197642c81c44 to your computer and use it in GitHub Desktop.
Simple script to remove orphan packages using aura
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
clear | |
set HOME (clear; set_color green; echo Orphan management script; set_color normal; tput cud 2) | |
set_color green | |
echo "Orphan management script" | |
set_color normal | |
function askPkg | |
echo $HOME | |
set Pkg $argv[1] | |
echo $Pkg; | |
if [ $argv[2] = "v" ] | |
aura -Si $Pkg | |
else | |
aura -Si $Pkg | grep "Description" | |
end | |
read -P 'What to do? ([R]emove/[S]kip/[A]bort/[I]nfo) ' input | |
if [ $input = "a" ]; | |
echo "Aborted." | |
exit | |
else if [ $input = "r" ]; | |
sudo aura -R $Pkg | |
else if [ $input = "i" ]; | |
askPkg $argv[1] v | |
end | |
end | |
for package in (aura -O); | |
echo "" | |
askPkg $package 0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment