summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2019-07-27 11:43:06 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2019-07-27 11:43:06 +0200
commit478e73ad9f4534eda51d02a8a19c5680d14bb314 (patch)
tree4df2ac00bf1b137af5d2c8733e69e536fe7e05d2
parentaab7bd392b01d54db778dc8c08cdcf011885905c (diff)
README: improve dmenu example
-rw-r--r--README11
1 files changed, 7 insertions, 4 deletions
diff --git a/README b/README
index f99c973..f459465 100644
--- a/README
+++ b/README
@@ -212,12 +212,15 @@ View formatted output in your editor:
- - -
-Example script to view feeds with dmenu(1), opens selected url in $BROWSER:
+Example script to view feed items in a vertical list/menu in dmenu(1). It opens
+the selected url in the browser set in $BROWSER:
#!/bin/sh
- url=$(sfeed_plain $HOME/.sfeed/feeds/* | dmenu -l 35 -i |
- sed 's@^.* \([a-zA-Z]*://\)\(.*\)$@\1\2@')
- [ ! "$url" = "" ] && $BROWSER "$url"
+ url=$(sfeed_plain "$HOME/.sfeed/feeds/"* | dmenu -l 35 -i | \
+ sed -n 's@^.* \([a-zA-Z]*://\)\(.*\)$@\1\2@p')
+ test -n "${url}" && $BROWSER "${url}"
+
+dmenu can be found at: https://git.suckless.org/dmenu/
- - -