Skip to content

Commit

Permalink
Merge pull request #65 from rubiin/master
Browse files Browse the repository at this point in the history
feat(bookmarks): adds rofi bookmarks selector
  • Loading branch information
kRHYME7 authored May 24, 2024
2 parents 225bc0d + 497f4a9 commit cfaacc5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Hyde
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,9 @@ USAGE
glyph) #? Glyph selector
Launch-Glyph
;;
bookmarks) #? Bookmark selector
Launch-Bookmarks
;;
screencap) #? Use rofi to select screenshot options \n !! kills another rofi session
Launch-Screencap
;;
Expand Down
33 changes: 33 additions & 0 deletions Scripts/Launch-Bookmarks
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
# ____ _ _
# | __ ) ___ ___ | | ___ __ ___ __ _ _ __| | _____
# | _ \ / _ \ / _ \| |/ / '_ ` _ \ / _` | '__| |/ / __|
# | |_) | (_) | (_) | <| | | | | | (_| | | | <\__ \
# |____/ \___/ \___/|_|\_\_| |_| |_|\__,_|_| |_|\_\___/
#
# -----------------------------------------------------

# Define the path to the bookmarks file

pkill -x rofi && exit

rofi_pos

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 -i -theme-str "entry { placeholder: \"Select Bookmark...\";} ${pos} ${r_override}" -theme-str "${fnt_override}" -config "${roFile}")

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

0 comments on commit cfaacc5

Please sign in to comment.