Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Linux, Mac OS X, & Co

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd July 2023, 02:24   #1  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,855
Linux, Wine and shortcuts

Any Linux experts out there?

I'm new to Linux but I've been experimenting with Wine and finally had a reasonable amount of success running the Windows programs I'd like to keep using for the moment.
Creating start menu shortcuts was a challenge initially, but I seem to have it sorted now with one exception. The desktop files I've created don't work when added to the file manager's sendto folder because the file path looks like a command to most programs. The same applies to using the "open with" menu.

Here's a typical desktop file (created manually):

Code:
[Desktop Entry]
Name=MPC-HC
Comment=
Type=Application
Categories=AudioVideo;Player;
Icon=/home/Me/.local/share/icons/MPC-HC.png
Exec=env WINEPREFIX="/home/Me/.local/share/wineprefixes/Win64" wine "/home/Me/.local/share/wineprefixes/Win64/drive_c/Program Files/MPC-HC/mpc-hc64.exe" %f
and here's the error message MPC-HC displays when opening a file with sendto:

Code:
Unrecognised switch(es) found in command line string: 

C:\Program Files\MPC-HC\mpc-hc64.exe /media/NVME1/video.mkv
I've created a drive labelled "M" in Wine with the target "/media", so I'm wondering if there's a way to turn %f into windows-speak so the result would be this instead.

Code:
C:\Program Files\MPC-HC\mpc-hc64.exe M:\NVME1\video.mkv
Cheers.

PS Desktop files created by PlayOnLinux work fine as sendto items, but PlayOnLinux is obviously taking care of the translation. The desktop file it created for MPC-HC (I've modified it a little) looks like this:

Code:
[Desktop Entry]
Encoding=UTF-8
Name=MPC-HC
Comment=PlayOnLinux
Type=Application
Exec=/usr/share/playonlinux/playonlinux --run "MPC-HC" %F
Icon=/home/Me/.PlayOnLinux//icones/full_size/MPC-HC
StartupWMClass=mpc-hc64.exe
Categories=AudioVideo;Player;
Cheers.

Last edited by hello_hello; 3rd July 2023 at 02:32.
hello_hello is offline   Reply With Quote
Old 6th July 2023, 11:19   #2  |  Link
jones1913
random user
 
Join Date: May 2014
Location: #Neuland
Posts: 116
I had the same problem recently and found a solution in a forum:
The 'winepath' tool can be used to convert path names between windows and unix format.

Try this:
Code:
Exec=env sh -c "winepath -w -0 %F | WINEPREFIX='/home/Me/.local/share/wineprefixes/Win64' xargs -0 wine '/home/Me/.local/share/wineprefixes/Win64/drive_c/Program Files/MPC-HC/mpc-hc64.exe'"
__________________
BeHappy Audio Transcoder > <Doom9 forum> <Gleitz forum> <GitHub>
MP4.tool GUI for MP4Box & L-SMASH muxer > https://www.mediafire.com/folder/3i6y6cbkyhblm/MP4.tool
jones1913 is offline   Reply With Quote
Old 7th July 2023, 01:22   #3  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,855
Perfect! Thank you.

I'd done a fair bit of searching and assumed for it to work correctly 'winepath' would need to be involved, but I couldn't work out how to implement it in a shortcut.
I don't know why the WineHQ site doesn't provide instructions for creating shortcuts this way.

Cheers.
hello_hello is offline   Reply With Quote
Old 7th July 2023, 06:34   #4  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,855
I thought I'd add the following in case it helps someone. There was one program that wouldn't behave itself when using the method above (AvsPmod), but adding the following in red fixed it. Why it wouldn't work in the first place and why the following does, I'm not sure yet, but adding the red text for shortcuts that were already working as sendto items didn't seem to have an adverse effect on them.

Code:
Exec=env sh -c "winepath -w -0 %F | WINEPREFIX='/home/Me/.local/share/wineprefixes/Win64' xargs -0 wine start /Unix '/home/Me/.local/share/wineprefixes/Win64/drive_c/Program Files/AvsPmod/AvsPmod.exe'"

Last edited by hello_hello; 7th July 2023 at 11:12.
hello_hello is offline   Reply With Quote
Old 7th July 2023, 08:40   #5  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,846
So you installed Linux so you can use Windows programs again? What's the point? :S
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 7th July 2023, 11:08   #6  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,855
Quote:
Originally Posted by microchip8 View Post
So you installed Linux so you can use Windows programs again? What's the point? :S
No Windows.
No Microsoft.

I've been replacing Windows programs with native Linux alternatives where I can, but there's some programs I'm used to and don't want to give up (yet), or I haven't found a Linux alternative I like.

Last edited by hello_hello; 7th July 2023 at 11:19.
hello_hello is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:13.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.