From c27ae75d0525a3115d0e99dc8eddf1c7d70fa1d1 Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:26:54 +0000 Subject: [PATCH] Fix arkenfox pacman hook complaining about root The previous pull request on LARBS turned out not to work, so make sure `arkenfox-auto-update` runs `arkenfox-update` as the user of the firefox profile. Otherwise it complains that it's running as root and stops. The way of getting the username is safe, because it gets the username from the owner of the user.js file of that profile. --- .local/bin/arkenfox-auto-update | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.local/bin/arkenfox-auto-update b/.local/bin/arkenfox-auto-update index 05f4ca7f..7664a4fc 100755 --- a/.local/bin/arkenfox-auto-update +++ b/.local/bin/arkenfox-auto-update @@ -16,5 +16,8 @@ IFS=' # Update each found profile. for profile in $profiles; do - arkenfox-updater -p "${profile%%/user.js*}" -s + userjs=${profile%%/user.js*} + user=$(stat -c '%U' "$userjs") || continue + + su -l "$user" -c "arkenfox-updater -c -p $userjs -s" done