#!/bin/sh

# Put the URL inside [ ] to make it stand out
# It leads to an ugly sed command though

buku -p -f40 | awk -F'\t' '{print $2 "\t[" $1 "]"}' | {{ launcher }} {{ dmenu_flag }} -p 'Bookmarks{{ (launcher == 'fuzzel') | ternary(': ', '') }}' | sed 's@^.*\t\[\(https\?://.*\)\]$@\1@' | urlfilter | xargs -r xdg-open
