Skip to content

Commit

Permalink
feat(bookmarks): some additions
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiin committed May 23, 2024
1 parent 2a717c9 commit 57ffdc2
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions Scripts/Launch-Bookmarks
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,28 @@
# -----------------------------------------------------

# Define the path to the bookmarks file
BOOKMARKS_PATH="$HOME/.config/BraveSoftware/Brave-Browser/Default/Bookmarks"

if [[ $BROWSER == "vivaldi" || $BROWSER == "chromium" ]]; then
BOOKMARKS_PATH="$HOME/.config/$BROWSER/Default/Bookmarks"
fi
pkill -x rofi && exit

rofi_pos

if [[ $BROWSER == "google-chrome-stable" ]]; then
check_package wtype

BOOKMARKS_PATH=""

if [[ $BROWSER == "brave" ]]; then
BOOKMARKS_PATH="$HOME/.config/BraveSoftware/Brave-Browser/Default/Bookmarks"
elif [[ $BROWSER == "vivaldi" || $BROWSER == "chromium" ]]; then
BOOKMARKS_PATH="$HOME/.config/$BROWSER/Default/Bookmarks"
elif [[ $BROWSER == "google-chrome-stable" ]]; then
BOOKMARKS_PATH="$HOME/.config/google/Default/Bookmarks"
else
notify-send -a "Browser not supported" -t 2000
exit 1
fi

selected=$(grep '"url":' "$BOOKMARKS_PATH" | awk '{print $2}' | sed 's/"//g' | rofi -dmenu -p "Select a Browser Bookmark")
selected=$(grep '"url":' "$BOOKMARKS_PATH" | awk '{print $2}' | sed 's/"//g' | rofi -dmenu -i -theme-str "entry { placeholder: \"Select Bookmark...\";} ${pos} ${r_override}" -theme-str "${fnt_override}" -config "${roFile}")

if [ "$selected" ]; then
$BROWSER "$selected"
xdg-open "$selected"
fi

0 comments on commit 57ffdc2

Please sign in to comment.