[Surfraw-commits] [SCM] surfraw - a fast unix command line interface to WWW branch, master, updated. surfraw_2-2-5_1-36-gc6f38b1
Ian Beckwith
ianb at erislabs.net
Fri Nov 6 04:16:12 UTC 2009
The following commit has been merged in the master branch:
commit b6fc2ae21bcf8064d67e13b7fe828eaef12a0630
Author: Ian Beckwith <ianb at erislabs.net>
Date: Fri Nov 6 03:29:10 2009 +0000
Applied patch from Sumant Oemrawsingh to strip "GLOBAL ELVI"
and "LOCALELVI" and support vertical menus if patched dmenu is
available.
diff --git a/ChangeLog b/ChangeLog
index 8d2b360..e54e3bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-11-06 Ian Beckwith <ianb at erislabs.net>
+
+ * examples/uzbl_load_url_from_surfraw:
+ + Applied patch from Sumant Oemrawsingh to strip "GLOBAL ELVI"
+ and "LOCALELVI" and support vertical menus if patched dmenu is
+ available.
+
2009-10-27 Ian Beckwith <ianb at erislabs.net>
* Added examples/uzbl_load_url_from_surfraw,
diff --git a/examples/uzbl_load_url_from_surfraw b/examples/uzbl_load_url_from_surfraw
index d73c9a7..bf2ef4c 100755
--- a/examples/uzbl_load_url_from_surfraw
+++ b/examples/uzbl_load_url_from_surfraw
@@ -41,6 +41,14 @@ COLORS=" -nb #303030 -nf khaki -sb #CCFFAA -sf #303030"
# Prompt for dmenu
PROMPT="Open"
+# From load_url_from_bookmarks.sh: Use dmenu with vertical patch if available
+if dmenu --help 2>&1 | grep -q '\[-rs\] \[-ni\] \[-nl\] \[-xs\]'
+then
+ DMENU="dmenu -i -xs -rs -l 10" # vertical patch
+else
+ DMENU="dmenu -i"
+fi
+
# Use surfraw to search for the words
function search()
{
@@ -69,15 +77,13 @@ function goto()
# Use dmenu to navigate through possible choices
function present_menu()
{
- elvi=`surfraw -elvi | cut -f 1 | tail --lines=+2`
+ elvi=`surfraw -elvi | grep -v -e ' ELVI:' -e '^W' | cut -f 1`
if [ -r "$BOOKMARKS" ]
then
- bookmarks=" `cut -f 1 -d ' ' "$BOOKMARKS" 2>/dev/null`"
- else
- bookmarks=""
+ elvi="$elvi `cut -f 1 -d ' ' "$BOOKMARKS" 2>/dev/null`"
fi
- echo "${elvi}${bookmarks}" | tr ' ' '\n' | sort | dmenu -p "$PROMPT" -i $COLORS
+ echo "$elvi" | tr ' ' '\n' | sort | $DMENU -p "$PROMPT" $COLORS
}
present_menu | \
--
surfraw - a fast unix command line interface to WWW
More information about the Surfraw-commits
mailing list