如何将 neomutt 设置为 i3 中的默认电子邮件客户端?

如何将 neomutt 设置为 i3 中的默认电子邮件客户端?

我尝试过以下解决方案,

  1. ~/.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
  1. 我用来xdg-mime设置处理程序mailto://
$ xdg-mime default neomutt.desktop x-scheme-handler/mailto
$ xdg-mime query default 'x-scheme-handler/mailto'
neomutt.desktop

然而,上述解决方案存在两个问题。

  1. 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。

  1. 对于网页上的电子邮件地址
  • 如果未安装 Firefox,则在 Chrome 中单击“mailto://”不会有任何响应。
  • 如果安装了 Firefox,则在 Chrome 中单击“mailto://”将启动 Firefox,而 Firefox 又会启动 neomutt。

答案1

就我而言,我这样做了ranger

  1. xdg-mime default neomutt.desktop x-scheme-handler/mailto
  2. 创造~/.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

相关内容