Friday, February 11, 2011

Getting Midori to launch with Bookmarks bar on display

In FreeBSD 8.2 my preferred browser is Midori 0.2.9. Now it's by no means the best browser I've ever used (at the moment my accolade for that rests between Stainless and OmniWeb which are only available on the Mac), but it's the best that seems to be available for FreeBSD.
I will try Chromium when it becomes available, however.
One thing I like about Midori is the Bookmarks bar where I like to have an array of favorite sites with only their favicons showing. This is what I use instead of the speeddial which Midori also has but, for me, the more easily accessible bookmarks bar is handier.
However, I couldn't get the browser to launch with this bar on display so I always had to do a little clicking around to get it to show. By no means a major ordeal but inconvenient none the less.
Today I wondered could I automate this "clicking around" but wasn't sure how to do it. I have done stuff like this before with VB scripts in Windows a long time ago, but I don't think FreeBSD handles VB.
So, after failing to come up with an answer through google, I posted to the Linux Questions forum and very quickly got a very helpful response.
Two scripting tools that utilize a"virtual keyboard" were suggested; xvkbd and xdotool.
And both are available in the FreeBSD ports.
Not only that but one of the posters actually wrote the script for me and here it is:

#! /bin/sh
midori "$@" &
sleep 1
xdotool key alt+v Right Down Down Return
exit

Once it's made executable, it works perfectly.
So, not only did I get what I wanted in the way Midori launches, but I discovered a very nice scripting tool that I'm sure I'll make use of in the future .

No comments:

Post a Comment