#!/bin/sh # # use dmenu to open your bookmarks stored in your twtxt file # set -eu test -s "$HOME"/.dmenurc && . "$HOME"/.dmenurc BROWSER=firefox TWTXTPATH="$HOME/code/www/twt/" FILE=twtxt.txt TWTXT="${TWTXTPATH}"/"${FILE}" BMK="/tmp/${FILE}.$$" PROMPT="GO> " # twtxt file cleanup awk '$1 = "" ; $2 ~ /^http*/ { print $0 }' < "${TWTXT}" > "${BMK}" CMD=$(dmenu -l "${l}" -fn "${fn}" -nb "${nb}" -nf "${nf}" -sb "${sb}" -sf "${sf}" -p "${PROMPT}" "$@" < "${BMK}") # remove tags URL=$(echo "${CMD}" | awk ' { print $1 } ') "${BROWSER}" "${URL}" exit 0