summaryrefslogtreecommitdiff
path: root/ar/.local/bin/arkenfox-auto-update
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-01-24 20:35:27 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-01-24 20:35:27 +0900
commitc80a54e42b52ce297f0f2f71af23c562832025c7 (patch)
treedcce8bb977a770f473325d48f6f70b21d9818a40 /ar/.local/bin/arkenfox-auto-update
init
Diffstat (limited to 'ar/.local/bin/arkenfox-auto-update')
-rwxr-xr-xar/.local/bin/arkenfox-auto-update26
1 files changed, 26 insertions, 0 deletions
diff --git a/ar/.local/bin/arkenfox-auto-update b/ar/.local/bin/arkenfox-auto-update
new file mode 100755
index 0000000..8e1ea7d
--- /dev/null
+++ b/ar/.local/bin/arkenfox-auto-update
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# A wrapper for the arkenfox-updater that runs it on all pre-existing Arkenfox
+# user.js files on the machine.
+
+# On installation of LARBS, this file is copied to /usr/local/lib/ where it is
+# run by a pacman hook set up. The user should not have to run this manually.
+
+# Search for all Firefox and Librewolf profiles using Arkenfox.
+profiles="$(grep -sH "arkenfox user.js" \
+ /home/*/.librewolf/*.default/user.js \
+ /home/*/.mozilla/firefox/*.default/user.js)"
+
+IFS='
+'
+
+# Update each found profile.
+for profile in $profiles; do
+ userjs=${profile%%/user.js*}
+ user=$(stat -c '%U' "$userjs") || continue
+
+ su -l "$user" -c "arkenfox-updater -c -p $userjs -s"
+done
+
+# RTMIN: pkill
+# PROJECT: pkill