surf browser hints /2

August 25, 2009

following yesterday’s post, here is another useful hint about surf’s usage.

the following script lists the available bookmarks (from ~/.bookmarks file) and let’s you pick one using dmenu. if a new link is inserted, it is added to the list of known bookmarks, so you won’t need to type it in full the next time:

#!/bin/sh
bookmarks=~/.bookmarks
link=`cat $bookmarks | dmenu ${1+"$@"}` || exit 0
present=`grep $link $bookmarks`
if [ "$?" -ne "0" ]; then
echo $link >> $bookmarks
fi
surf -u $link

if you don’t want to open a new window, just change the last line to set the _SURF_URL X Property of the surf window you want to use (by clicking on it):

xprop -f _SURF_URL 8t -set _SURF_URL $link

Advertisements

One Response to “surf browser hints /2”


  1. […] surf browser hints /3 Filed under: programming — Tags: script, suckless, surf — lbolla @ 8:37 pm another couple of hints about surf, after my previous post. […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: