From: Armaan Bhojwani Date: Tue, 22 Jun 2021 01:32:51 +0000 (-0400) Subject: dweb: transform from bookmarks X-Git-Url: https://git.armaanb.net/?p=bin.git;a=commitdiff_plain;h=e1e44468bbbcc77e61a594dd595e4a2ba68140c6 dweb: transform from bookmarks --- diff --git a/bookmarks b/bookmarks deleted file mode 100755 index 6556d55..0000000 --- a/bookmarks +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh - -cat ${1:-~/org/bookmarks} | dmenu -l 20 | xargs xdg-open \ No newline at end of file diff --git a/dweb b/dweb new file mode 100755 index 0000000..7f0fc01 --- /dev/null +++ b/dweb @@ -0,0 +1,27 @@ +#!/usr/bin/env sh + +engine="https://duckduckgo.com?q=" + +case "$1" in + uri) + :| dmenu -p "Open a URL:" | xargs -I % chorizo "%" + ;; + bookmark) + cat ${2:-~/org/bookmarks} | dmenu -l 20 -p "Open a bookmark:" \ + | xargs -I % chorizo "%" + ;; + search) + :| dmenu -p "Search the web:" | xargs -I % chorizo "$engine%" + ;; + -h|--help|help) + echo "$0 [bookmark|help|search|uri]" + exit 0 + ;; + *) + echo "No such option. See \"$0 help\" for more information." + exit 1 + ;; +esac + +input=$(echo "$input" | tr -d '\n') + diff --git a/man/bookmarks.1.scd b/man/bookmarks.1.scd deleted file mode 100644 index 67fa1fc..0000000 --- a/man/bookmarks.1.scd +++ /dev/null @@ -1,16 +0,0 @@ -bookmarks(1) - -# NAME -bookmarks - select a bookmark with dmenu - -# SYNOPSIS -*bookmarks*++ -*bookmarks [path to bookmarks file]* - -# DESCRIPTION -Allows you to select a bookmark from a list of newline delimited urls (defaults -to ~/org/bookmarks) and open it in the default browser. - -# COPYRIGHT -This is free and unencumbered software released into the public domain. For more -information, please refer to . diff --git a/man/dweb.1.scd b/man/dweb.1.scd new file mode 100644 index 0000000..e265a2a --- /dev/null +++ b/man/dweb.1.scd @@ -0,0 +1,31 @@ +dweb(1) + +# NAME +dweb - dynamic prompt to browse the web + +# SYNOPSIS +*dweb* bookmark++ +*dweb* bookmark [path to bookmarks file]++ +*dweb* help++ +*dweb* search++ +*dweb* uri + +# DESCRIPTION +Launches a dmenu prompting you based on the subcommand. + +*bookmark* + Allows you to select a bookmark from a list of newline delimited + urls (defaults to ~/org/bookmarks) and open it in the default browser. + +*help* + Show help information. + +*search* + Search the web using a search engine. + +*uri* + Open a URI. + +# COPYRIGHT +This is free and unencumbered software released into the public domain. For more +information, please refer to .