Open YaLTeR opened 6 years ago
Really the %u
there is the problem, but when I tried excluding it nothing worked. Perhaps a bug in xdg-open
? I guess a workaround would be to write out a shell file that ignores the parameter and just runs xdg-open steam://rungameid/<number>
. 🤔
In addition to that it doesn't seem to like the digits in the URL. There are two checks, one for file://
and another for URL which looks like echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'
, and this latter check suceeds for something://
if something contains digits. This results in xdg-open
not even trying to open it as a URL for me.
Although that doesn't really matter, since Discord itself doesn't use xdg-open
to open the URL, does it?
Yeah, it does
Perhaps there's a way to add something like discord://run/<id>
similar to how Steam does it, and then it'll invoke the correct thing?
I got around this by adding ; \:
to the end of the Exec line in the .desktop file. Until Discord_RegisterSteamGame
is fixed you can at least register it manually with something like this:
const char* LAUNCH_CMD = "xdg-open steam://rungameid/<gameid> ; \\:";
Discord_Initialize(APPLICATION_ID, &handlers, 0, STEAM_APPID);
Discord_Register(APPLICATION_ID, LAUNCH_CMD);
We register a desktop file containing
xdg-open steam://rungameid/<number> %u
, but it turns out that when we doxdg-open discord-<number>://
it actually runsxdg-open steam://rungameid/<number> discord-<number>://
(so it appends the original "url") and then complains about the second argument (since there's only supposed to be one argument toxdg-open
).Not sure how to handle this (is there a way to prevent that argument from getting appended?). Looking at the
xdg-open
source, for me (no DE, maybe that's the problem) the final line that executes the command is"$command_exec" "$@"
where$command_exec
turns out to bexdg-open steam://rungameid/<number>
(from the .desktop file), and$@
isdiscord-<number>://
.