sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit b701df06041340256579a0e17d6155f2ddbffbdf
parent c0b6a6541f51edf28b76920513f40865ef913cbc
Author: anselm@garbe.us <unknown>
Date:   Fri,  4 Jun 2010 11:53:46 +0100

update
Diffstat:
Msurf.suckless.org/files/bmarks.md | 35++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/surf.suckless.org/files/bmarks.md b/surf.suckless.org/files/bmarks.md @@ -35,15 +35,16 @@ Code ---- #!/bin/sh # $1 = $xid - # $2 = $p = _SURF_FIND _SURF_BMARK _SURF_URI (what SETPROP sets in config.h) + # $2 = $p = _SURF_FIND _SURF_BMARK _SURF_URI _SURF_URI_RAW (what SETPROP sets in config.h) # # // replace default setprop with this one - # #define SETPROP(p) { .v = (char *[]){ "/bin/sh", "-c", "surf.sh $1 $0", p, winid, NULL } } + # #define SETPROP(p) { .v = (char *[]){ "/bin/sh", "-c", "surf.sh $0 $1", winid, p, NULL } } # # // fix shift+slash keybinding in spanish keyboard (f.example) - # { MODKEY, GDK_s, spawn, SETPROP("_SURF_FIND") }, - # { MODKEY, GDK_b, spawn, SETPROP("_SURF_BMARK") }, - # { MODKEY|GDK_SHIFT_MASK, GDK_g, spawn, SETPROP("_SURF_URI_RAW") }, + # { MODKEY, GDK_g, spawn, SETPROP("_SURF_URI") }, + # { MODKEY|GDK_SHIFT_MASK,GDK_g, spawn, SETPROP("_SURF_URI_RAW") }, + # { MODKEY, GDK_f, spawn, SETPROP("_SURF_FIND") }, + # { MODKEY, GDK_b, spawn, SETPROP("_SURF_BMARK") }, font='-*-terminus-medium-*-*-*-*-*-*-*-*-*-*-*' normbgcolor='#181818' @@ -57,7 +58,7 @@ Code uri=`xprop -id $xid _SURF_URI | cut -d '"' -f 2` kw=`xprop -id $xid _SURF_FIND | cut -d '"' -f 2` dmenu="dmenu -e $xid -fn $font -nb $normbgcolor -nf $normfgcolor \ - -sb $selbgcolor -sf $selfgcolor" + -sb $selbgcolor -sf $selfgcolor" s_xprop() { [ -n "$2" ] && xprop -id $xid -f $1 8s -set $1 "$2" @@ -65,15 +66,15 @@ Code case "$p" in "_SURF_FIND") - find="`echo $kw | $dmenu -p find:`" - s_xprop _SURF_FIND "$find" + ret="`echo $kw | $dmenu -p find:`" + s_xprop _SURF_FIND "$ret" ;; "_SURF_BMARK") grep "$uri" $bmarks >/dev/null 2>&1 || echo "$uri" >> $bmarks ;; "_SURF_URI_RAW") - uri=`echo $uri | $dmenu -p "uri:"` - s_xprop _SURF_URI "$uri" + ret=`echo $uri | $dmenu -p "uri:"` + s_xprop _SURF_GO "$ret" ;; "_SURF_URI") sel=`tac $bmarks 2> /dev/null | $dmenu -p "uri [dgtwy*]:"` @@ -82,25 +83,25 @@ Code arg=$(echo $sel | cut -d ' ' -f 2-) case "$opt" in "d") # del.icio.us - uri="http://del.icio.us/save?url=$uri" + ret="http://del.icio.us/save?url=$uri" ;; "g") # google for it - uri="http://www.google.com/search?q=$arg" + ret="http://www.google.com/search?q=$arg" ;; "t") # tinyurl - uri="http://tinyurl.com/create.php?url=$uri" + ret="http://tinyurl.com/create.php?url=$uri" ;; "w") # wikipedia - uri="http://wikipedia.org/wiki/$arg" + ret="http://wikipedia.org/wiki/$arg" ;; "y") # youtube - uri="http://www.youtube.com/results?search_query=$arg&aq=f" + ret="http://www.youtube.com/results?search_query=$arg&aq=f" ;; *) - uri="$sel" + ret="$sel" ;; esac - s_xprop _SURF_URI "$uri" + s_xprop _SURF_GO "$ret" ;; *) echo Unknown xprop