summaryrefslogtreecommitdiff
path: root/ar/.local/bin
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-07-09 14:57:07 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-07-09 14:57:07 +0900
commitf794a2893f38edf52f8a74263a978a7c0fcc022d (patch)
tree973a66d3e2efe6eb085a758066630c3719ae74a8 /ar/.local/bin
parent6d91b08e6cb90e60a731f61f23e716c9c3bf9ebc (diff)
modified bin/bookmarksHEADmaster
Diffstat (limited to 'ar/.local/bin')
-rwxr-xr-xar/.local/bin/bookmarks16
1 files changed, 11 insertions, 5 deletions
diff --git a/ar/.local/bin/bookmarks b/ar/.local/bin/bookmarks
index a892a33..15b5fa6 100755
--- a/ar/.local/bin/bookmarks
+++ b/ar/.local/bin/bookmarks
@@ -82,18 +82,24 @@ openwindow() {
}
openinbrowser() {
- # Extract only the default part of the profile name
+ # Resolve the default profile dir from the [Install] section of profiles.ini
case $BROWSER in
*firefox*)
profiles_ini_path="$HOME/.mozilla/firefox/profiles.ini"
- profile=$(awk '/\[Install/ {found=1} found && /^Default=/ {split($0, arr, "."); print arr[2]; exit}' "$profiles_ini_path")
- profile_dir=$(find ~/.mozilla/firefox -type d -name "*.$profile*" | head -n 1)
+ profile=$(awk -F= '/^\[Install/ {found=1} found && /^Default=/ {print $2; exit}' "$profiles_ini_path")
+ case "$profile" in
+ /*) profile_dir="$profile" ;;
+ *) profile_dir="$HOME/.mozilla/firefox/$profile" ;;
+ esac
db_path="$profile_dir/places.sqlite"
;;
*librewolf*)
profiles_ini_path="$HOME/.librewolf/profiles.ini"
- profile=$(awk '/\[Install/ {found=1} found && /^Default=/ {split($0, arr, "."); print arr[2]; exit}' "$profiles_ini_path")
- profile_dir=$(find ~/.librewolf -type d -name "*.$profile*" | head -n 1)
+ profile=$(awk -F= '/^\[Install/ {found=1} found && /^Default=/ {print $2; exit}' "$profiles_ini_path")
+ case "$profile" in
+ /*) profile_dir="$profile" ;;
+ *) profile_dir="$HOME/.librewolf/$profile" ;;
+ esac
db_path="$profile_dir/places.sqlite"
;;
*qutebrowser*)