Skip to content

Instantly share code, notes, and snippets.

@CRTified
Last active February 24, 2021 07:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CRTified/708c01806ff0ab76954d4aed9a1182af to your computer and use it in GitHub Desktop.
Save CRTified/708c01806ff0ab76954d4aed9a1182af to your computer and use it in GitHub Desktop.
Automatic recompilation after xmonad or haskell libs update
[Trigger]
Operation=Install
Operation=Upgrade
Type=Package
Target=xmonad
Target=haskell-*
[Action]
Depends=xmonad
When=PostTransaction
Exec=/bin/sh -c 'awk -F : "{print \$1\" \"\$6}" /etc/passwd | while IFS=" " read -r l_name l_dir ; do if [ -f "${l_dir}/.xmonad/xmonad.hs" ]; then echo Recompiling xmonad for $l_name; sudo -n -u $l_name xmonad --recompile; fi; done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment