Re: Linux/Wine compatibility: request for feedback
Reply #25 – 2023-08-11 07:53:48
As I much prefer to open files in most programs using the File Manager's sendto menu, rather than open a program first and use it's own menu to open files, I spent some time with google while banging my head on the desk, but I eventually got it to work properly. I just noticed this thread so I thought I'd add the info here in case someone else might find it useful. Create a desktop file for foobar2000 (a text file). Something like this:[Desktop Entry] Name=foobar2000 Comment= Type=Application Icon=/home/UserName/.local/share/icons/foobar2000.png Exec=env sh -c "winepath -w -0 %F | WINEPREFIX='/home/UserName/.local/share/wineprefixes/Win64' xargs -0 wine start /Unix '/home/UserName/.local/share/wineprefixes/Win64/drive_c/Program Files (x86)/foobar2000/foobar2000.exe'" StartupWMClass=foobar2000.exe Categories=AudioVideo;Player; My Wine prefix is called Win64. Obviously you'd change the name and the path to the Wine prefix accordingly. If you want an icon for the start menu entry, you need to create it yourself. My Linux distro included a utility for extracting icons from exes, and from there I saved it as a png. The Categories line determines the start menu folder the foobar2000 shortcut will appear in. Categories=AudioVideo;Player; puts the shortcut in the "Multimedia" folder. You can use either %F or %f in the file path (see the Exec line). %F lets you open multiple files simultaneously via the sendto menu, whereas %f only opens one file at a time. Save the text file as "foobar2000.desktop" or something similar. For my distro, the "user" start menu folder is located here: /home/UserName/.local/share/applications/ Put a copy of the foobar2000.desktop file in there. On occasion I've had to log out and back in before a new item would appear in the start menu. For me, the File Manager's sendto folder is located here: /usr/share/Thunar/sendto/ Put a copy of the foobar2000.desktop file in there too. With any luck, you should now have a foobar2000 item in the sendto menu: The above method should work for any program. If you're using a utility such as WineTricks to install programs in Wine, you'll need to modify any start menu "shortcut" WineTricks creates in order to use it as a sendto item. The shortcuts PlayOnLinux creates usually work as sendto items as PlayOnLinux translates the command line. I'm not sure how that works exactly, but I've found programs can be a bit slow to open from the shortcuts it creates, whereas they open at normal speed from a shortcut like the one above. If you use the "open with" menu to open files instead of sendto, it'll also work properly, assuming you replace any existing shortcut with a new one.