Last active
March 27, 2024 05:33
-
-
Save Strykar/3b3cd5bbdabe7e5c77f9414b2b4fe7e8 to your computer and use it in GitHub Desktop.
Pacman post transaction hook to list/remove orphaned packages
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
[Trigger] | |
Operation = Install | |
Operation = Upgrade | |
Operation = Remove | |
Type = Package | |
Target = * | |
[Action] | |
Description = Searching for orphaned packages... | |
When = PostTransaction | |
Exec = /usr/bin/bash -c "/usr/bin/pacman -Qtd || /usr/bin/echo '==> no orphans found.'" | |
#Exec = /usr/bin/bash -c "[[ if $(/usr/bin/pacman -Qtdq) = 0 ]] && /usr/bin/pacman -Rns $(/usr/bin/pacman -Qtdq) || /usr/bin/echo '==> No orphaned packages found.'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment