2 # Pinosaur's BookMarking or pbm
4 # The bookmark file should have one url on each line
5 # Empty lines and lines with a # symbol will be ignored
7 # You can also add an alias for each url
8 # Just add the alias as a second column on the same line
11 # https://suckless.org/ ~suckless
13 # Requires dmenu with the 'reject no match' patch,
14 # available at https://tools.suckless.org/dmenu/patches/reject-no-match/dmenu-rejectnomatch-4.7.diff
16 # this script is horrible, ill try to improve it once im better at shell scripting
18 BOOKMARKS_FILE="$HOME/Data/bookmarks"
23 echo "No browser set, try setting your $BROWSER environmental variable" &&\
26 selection="$(cat "$BOOKMARKS_FILE" | egrep -v '^$' | grep -v '#' \
31 # Make sure that user actually selects a url
32 [ -z "$selection" ] &&\
33 echo "No url selected" && exit 1
35 url="$(cat "$BOOKMARKS_FILE" | egrep "\s$selection" | awk '{ print $1 }')"
40 echo "Not implemented yet lolz"
49 echo "Invalid flags" && exit 1