如何为自定义 nemo 动作添加键盘快捷键?

fli*_*lix 6 cinnamon

我有一个自定义 nemo 操作,如下所述: https ://wiki.archlinux.org/index.php/Nemo#Nemo_Actions

如何添加此操作的快捷方式?

(如果可以在 中添加一行~/.gnome2/accels/nemo,那么我还有一个额外的问题,在我的系统上,该文件是在每次重新启动时自动生成的,因此在此处编辑某些内容将无济于事。我有 Cinnamon 3.2.7 和 nemo 3.2.2。 )

有什么建议么?提前致谢!:)

tvl*_*tvl 5

尼莫行动

首先,您应该myaction.nemo_action~/.local/share/nemo/actions/.

然后,要进行击键,请_在所需字母前面添加下划线。例如,在 中Hello _Shortcuts关键。因此,您按右键单击,然后按s

下面是我使用 Atom 打开文件和目录的操作示例:

# Custom action for Nemo File Manager for Cinnamon.
# Adds right-click open file/files or directory with Atom.
# Place it under: ~/.local/share/nemo/actions/atom.nemo_action
# For more info: https://github.com/linuxmint/nemo/blob/master/files/usr/share/nemo/actions/sample.nemo_action

[Nemo Action]
Active=true
Name=Open in _Atom
Comment=Open %F in Atom
Exec=atom %F
Icon-Name=atom
Selection=any
Extensions=any;
Dependencies=atom;
Quote=double
Run Code Online (Sandbox Code Playgroud)

全局快捷方式

Keyboard如果您想要全局快捷方式,您应该使用下的Cinnamon设置System settings,转到第二个选项卡并添加自定义快捷方式。
或者,如果您更喜欢对 CLI 进行更多控制,则可以使用dconf. 例如,以下配置将添加快捷方式Shift><Alt>a

/org/cinnamon/desktop/keybindings/custom-keybindings/custom0/name
  'Open Atom'
/org/cinnamon/desktop/keybindings/custom-keybindings/custom0/command
  'atom'
/org/cinnamon/desktop/keybindings/custom-keybindings/custom0/binding
  ['<Shift><Alt>a']
/org/cinnamon/desktop/keybindings/custom-list
  ['custom0']
Run Code Online (Sandbox Code Playgroud)