PDA

View Full Version : [Fluxbox] Open URL from fluxbox menu


sk8harddiefast
December 15th, 2010, 13:39
I try to make my fluxbox menu, to open with chrome a specific URL. How to do it? Xdg-open was a option but xdg-open don't recognize chrome. Any idea?

graudeejs
December 15th, 2010, 13:54
set BROWSER environment variable to chrome in ~/.xinitrc (or however you start X)

sk8harddiefast
December 15th, 2010, 14:07
set BROWSER environment variable to chrome in ~/.xinitrc (or however you start X)
I think I understood what you mean but none idea how to do that. I start X via .xinitrc.

graudeejs
December 15th, 2010, 14:15
to ~/.xinitrc add

export BROWSER=chrome

and restart X

sk8harddiefast
December 15th, 2010, 14:24
Ok. Now xdg-open understand chrome :)
But: xdg-open 'http://localhost:631' is opening chrome but not cups
From terminal I get this error:
xdg-open 'http://localhost:631'
Created new window in existing browser session.
[1214/153048:WARNING:base/debug_util_posix.cc(232)] Don't know how to do this
[99717:54874112:44844338134:ERROR:chrome/browser/zygote_main_linux.cc(383)] write: Connection reset by peer

graudeejs
December 15th, 2010, 15:02
Does it open in chrome if you simply write that in Address bar?
xdg-open is really very stupid sh script, so it is not it's fault....

sk8harddiefast
December 15th, 2010, 15:05
Yeap. Open it.

graudeejs
December 15th, 2010, 15:12
Well, sorry I can't help you here. I don't have chrome, I don't even understand why anyone on FreeBSD use it (unless they are subscribed)

sk8harddiefast
December 15th, 2010, 15:19
Well, sorry I can't help you here.
Never mind. You helped me on the first step witch was the hard part. I will find a solution. I guess :P
I don't know why. I love chrome better that Firefox and is just simple. Have not a lot of button, boxes etc like opera :)

teckk
January 21st, 2011, 02:40
Did you find a solution yet? If you have flux and xterm you can make a menu entry to open anything.

I use something like

.fluxbox/menu
[exec] (Config Printer) {xterm -e "firefox http://localhost:631"}

That will work for anything in flux.

You can make a menu item "that needs sudo" to mount usb drives that way even.
Example
[exec] (Mount USB drive FAT) {xterm +sb -T "MOUNT USB DRIVE" -g 40x10 -bg blue -fg white -e sudo xterm -e "mount -t msdosfs /dev/da0s1 /home/teckk/usb"}

That's not a typo. xterm opens, waits for sudo password, xterm -e runs the executable.

umount
[exec] (Unmount USB drive) {xterm +sb -T "UNMOUNT USB DRIVE" -g 40x10 -bg blue -fg white -e sudo xterm -e "umount /home/teckk/usb"}

sleep
[exec] (Sleep) {xterm +sb -T "**** Sleep ****" -g 40x10 -bg yellow -fg black -e sudo acpiconf -s3}

xterm