![]() |
![]() |
Amico Desktop |
![]() |
Introduction
Getting the Software
Screenshots
Configuring
Contributors
| Default | Linux | Windows |
| Temporary Direcory | /tmp | C:\windows\temp |
| Command Handle | /usr/bin/mtpmime | C:\windows\mtpmime |
In the "Don't download Protocols" line, you can insert the name of protocols that you don't want to be downloaded. In this case the original link is given to the program handler.
The handler program must be an executable. Two examples:
| TCL | Perl |
#!/usr/bin/wish
set filename [lindex $argv 0]
set type [file extension $filename]
set action {
/usr/bin/soffice {
.sx. .pp. .do. .xl. .rtf .csv .htm
.jp. .gif
.dbf .ric
}
/usr/bin/kfax {
.tif .tiff
}
}
foreach { bin suffix } $action {
foreach suf $suffix {
if ![regexp ^$suf $type] { continue }
if ![file exist $bin] { continue }
exec $bin $filename &
after 10000
exit 0
}
}
tk_messageBox -message "Cannot handler $filename"
exit 0
|
#!/usr/bin/perl
use Tk;
sub report_error {
my $arg = shift;
my $mw = MainWindow->new;
$mw->Button( -text => "OK",
-command => sub{exit}
) -> pack(-side => "bottom");
$mw->Label( -text => $arg,
) -> pack(-side=>"top", -expand=> 1);
$mw->geometry("200x100+100+100");
MainLoop;
}
my $arg = shift;
$arg =~ /\.(.*?)$/;
my $ext = $1;
print $ext . "\n";
my %extensions= (
"/usr/local/bin/gmplayer" => ["mov", "mpg", "avi", "mpeg"],
"/usr/bin/oowriter" => ["doc", "rtf"]
);
while ( ($prog, $exts) = each %extensions ) {
foreach my $i ( @$exts ) {
if ($ext eq $i) {
exec $prog, $arg;
report_error ("Unable to run $prog $arg");
exit;
}
}
}
report_error ("No handler for $ext");
|
  |