I'm working less and less under windows but I can't give up TC...
As far as TC (under wine) is faster than other linux file manager, I was looking for a way to increase its integration under the linux world (many path problem and opening file)
I think I found a -good- way to do it, you'll just need to have php installed on your linux box.
(I think that it should work with other kind of tool such as perl...)
-P1: Installing php (no advanced options needed)
(a) it depends on your distribution...
* Open a terminal (konsole, xterm, whatever you named it) , see (a)
Maybe php is already intalled, to know it , run "which php"
if there is no result, then php is most likely not installed
otherwise remember the result (something like '/usr/bin/php')
* there is 2 ways to install php,see (a)
1-from a package of your distribution, as root (or with the sudo command), run
** yum install php
or
** apt-get install php
2-from source (downloaded from php.net)
see (a)
** "unzip" the downloaded file
** cd "php_source_dir"
** ./configure
** make
** make install
* re-run "which php" and save the result, I'll call it phpPath
-P2: Creating custom command for TC using php
* save the below the file somewhere on your disk (where it won't move later on), named it "myPhpParser.php"
* get the full linux path to this file (see P1(a))
doing a "sudo updatedb" then a "locate myPhpParser.php" should do just fine
note this full path, I'll call it ParserPath
* find the default path for almost all your linux program (should be /usr/local/bin) I'll call nixPath
* edit tc usercmd.ini with linux tools (tc being closed, I know it's hard

**create custom command named as you wish
*** cmd=phpPath ParserPath
*** param=WantedLinuxProgram "%P%N"
* reLaunch TC, create new buttons/menu entry calling this user command
-P3 : Launching Program by pressing "enter"
I suggest to use http://www.totalcmd.net/plugring/registry.html
(it's working fine under wine...)
under the HKEY_CLASSES_ROOT section, you'll have to add / edit values to match your need...
for example, I want to open *.c file with the text editor named scite
I modify the [HKEY_CLASSES_ROOT\.c] entry to have
[HKEY_CLASSES_ROOT\.c]
@="txtfile"
[HKEY_CLASSES_ROOT\.c]
"Content Type"="text/plain"
then I have to edit another entry (matching the -@- value)
[HKEY_CLASSES_ROOT\txtfile\shell\open\command]
@="PHPPATH PARSERPATH scite %1"
here it means that when pressing enter on a C file, TC will call
the php file giving it 2 arguments :
1-the program to launch (in this case SCITE)
2- the "WINDOWS" filename to open
Just above we see 2 difference between the M$ world and linux world
In the unix world there is no "\" in a filename...
-Program name : in wine it could be a real mess to launch unix program
-filename : whe have to convert from WINDOWS name to UNIX, we'll do it in the PHP file
read the commented line in the php code below (beginning with a //)
Code: Select all
<?php
$PATH_2_PROGRAM="SET HERE THE VALUE OF nixPath";
$program2Run=$argv[1];
$file2Open=$argv[2];
//In the drive list , we'll tell php what are the WINDOWS drive letters, plus a final "\\" value
//Usually, the WINDOWS simulated C drive is "~/.wine/drive_c/" (~ means current user home directory)
//be sure that the different element of the array match the corresponding -renamed- element
//the last "\\" is to convert the backslash into slash
$driveList=array("C:","D:","\\");
$truePathForDrive=array("~\drive_c\\","PATH_2_THE_D_FOLDER","/");
//Now we launch the linux process ;)
//what php does in the next line is almost concatenation only of the :
//- unix path to "user" program
//- the program the user wanted to launch
//- the WINDOWS filename converted to the unix filename (given specific relation describe in the 2 arrays above)
//- the ' &' meaning : launch it in background (does not always work thought)
exec($PATH_2_PROGRAM.$program2Run.str_replace($driveList,$truePathForDrive,$file2Open)." &");
?>
I'll -upload- it soon.
-P4: Changing icons in TC file list
TC does not know xpm / png format for icons

You'll have to find the desired xpm file, convert it to *.ico (IIRC, xpm2ico does the job pretty well), place it
under your "C drive", use the file association dialog to display the desired icons...
EDIT : Similar to the previous program...
Code: Select all
<?php
$prog='/usr/bin/'.$argv[1].' ';
$in_array=array("C:","D:","\\");
$out_array=array("~\drive_c\\","PATH_2_THE_D_FOLDER","/");
$tmpFile=str_replace($in_array,$out_array,$argv[2]);
$fp=fopen($tmpFile,"r");
while (!feof($fp)){
$cmd="";
$buffer="";
$buffer=fgets($fp,1024);
if (trim($buffer)!=="") exec($prog.str_replace($in_array,$out_array,$buffer.' >/dev/null &'));
sleep(0.8);
}
fclose($fp);
exit();
?>