dmenu script to open bookmarks in firefox tabs
Playing with uzbl, I recently created a flat text file of my bookmarks saved in ~/.bookmarks, a bit cumbersome right now, but the good part is uzbl isn’t the only browser who can open links given to it from a dmenu script.
I created the following script and chmod +x it of course:
#!/bin/bash
if [ -f $HOME/.dmenurc ]; then
. $HOME/.dmenurc
else
DMENU="dmenu -i"
fi
file=$HOME/.bookmarks
goto=`awk '{print $1}' $file | $DMENU`
file=$HOME/.bookmarks
[ -r "$file" ] || exit
COLORS=" -nb #000000 -nf #ffffff -sb #333333 -sf #ffffff"
if dmenu --help 2>&1 | grep -q '\[-rs\] \[-ni\] \[-nl\] \[-xs\]'
then
DMENU="dmenu -b -i -xs -rs -l 10 -fn '-*-fixed-medium-r-*-*-11-*-*-*-*-*-*-*' " # vertical patch
# show tags as well
goto=`$DMENU $COLORS < $file | awk '{print $1}'`
else
DMENU="dmenu -b -i -fn -*-fixed-medium-r-*-*-11-*-*-*-*-*-*-* "
# because they are all after each other, just show the url, not their tags.
goto=`awk '{print $1}' $file | $DMENU $COLORS`
fi
[ -n "$goto" ] && firefox $goto
I bound this script to $MODKEY+u and now when I want to call up any of my bookmarks, hit Alt+u and off I go.







