1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
users=$(loginctl --no-legend list-users | awk '{ print $2 }' | sed ':a;N;$!ba;s/\n/ /g') _tldr_update() { for i in "$users"; do su $i -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID tldr --update' done } post_install() { _tldr_update } post_upgrade() { _tldr_update } post_remove() { return 0 }