如何配置Nemo的右键“在终端中打开”启动“gnome-terminal”

L. *_*mes 17 gnome-terminal nemo

我意识到 Nemo 右键单击​​“在终端中打开”的默认设置是启动“gnome-terminal”,但是,我的安装是打开“xfce4-terminal”。

不久前,当“gnome-terminal”被破坏时,我安装了“xfce4-terminal”作为替代。我将系统范围的默认设置配置为为终端调用“xfce4-terminal”。

在解决 Gnome 终端的问题后,我将系统范围的默认设置移回了 Gnome 终端。Nautilus 再次开始使用 Gnome 终端,但是Nemo继续只启动“xfce4-terminal”。

我卸载了“xfce4-terminal”,然后 Nemo 的“在终端中打开”功能停止工作。

为了解决这个问题,我做了以下工作:

  • 重新安装 Ubuntu 16.04
  • Purged and reinstalled Nemo

Nemo still will only launch "xfce4-terminal". It appears to be a problem with in my home folder's Nemo configuration or some other per user cache.

Creating a new user, and Nemo properly launches "Gnome-Terminal".

Can someone help me with where to check and fix Nemo's functionality in my '/home/username` settings.

Is there some type of editible configuration to check what happens when clicking on the "Open in Terminal" function?

小智 29

谷歌把我带到这里,所以我正在恢复这个线程,希望至少让一个人免于一些不必要的麻烦。

我正在使用 Debian,这里 LD James 的建议对我不起作用。所以我查看了 Nemo 的源代码,在nemo-global-preferences.c 的第 132 行我发现(上游)配置模式如下:

org.cinnamon.desktop.default-applications.terminal

我使用 Nemo 作为 Nautilus 的替代品,并且由于我使用的是 Gnome3 而不是 Cinnamon,对我来说这个模式甚至不存在。因此,我使用以下命令创建了它。发出此命令后,“在终端中打开”操作将gnome-shell在正确的目录中打开:

gsettings set org.cinnamon.desktop.default-applications.terminal exec gnome-shell 
Run Code Online (Sandbox Code Playgroud)

只需将gnome-shell命令替换为您想使用的任何终端即可。例如:对于gnome-terminal,使用:

gsettings set org.cinnamon.desktop.default-applications.terminal exec gnome-terminal
Run Code Online (Sandbox Code Playgroud)

对于terminator( sudo apt install terminator) 使用:

gsettings set org.cinnamon.desktop.default-applications.terminal exec terminator
Run Code Online (Sandbox Code Playgroud)

  • 使用上述方法,将 gnome-shell 替换为您要使用的任何终端应用程序,它应该可以工作。在 Arch 上工作... (2认同)

L. *_*mes 17

Nemo 使用 gsettings 配置。这恢复了预期的行为:

$ gsettings set org.gnome.desktop.default-applications.terminal exec gnome-terminal
Run Code Online (Sandbox Code Playgroud)

在 Ubuntu 上,出于某种原因,情况有所不同:

$ gsettings set org.cinnamon.desktop.default-applications.terminal exec gnome-terminal
Run Code Online (Sandbox Code Playgroud)

  • 实际上,在 Ubuntu 上,这两个命令都是必需的!第一个命令使用 **Ctrl + Alt + T** 更改打开的终端,第二个命令使用 Nemo 中的右键单击菜单选项更改打开的终端。 (3认同)

小智 6

在 Xubuntu 18.10 这对我有帮助(我使用 sakura 作为终端):

$ gsettings set org.cinnamon.desktop.default-applications.terminal exec sakura
Run Code Online (Sandbox Code Playgroud)


Ban*_*nas 6

如果您不想替换,而是在右键菜单中添加“在终结者中打开” ,

\n
    \n
  1. 转到/home/$USER/.local/share/nemo/actions文件夹,
  2. \n
  3. 创建open_in_terminator.nemo_action 文件:\n
    [Nemo Action]\n\nName=Open in Terminator\nComment=Open the \'terminator\' terminal in the selected folder\nExec=terminator --working-directory=%F\nIcon-Name=terminator\nSelection=any\nExtensions=dir;\nEscapeSpaces=true\n
    Run Code Online (Sandbox Code Playgroud)\n
  4. \n
\n

添加完上述文件后,关闭并重新打开 Nemo。

\n

现在右键菜单截图:

\n

\xe2\x80\x83\xe2\x80\x83在此输入图像描述

\n

细节

\n

来自加布里埃尔·斯台普斯 (Gabriel Staples),在这里

\n
\n

不要忘记EscapeSpaces=true,否则“在终结者中打开”操作将无法在其路径中包含空格、单引号 ( \') 或双引号 ( ") 的任何文件夹上运行。

\n
\n

官方文档(仍然适用于nemo 可以安装在 Ubuntu 22.04 上的版本)说:

\n
\n
# Escape Spaces - set to true to escape spaces in filenames and uris ($U, $F, $P, $D)\n#\n# Sometimes this may be preferred to getting raw filenames that must be enclosed in\n# quotes.\n#\n# Optional - by default this is false\n\nEscapeSpaces=true\n
Run Code Online (Sandbox Code Playgroud)\n
\n

文档称该字段已被弃用,并且在 Nemo 的未来版本中不会执行任何操作

\n
\n
# Escape Spaces (deprecated)\n#\n# This field is deprecated and does nothing - paths with spaces, as well as other special\n# shell characters, will now be passed on correctly no matter what, even when Quote is not set.\n#\n# Optional - by default this is false\n\n#EscapeSpaces=true\n
Run Code Online (Sandbox Code Playgroud)\n
\n

参考:

\n
    \n
  1. 博客文章:“在 Linux Mint / Ubuntu 中添加右键单击命令”,作者:Angelos Kyritsis
  2. \n
  3. /usr/share/nemo/actions/sample.nemo_action中的示例 Nemo 右键单击​​菜单操作文件
  4. \n
  5. Gabriel Staples 在他的eRCaGuy_dotfiles存储库中的open_in_terminator.nemo_action文件。
  6. \n
\n