TC under wine: associate/"open with" with linux ap

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
zeltak
Junior Member
Junior Member
Posts: 11
Joined: 2011-07-27, 17:54 UTC

TC under wine: associate/"open with" with linux ap

Post by *zeltak »

Hi All

i was wondering if anyone was using TC with wine in linux and is there any way at all to associate/"open with with linux applications that is tell TC to open avi files with vlc etc

thx alot in advance

z.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Read the Wine documentation, maybe it is not supported by Wine at all.
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Re: TC under wine: associate/"open with" with linu

Post by *karlchen »

Hello, zeltak.

So far I have not tried to create a Total Commander internal association which launches a Linux executable file, but I have created a button which launches /usr/bin/gedit and passes "%S" to it as commandline arguments. I.e. this button passes all marked (text) files to gedit and gedit will open them.

When creating this button in its current form I learnt the following details which may also be relevant when trying to create a Total Commander association which launches VLC:
  • You must launch the Linux executable by prefixing the complete path. I.e. "gedit" will not work, but "/usr/bin/gedit" will work.
  • The Linux executable will expect Linux pathnames in Linux notation (obviously), but Total Commander will provide Windows pathnames in Windows notation (obviously, too).
    As a consequence make sure that you execute the Linux executable from the folder where the file is located which you want the Linux executable to open.
    I.e. try to make sure that passing the pure filename is sufficient so that T.C. does not have to prefix the (Windows) path.
At this point in time I cannot spare the time to try and create a working T.C. internal association which e.g. uses VLC to launch *.avi. Yet, I sure will try later on and post back.
I am pretty confident that it can be done.
Maybe by that time you have been successful yourself and will tell us how to do it.

Kind regards,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, zeltak.

When creating a button which launches gedit and which passes the selected filenames to gedit, it is easy to prevent Total Commander from passing any pathname to gedit:
  • by using the variable "%S" in the "Parameter" field and
  • by leaving the field "Start path" empty
Achieving the same goal seems to be much more tricky when creating an "Internal Association (Total Commander only)":
  • T.C. forces the user to select the executable file by using the pseudo Windows path that it sees itself, i.e. e.g. Z:\usr\bin\totem
  • T.C. adds the parameter "%1" to it itself
  • The corresponding entry in wincmd.ini will read
    [Associations]
    [...]
    Filter2=>VideoFiles
    Filter2_open=Z:\usr\bin\totem "%1"
    It is obvious that this is a Windows commandline.
    Double clicking on a video file launches Totem. But Totem cannot handle the Windows pathname specification which T.C. passes to it.
  • Correcting the entry to read
    [Associations]
    [...]
    Filter2=>VideoFiles
    Filter2_open=/usr/bin/totem "%1"
    does not help much. Double clicking on a video file launches Totem. But Totem still receives a Windows pathname specification by T.C. and cannot handle it.
Conclusion:
We must find a way to convert the Windows pathname which "%1" holds into a Linux pathname before passing it to Totem (any Linux executable).
More likely than not we will need a wrapper script which takes the Windows commandline and transforms it into a Linux commandline before actually launching it.
This in turn suggests that it may not be feasible or at minimum not trivial to create a Total Commander internal association which launches Totem and passes the marked AVI filename.
(The same applies to VLC. I only used Totem, because it came pre-installed on my Ubuntu system.)

I remember that such wrapper scripts were posted in the past. But I cannot remember if any of them did their jobs well.

So, at this point in time, it definitely looks as if my assumption that "it can be done" was too optimistic and that it may be wise to follow MVV's advice and consult the Wine documentation first.

Kind regards,
Karl
--
corrected: in the past, not path
Last edited by karlchen on 2012-01-12, 16:34 UTC, edited 1 time in total.
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, zeltak.

Following MVV's advice to
Read the Wine documentation
took me here: 7.5. I want to associate a native program with a file type in Wine
Maybe the approach explained in the Wine FAQs will be helpful.

Of course, they do not use Total Commander internal file type associations, but they explain how to use Wine file type associations and make those attach to Linux file type associations. But I guess this will be all right as it gets the job done.

