How to pass file as argument in .desktop file for wine app?

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
zetah
Newbie
Newbie
Posts: 4
Joined: Sun Dec 11, 2011 5:45 am

How to pass file as argument in .desktop file for wine app?

Post by zetah »

I'm running Wine 1.3.24 on Ubuntu 11.04

Please consider this .desktop file for Notepad application:

Code: Select all

[Desktop Entry]
Name=Notepad
Exec=wine "/home/zetah/.wine/drive_c/windows/notepad.exe" %F
Type=Application
Terminal=false
Categories=Wine
MimeType=text/plain
If I pass/drop text file on this notepad.desktop file, Notepad complains about error reading the file, as it can't resolve file path

If I put Exec line like this:

Code: Select all

Exec=wine "/home/zetah/.wine/drive_c/windows/notepad.exe" z:%F
then it reads passed file fine, but every time I start notepad.desktop file (so without passing file on it) "z:" argument is passed to Notepad which is undesired.

Notepad is just example application.

How can I resolve this problem, without scripts or other complications?

TIA
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: How to pass file as argument in .desktop file for wine a

Post by vitamin »

zetah wrote:If I pass/drop text file on this notepad.desktop file, Notepad complains about error reading the file, as it can't resolve file path
Of course that won't work. Wine's notepad needs windows paths, not *NIX paths. Use 'winepath' program to convert between the two.

You can open bug about it, but doubt it can be resolved that easy. The program that creates .desktop doesn't know if a parameter supposed to be a file or something else.
zetah
Newbie
Newbie
Posts: 4
Joined: Sun Dec 11, 2011 5:45 am

Post by zetah »

Thanks, I didn't know about `winepath` command. I used sh + sed + xargs as a workaround, but this is much better now
Locked