diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-07-09 14:57:07 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-07-09 14:57:07 +0900 |
| commit | f794a2893f38edf52f8a74263a978a7c0fcc022d (patch) | |
| tree | 973a66d3e2efe6eb085a758066630c3719ae74a8 | |
| parent | 6d91b08e6cb90e60a731f61f23e716c9c3bf9ebc (diff) | |
| -rwxr-xr-x | ar/.local/bin/bookmarks | 16 |
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*) |
