Skip to content

Instantly share code, notes, and snippets.

@FLX-0x00
Created July 13, 2023 06:46
Show Gist options
  • Save FLX-0x00/e755c530fa77031f80139a0e5af57a58 to your computer and use it in GitHub Desktop.
Save FLX-0x00/e755c530fa77031f80139a0e5af57a58 to your computer and use it in GitHub Desktop.
pacman / paru custom hook for upgrading pipx packages after system upgrade using current user context
[Trigger]
Operation = Upgrade
Type = Package
Target = *
[Action]
Description = Upgrading pipx packages...
When = PostTransaction
Exec = /bin/bash -c 'export SUDO_USER=$(/usr/bin/env | grep -oP "^SUDO_USER=\K.*") && /usr/bin/sudo -u $SUDO_USER pipx upgrade-all'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment