HGL
rare-sapphire
How to pass documents with mime-types?
Hey I just installed the Affinity V1 with ElementWarrior inside Heroic.
So, everything is functional.
But then I added the .afphoto , .afdesigner ,.afpub to the mime-types for recognition and convenience.
Then I made a application.desktop file inside
~/.local/share/application
for the system to start the app from outside.
But when I try to open the document directly - it just opens the app, but not the document inside the app.
I learned how to pass documents using command-line with WINEPREFIX=~/Heroic/Prefixes/default/Affinity ~/Heroic/custom_wines/ElementalWarriorWine/bin/wine start /unix '~/Heroic/Prefixes/default/Affinity/drive_c/Program Files/Affinity/Photo/Photo.exe' ~/Work/Affinity/Photo/Brush_Test.afphoto
to get it running and all, but I'm struggling to do that with heroics gui settings - to get the file location from system/double-click-document to pass to xdg and then to wine and then to the app.
I tried to do some-stuff with the Game Arguments, Wrapper Command, Variable Name Value, etc. inside the settings but it didn't pan out.
I'll post the whole desktop file in the reply.
But the executable in it is:
But if I cant get it running with Heroic / xdg then I'm gonna just gonna use the raw "WINEPREFIX" variable and "ElementWarrior/bin/wine" directly in the "EXEC" in the desktop file in .local/share/application/[something].desktop
which I dont prefer, cause then I'll have to handle the heroic setup and my document launching separately.
So, I just want to know how to pass the document from system -> xdg -> heroic -> wine -> App.exe .
Thank you.


5 Replies
rare-sapphireOP•3mo ago
This is the entire desktop entry of
Affinity Photo.Desktop
:
equal-aqua•3mo ago
In your exec line, you aren’t passing in the file name with
%f
or similar
Which given the general setup of Heroic being directed toward games, I wouldn’t be able to answer if the xdg-open method of running heroic can accept file arguments like thatrare-sapphireOP•3mo ago
I've tried it, if I put
%f
beside xdg-open the app.desktop simply wont even start.
I also tried to add &file=%f
inside xdg-open but that also didn't work.
So I just want to focus on the heroic way of getting and passing %f or %u like variables through all the layers of wrapping into the final windows executable.equal-aqua•3mo ago
Do you have examples of what you tried, in full?
rare-sapphireOP•3mo ago
OK,
This is the normale %f command in (dot)desktop file (that doesnt work):
Exec=xdg-open 'heroic://launch?appName=8qReAiWtrfZg79TBrEm7Y1&runner=sideload' %f
Exec=sh -c "xdg-open 'heroic://launch?appName=8qReAiWtrfZg79TBrEm7Y1&runner=sideload' %f"
Exec=sh -c "xdg-open 'heroic://launch?appName=8qReAiWtrfZg79TBrEm7Y1&runner=sideload&file=%f'"
###
For now I've set up my alternative solution (the Non-Heroic, direct wine/ElementWarrior way) :
This is also capable of passing documents to an already open application.
I also tried to pass this as %f :
$(WINEPREFIX=~/Heroic/Prefixes/default/Affinity ~/Heroic/custom_wines/ElementalWarriorWine/bin/winepath -w %f)
so it auto converts any path into a windows friendly format.