anyc / steam-overlay

Gentoo overlay for Valve's Steam client and Steam-based games
GNU General Public License v2.0
202 stars 44 forks source link

SteamVR quit button opens in browser instead of using vrmonitor.sh. #324

Closed kzdixon closed 1 year ago

kzdixon commented 1 year ago

The desktop files that exist in .local/share/applications for SteamVR are all valid and launch the vrmonitor but seem to not work when using xdg-open for the same URI that the UI would use.

For example the result I get is:

$ xdg-open vrmonitor://quit
env: ‘"/home/kyle/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/../vrmonitor.sh"’: No such file or directory
/usr/bin/xdg-open: line 870: x-www-browser: command not found

and then the URI gets opened up in firefox instead. The vrmonitor.sh in question does indeed exist at that path.

Any assistance would be greatly appreciated as I would love to get this fixed so I can quit SteamVR from within SteamVR. The desktop files seem to exactly match what I had on my Arch install where all of the behavior works as expected (pressing quit in SteamVR quits out of SteamVR instead of opening the URI in firefox).

chewi commented 1 year ago

Sorry, I don't know what to make of that, and I'm not interested in VR, so I won't be able to try it. I can't tell from this whether it's trying to launch the script directly or via something else. If it's the latter, perhaps it tries to launch the script in a container where it can't see /home. You can check the defined handler with:

xdg-settings get default-url-scheme-handler vrmonitor
kzdixon commented 1 year ago
$ xdg-settings get default-url-scheme-handler vrmonitor
valve-URI-vrmonitor.desktop

This lines up with it trying to run vrmonitor.sh but it's certainly odd how the behavior with xdg-open is not the same as executing the desktop file directly...

And for context here is the contents of that desktop file:

[Desktop Entry]
Name=URI-vrmonitor
Comment=URI handler for vrmonitor://
Exec="/home/kyle/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/../vrmonitor.sh" %U
Terminal=false
Type=Application
Categories=Game;
MimeType=x-scheme-handler/vrmonitor

If it helps, the same behavior does not occur with the steam:// URI handler:

$ xdg-settings get default-url-scheme-handler steam
steam.desktop
$ xdg-open steam://store
steam.sh[26546]: Running Steam on gentoo 1.0.0.74-r1 64-bit
steam.sh[26546]: STEAM_RUNTIME is disabled by the user
steam.sh[26546]: Can't find 'steam-runtime-check-requirements', continuing anyway

I could've sworn this was misbehaving too at some point, but the steam://store test seems to work. Trades tended to open in the browser though, if I recall.

I can always try opening an issue on the SteamVR-For-Linux tracker as well, but I figured this was Gentoo-specific since it seems to behave correctly on Arch.

kzdixon commented 1 year ago

It looks like the bandaid fix is to edit the desktop files that SteamVR auto-generates and remove the double quotes around the path, then set them all as read-only.

chewi commented 1 year ago

I'd like to know what's really going on here so reopening. Now I've looked at your original error message more closely, what you've said about the quotes makes sense. There must be some difference with the handling of desktop files. Which desktop are you running in each case?

kzdixon commented 1 year ago

The Exec for the Steam URI handlers lack double quotes. ie: Exec=steam steam://open/screenshots from steam.desktop (I have some local overrides for scaling so forgive me if this has changed in the one shipped with steam).

valve-URI-steamvr.desktop valve-URI-vrmonitor.desktop and valve-vrmonitor.desktop that SteamVR seems to autogenerate at launch (it didn't seem to overwrite the valve-URI-steamvr.desktop when I last opened SteamVR oddly) all had double quotes around the path to each Exec target. All three work when executed directly via my file manager, but the xdg-open behavior was as explained prior.

chewi commented 1 year ago

Okay, but I wanted to know why it was different on Arch. I thought it might be this unreleased fix, which now exists in both Gentoo and Arch, but maybe wasn't in Arch when you tried it. However, that doesn't actually explain it. I'll play around with this later.

kzdixon commented 1 year ago

I could get my arch install updated and retest there just to sanity check if needed. I swapped over around maybe the 1st quarter of last year so its been a little while, but that commit should have been included if that is the case.

kzdixon commented 1 year ago

It looks like my friend setting up steamvr on a new Arch lxc container also ran into this problem, so its an issue Valve introduced after I swapped to Gentoo.

chewi commented 1 year ago

Sorry, I never got a chance to look further into this. I'll close it if it's really Valve's issue. Thanks for reporting back.