Kind regards,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
zeltak
Junior Member
Junior Member
Posts: 11
Joined: 2011-07-27, 17:54 UTC

Post by *zeltak »

Hi

Thx so much for the info!

im pretty newbish so ill try to take a look at the wine docs but i hope i dont get totaly lost

thx again!

z.
zeltak
Junior Member
Junior Member
Posts: 11
Joined: 2011-07-27, 17:54 UTC

Post by *zeltak »

Hi Karl

i spend some time today (slacking off work ;-)....) and got the association set up, was pretty easy using the link you gave me:
Another option is to use a shell script to call a native application. Save it as run_linx_program under $HOME/bin:

#!/bin/sh
$1 "`wine winepath -u "$2"`"

Don't forget to run 'chmod a+x $HOME/bin/run_linx_program' to make it executable. Also make sure that $HOME/bin directory is in your $PATH. Otherwise it will not work.

To associate (say) .pdf files with the acroread Linux program save the following as "$HOME/pdf.reg" and then import it with the command 'regedit $HOME/pdf.reg':

[HKEY_CLASSES_ROOT\.pdf]
@="PDFfile"
"Content Type"="application/pdf"
[HKEY_CLASSES_ROOT\PDFfile\Shell\Open\command]
@="/bin/sh run_linx_program acroread \"%1\""
seems to work great :)

im a long time linux user but after trying a gazillion dual pane file manager apps (which are great..krusader, DC etc..) none are as complete and stable as TC... finally had the courage to use wine and get it runing and i really hope it can be my main File manager on nix

btw which distro are you running?

best

Z
zeltak
Junior Member
Junior Member
Posts: 11
Joined: 2011-07-27, 17:54 UTC

Post by *zeltak »

btw

a little off topic but maybe ghisler would consider instead of porting TC to linux to maybe maintain a wine optimized version, wouldnt that be alot easier? its not ideal as a port but at least we linux guys dying to use the greatest file manger of all time wouldnt be left out..lol

thx again

z.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

a little off topic but maybe ghisler would consider instead of porting TC to linux to maybe maintain a wine optimized version, wouldnt that be alot easier?
I'm already doing that, but some concepts like system-wide file associations don't exist like this.

Try using internal associations instead.
Author of Total Commander
https://www.ghisler.com
zeltak
Junior Member
Junior Member
Posts: 11
Joined: 2011-07-27, 17:54 UTC

Post by *zeltak »

I'm already doing that
WOW..seriously? holy sh** you just made my week (maybe month) ghisler!!

that's really exciting, is there a alpha/beta i could try/test?

thx alot, this is very exciting news.. (i hope i understood correctly when you say im already doing that..IE using wine to maintain a TC linux version??)

thx again from a long time TC user!!!

Z.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry for the misunderstanding, I only meant that I'm regularly testing TC on Linux, and fix problems specific to that platform. Since TC is written in Delphi, I cannot link it to some Wine libraries. Bringing out a native Linux version wouldn't be very helpful either because all the plugins would have to be ported too...
Author of Total Commander
https://www.ghisler.com
zeltak
Junior Member
Junior Member
Posts: 11
Joined: 2011-07-27, 17:54 UTC

Post by *zeltak »

hi again ghisler

damm was excited over nothing for a few hours..lol..

i know a sh** ton of fellow linux users that are dying to see TC for linux but im sure you already know that :)
Bringing out a native Linux version wouldn't be very helpful either because all the plugins would have to be ported too...
a native verison without plugins would still be amazing ;-)


anyway i will continue to keep on dreaming..who knows maybe when the "linux year on the desktop" finally happens we will get some consideration..at least i have TC on my andorid phone/tablet ;-)

thx again

z.
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

ghisler(Author) wrote:Bringing out a native Linux version wouldn't be very helpful either because all the plugins would have to be ported too...
I'm sure they would be. Not all of them, of course, but many would follow. And I agree to zeltak that even without plugins TC would outmatch most (if not all) of existing Linux file managers.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
Post Reply