Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] How to launch from Firefox?

#1
I see a server listing here, but when I click on a xonotic:// link, Firefox tells me the protocol is unrecognised. I added the protocol according to this page, and chose xonotic-linux-glx.sh as the application to launch. Sure enough, it launches, but not at the server I selected. I tried the gconftool-2 suggestion, still no deal.

So, how can I click a xonotic link in Firefox and have Xonotic launch me into that game? I installed Xonotic by downloading it and unpacking it manually, ie. not by a package manager.

Incidentally, the servers listed on that page don't all (any?) appear in the in-game server list. I wonder if people get the wrong impression of player numbers because of that…
Reply

#2
You should pass the server address to the "connect" command. Your full command should be
Code:
xonotic-linux-glx.sh +connect example.com:26000
, instead of
Code:
xonotic-linux-glx.sh example.com:26000
as I assume you're doing now.

As for the servers appearing or not, are you sure you're not filtering in your in-game list? The list of server should be exactly the same, because the server listing webpage runs on the master server from which the in-game server list fetches its data.
Reply

#3
Firefox's application chooser dialog only allows to select binaries. How would I pass it arguments? And would I substitute the address for "%s"?
Reply

#4
Right, the gconf thing might be able to, but Firefox' builtin handler does not. What distro do you use? Do you use GNOME?

Anyway, to use the builtin firefox handler instead of GNOME's, you'll have to create a script that takes the first argument and passes it to xonotic:
Create a directory "bin" in your home directory, and put the following in the file xonotic-connect:
Code:
#!/bin/sh
"$HOME/whatever/xonotic-linux-glx.sh" +connect "$@"
where you should replace "whatever" with whatever path your xonotic-linux-glx.sh is in your home directory.

Then, make that file executable and use that as the url handler in Firefox.
Reply

#5
I'm not using a desktop environment, just a window manager. Although I do have some KDE and Gnome stuff installed, I'm not using it on 'the desktop'.

I created the script like you said and it worked with a couple of modifications:

Code:
#!/bin/bash

/home/vigil/Xonotic/xonotic-linux32-glx -basedir /home/vigil/Xonotic +connect "${1:10}"

-basedir was required, and ${1:10} strips away "xonotic://" from the address that gets passed to +connect.

Just had a couple of online games. Cool :-)

The servers not appearing was a result of my firewall.
Reply

#6
Cool people don't need DEs Wink

-basedir is required because you used the path to the binary file, not the shell script! I think it's better to drop the basedir and use the script instead, which takes care of setting the environment just right.

I didn't know firefox would not strip away the prefix. Makes sense, though. Here's something a little more clever that you can do to strip it yourself:
Code:
sv=${1#xonotic://};
shift;

"blablabla/xonotic.sh" +connect "$sv" "$@"

It adds a little more flexibility in the sense that you can omit the xonotic:// and it will work just fine, and you can pass it extra parameters as well like xonotic-connect.sh 1.2.3.4:26000 +vid_fullscreen 0

This is of course completely optional and will behave the same as your current script.
Reply

#7
Ah yes, I didn't think I'd need to call it with any other options. Best to have the flexibility.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] Xonotic won't launch on Win10 noChance79 7 6,959 06-23-2023, 09:49 AM
Last Post: Cofein
  [NEED HELP] Cannot launch xonotic-linux64-dedicated server (v0.8.5) in Ubuntu18.04 ff8eyes 3 3,037 08-13-2022, 02:43 AM
Last Post: FAF
  [NEED HELP] Segmentation fault on launch Gouldron 0 2,276 04-06-2019, 02:54 PM
Last Post: Gouldron
  [SOLVED] Trouble with launch Xonotic on Mac OS X kanatov 6 11,868 10-03-2015, 10:49 AM
Last Post: SomeGuy
Sad [NEEDS INFO] First Launch = Hard Reboot fr00ty_l00ps 9 9,448 10-04-2012, 11:56 PM
Last Post: Mr. Bougo
  [SOLVED] Black screen and crash at launch kiro 3 5,619 08-11-2012, 04:59 PM
Last Post: Mr. Bougo
  [SOLVED] crash at launch ApexjE 14 14,417 06-16-2012, 08:58 AM
Last Post: ApexjE
  [NEEDS INFO] Cant launch? ubuntu 10.04 shadowfaxim 4 9,932 01-25-2011, 07:54 PM
Last Post: lda17h

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-