dotfiles/scripts/menu/menu-bookmarks
2023-10-18 14:27:00 -06:00

10 lines
404 B
Bash
Executable file

#!/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="$(grep -v '^Watch\slater:\s.*' "$BOOKMARKS" | sed '/^\s*$/d;/^#.*$/d;s/-.*$//g' | menu "Site:")"
[ -z "$name" ] && exit
grep "$name" $BOOKMARKS | sed -z 's/^.*-//g;s/\n//g' |
xsel -ib && notify-send "󰃀 Bookmarks" "'$name' copied to clipboard"