From f794a2893f38edf52f8a74263a978a7c0fcc022d Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 9 Jul 2026 14:57:07 +0900 Subject: modified bin/bookmarks --- ar/.local/bin/bookmarks | 16 +++++++++++----- 1 file 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*) -- cgit v1.2.3