#!/bin/sh . "lib_common.sh" help() { cat << EOF ${progname}: Open links from bookmarks through dmenu options: [link] Open link -h Print this message and exit NOTE: bookmarks file is located at ~/.config/sites/bookmarks.txt EOF exit 0 } [ -z "${BROWSER}" ] && BROWSER="firefox" if [ "${#}" -eq 0 ]; then bookmark_path="${XDG_CONFIG_HOME:-$HOME/.config}/sites/bookmarks.txt" [ -e "${bookmark_path}" ] || err "Couldn't find bookmarks file" . "lib_handle.sh" link=$(< "${bookmark_path}" menu_handle center) [ -z "${link}" ] || "${BROWSER}" "${link}" fi [ "${#}" -ne 1 ] && invalid_use [ "${1}" = "-h" ] && help "${BROWSER}" "${1}"