From aebda32c2a09fcbdc1e645f55a0c6de3b9a2cfaf Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Sun, 21 Jun 2026 19:01:25 +0100 Subject: Add bookmark management scripts --- bin/.bin/open-bookmark.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 bin/.bin/open-bookmark.sh (limited to 'bin/.bin/open-bookmark.sh') diff --git a/bin/.bin/open-bookmark.sh b/bin/.bin/open-bookmark.sh new file mode 100755 index 0000000..67e724b --- /dev/null +++ b/bin/.bin/open-bookmark.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -euo pipefail + +BOOKMARKS_FILE="$DOTFILES_REPO/bookmarks.txt" + +if [ ! -f "$BOOKMARKS_FILE" ] || [ ! -s "$BOOKMARKS_FILE" ]; then + notify-send "Bookmarks" "Your bookmarks file is empty or missing." + exit 1 +fi + +SELECTION=$(cut -d'|' -f1 "$BOOKMARKS_FILE" | rofi -dmenu -p "Go To:") + +if [ -z "$SELECTION" ]; then + exit 0 +fi + +URL=$(grep "^$SELECTION|" "$BOOKMARKS_FILE" | head -n 1 | cut -d'|' -f2) + +if [ -n "$URL" ]; then + firefox "$URL" & +else + notify-send "Error" "Could not resolve the URL for: $SELECTION" +fi -- cgit v1.2.3-13-gbd6f