Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open <x> folder not working on Linux #3060

Closed
cdglitch opened this issue Nov 27, 2023 · 6 comments
Closed

Open <x> folder not working on Linux #3060

cdglitch opened this issue Nov 27, 2023 · 6 comments

Comments

@cdglitch
Copy link

The open (map/log/replay) folder links in the main dropdown no longer work. Also game.prefs no longer opens.

Maps and mods location:

/home/_username_/.faforever/user/My Games/Gas Powered Games/Supreme Commander Forged Alliance

Repro steps:

  1. Click any of the open x folder buttons in the main hamburger menu

Log:
No relevant output or errors while clicking the buttons

2023-11-27T01:38:47.008+01:00 DEBUG 698968 --- [lication Thread] c.faforever.client.remote.AssetService   : Using cached image: %USER_PROFILE%/.faforever/cache/maps/small/scmp_015.png
2023-11-27T01:41:24.271+01:00  INFO 698968 --- [taskScheduler-1] c.f.client.config.PreferencesConfig      : Writing preferences file `%USER_PROFILE%/.faforever/client.prefs`
2023-11-27T01:41:45.028+01:00 DEBUG 698968 --- [lication Thread] c.faforever.client.remote.AssetService   : Using cached image: %USER_PROFILE%/.faforever/cache/maps/small/astro_crater_battles_4x4_rich_huge.v0004.png
2023-11-27T01:41:45.043+01:00 DEBUG 698968 --- [lication Thread] c.faforever.client.remote.AssetService   : Using cached image: %USER_PROFILE%/.faforever/cache/maps/small/phantom_flat_10x10_circle.v0002.png
2023-11-27T01:42:15.060+01:00 DEBUG 698968 --- [lication Thread] c.faforever.client.remote.AssetService   : Using cached image: %USER_PROFILE%/.faforever/cache/maps/small/the_epic_pass_hy.v0005.png
2023-11-27T01:42:20.038+01:00 DEBUG 698968 --- [lication Thread] c.faforever.client.remote.AssetService   : Using cached image: %USER_PROFILE%/.faforever/cache/maps/small/dualgap_adaptive.v0014.png
2023-11-27T01:43:52.083+01:00 DEBUG 698968 --- [lication Thread] c.faforever.client.remote.AssetService   : Using cached image: %USER_PROFILE%/.faforever/cache/maps/small/survival_horde_ee.v0021.png
2023-11-27T01:43:58.067+01:00 DEBUG 698968 --- [lication Thread] c.faforever.client.remote.AssetService   : Using cached image: %USER_PROFILE%/.faforever/cache/maps/small/project_tabula.v0005.png

Expected behavior:
Something happens (an error or folders being opened.

OS
Linux

@cdglitch cdglitch added the bug label Nov 27, 2023
@Sheikah45 Sheikah45 changed the title Open <x> folder not working Open <x> folder not working on Linux Nov 27, 2023
@Sheikah45
Copy link
Member

On linux we use xdg-open for show files so if you don't have this it won't work. Do you have xdg-open in your distribution?

@cdglitch
Copy link
Author

cdglitch commented Nov 27, 2023

I do indeed

@archbird:~$ xdg-open --version
xdg-open 1.1.3+

Edit: the zsh prompt gets butchered by github

@Sheikah45
Copy link
Member

The code for linux is

//Might not work on all linux distros but let's give it a try
if (Files.isRegularFile(path)) {
  path = path.getParent();
}
ProcessBuilder builder = new ProcessBuilder("xdg-open", path.toAbsolutePath().toString());
builder.start();

Unfortunately I can't test it since I don't have a linux machine. So this will have to wait until some linux developer can replicate it.

@cdglitch
Copy link
Author

You can close this then, I know exactly what the bug is and its not yours.

@Sheikah45
Copy link
Member

Could you comment here with what it is so others could find it later as well if it affects them.

@cdglitch
Copy link
Author

cdglitch commented Nov 27, 2023

This is a braindead retarded bug that crops up from time to time when you update a python package which is able to open a directory. For some reason, some dev over there (possibly pip) has decided that one of sane the package update steps is to nuke your mimeapps.list and flood your .local/share/applications/ directory with .desktop files that advertise that package as default for the inode/directory type.

On Arch based distros this is shitemare to solve since if you do xdg-mime query default inode/directory it can still show the correct file manager but because the xdg-open priority list is now fucked it prefers the wrong thing.

2 shitty solutions all over the net:

  1. Dont use shitty python packages
  2. Have everyone migrate to gvfs-open because fuck most distros and users of non-gnome software.

Alternatively, have fun trying to find what python git/datavis/helper package has shipped these stupid .desktop files because this often cant be fixed by a simple

xdg-mime default org.gnome.Nautilus.desktop inode/directory

Edit: For when someone runs into this and xdg-open and xdg-mime arent happy;

XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default inode/directory

Will give you the list of files xdg-open is considering in what order, in my case,

 .local/share/applications/mimeinfo.cache

was the culprit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants