Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome 如何定义自定义方案处理程序以使用mutt查看Maildir文件_Google Chrome_Uri_Mutt - Fatal编程技术网

Google chrome 如何定义自定义方案处理程序以使用mutt查看Maildir文件

Google chrome 如何定义自定义方案处理程序以使用mutt查看Maildir文件,google-chrome,uri,mutt,Google Chrome,Uri,Mutt,我想定义一个自定义方案处理程序,比如:muttview://以便打开终端并在mutt中查看Maildir。Mutt应该运行类似于:Mutt-f/home/user/Maildir的程序/email@example.com此目录将位于Maildir的位置 URI希望如下所示:muttview:///home/user/Maildir/email@example.com 我尝试过这样设置: 使用/usr/share/applications中的muttview.desktop [Desktop En

我想定义一个自定义方案处理程序,比如:muttview://以便打开终端并在mutt中查看Maildir。Mutt应该运行类似于:Mutt-f/home/user/Maildir的程序/email@example.com此目录将位于Maildir的位置

URI希望如下所示:muttview:///home/user/Maildir/email@example.com

我尝试过这样设置:

使用/usr/share/applications中的muttview.desktop

[Desktop Entry]
Categories=Office;Network;Email;
Comment=Simple text-based Mail User Agent
Comment[de]=Einfaches, Text-basiertes Mailprogramm
Exec=mutt -f %u
Icon=mutt
Name=mutt
Name[de]=Mutt
MimeType=x-scheme-handler/muttview;
NoDisplay=true
Terminal=true
Type=Application
在Chrome中,它只会打开一个新的浏览器。在Firefox中,它打开了一个很快消失的小终端


我哪里错了?

我已经找到了一个解决方案,我想就这个问题回答我自己

首先,我创建了一个脚本来启动我的视图:URI方案

#!/usr/bin/perl 
use strict;
use warnings;
use feature ':5.10';
use utf8;

binmode(STDOUT, ":encoding(UTF-8)");
binmode(STDIN, ":encoding(UTF-8)");
$| = 1;

exit unless($ARGV[0] =~ /^muttview:/i);
my $uri = $ARGV[0];
my @email = split(':', $uri);
my $email = $email[1];

my $maildir = '/home/data1/protected/Maildir/' . $email;
unless(-d $maildir) {
    system("zenity --info --text 'Maildir: $maildir does not exit'");
} else {
    system("uxterm -e mutt -f '$maildir'");
}
然后,我在/usr/share/applications中创建了一个名为:muttview.desktop的文件:

[Desktop Entry]
Categories=Office;Network;Email;
Comment=Simple text-based Mail User Agent
Comment[de]=Einfaches, Text-basiertes Mailprogramm
Exec=/home/data1/protected/bin/MuttView.pl %u
Icon=mutt
Name=mutt
Name[de]=Mutt
MimeType=x-scheme-handler/muttview;
NoDisplay=true
Terminal=true
Type=Application
然后我运行了以下命令:

xdg-settings set default-url-scheme-handler muttview muttview.desktop
现在,当我用HTML创建一个链接时,比如:

<a href="muttview:some@example.com">some@example.com</a>

我得到了相应用户的Maildir电子邮件的完整列表

我的环境很简单,我不使用Gnome或KDE