我尝试过以下解决方案,
~/.local/share/applications/neomutt.desktop
使用以下内容创建后,
[Desktop Entry]
Name=neomutt
GenericName=neomutt
Icon=neomutt
Exec=neomutt %u
Terminal=true
Type=Application
Categories=Utility;TextEditor;
MimeType=x-scheme-handler/mailto;
NoDisplay=true
StartupNotify=false
- 我用来
xdg-mime
设置处理程序mailto://
$ xdg-mime default neomutt.desktop x-scheme-handler/mailto
$ xdg-mime query default 'x-scheme-handler/mailto'
neomutt.desktop
然而,上述解决方案存在两个问题。
xdg-open mailto:[email protected]
在终端中可以启动 neomutt。但退出 neomutt 后,会显示以下消息,
/usr/bin/xdg-open: line 881: x-www-browser: command not found
/usr/bin/xdg-open: line 881: Firefox: command not found
/usr/bin/xdg-open: line 881: iceweasel: command not found
/usr/bin/xdg-open: line 881: seamonkey: command not found
/usr/bin/xdg-open: line 881: mozilla: command not found
/usr/bin/xdg-open: line 881: epiphany: command not found
/usr/bin/xdg-open: line 881: konqueror: command not found
/usr/bin/xdg-open: line 881: chromium: command not found
/usr/bin/xdg-open: line 881: chromium-browser: command not found
/usr/bin/xdg-open: line 881: google-chrome: command not found
/usr/bin/xdg-open: line 881: www-browser: command not found
/usr/bin/xdg-open: line 881: links2: command not found
/usr/bin/xdg-open: line 881: elinks: command not found
/usr/bin/xdg-open: line 881: links: command not found
/usr/bin/xdg-open: line 881: lynx: command not found
w3m: Can't load mailto:[email protected].
xdg-open: no method available for opening 'mailto:[email protected]'
如果我安装了 Firefox,Firefox 实例将启动,然后它会再次启动 neomutt。
- 对于网页上的电子邮件地址
- 如果未安装 Firefox,则在 Chrome 中单击“mailto://”不会有任何响应。
- 如果安装了 Firefox,则在 Chrome 中单击“mailto://”将启动 Firefox,而 Firefox 又会启动 neomutt。
答案1
就我而言,我这样做了ranger
:
xdg-mime default neomutt.desktop x-scheme-handler/mailto
- 创造
~/.local/share/applications/neomutt.desktop
# ~/.local/share/applications/neomutt.desktop
[Desktop Entry]
Categories=Office;Network;Email;
Comment=Simple text-based Mail User Agent
Comment[de]=Einfaches, Text-basiertes Mailprogramm
# change `st -e` to your terminal running cmd
Exec=st -e neomutt %u
Icon=neomutt
Name=neomutt
Name[de]=Mutt
MimeType=x-scheme-handler/mailto;
NoDisplay=false
Terminal=false
Type=Application
现在点击mailto:
将打开st
终端neomutt