#!/bin/sh
# Open URLs from bookmarks file
BOOKMARKS="$HOME/Documents/bookmarks"

# Print site names, then get URL based on the name. Exit if empty
name="$(sed '/^Watch\slater:\s/d;/^\s*$/d;/^#/d;s/-.*$//g' "$BOOKMARKS" | menu "Site:")"
[ -z "$name" ] && exit

grep "$name" $BOOKMARKS | sed -z 's/^.*-//g;s/\n//g' |
    xsel -ib && notify-send "󰃀 Bookmarks" "'$name' copied to clipboard"