I recently discovered the
-new-window
command-line option to firefox. It takes a URL as an argument, and it opens that URL in a new window. So I wrote a shell script that prompts me for a URL and then opens that page in a new browser window. If you want to try this, save the following to a file (I saved it to ~/bin/ffwin
), and remember to make the file executable:
#!/bin/bash
URL=$( dialog --stdout \
--backtitle ffwin \
--title 'new Firefox window' \
--inputbox 'URL:' 8 40 )
if [ ! -z "$URL" ]; then
exec firefox -new-window $URL
fi
When you run this, a new xterm window will open, and dialog will prompt you for the URL. Preceding the firefox call with
exec
means that the xterm will go away after you enter the URL.As a further refinement, make it so that you can run this from a menu-click. I added the following entry to
~/.fluxbox/menu
, so that I just have to right-click on the desktop and select "ffwin":
[exec] (ffwin) {xterm -e ~/bin/ffwin}
Other window managers would likely allow you to create a custom application launcher from a toolbar or menu or widget or something.
1 comment:
Genius! I love it.
Post a Comment