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

时间:2016-12-29 13:46:05

标签: cinnamon

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

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

(如果可以在~/.gnome2/accels/nemo中添加一行,那么我还有一个问题,就是在我的系统上这个文件是在每次重启时自动生成的,所以在这里编辑一些东西也无济于事。我有Cinnamon 3.2 .7和nemo 3.2.2。)

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

1 个答案:

答案 0 :(得分:1)

Nemo Action

首先,您应将myaction.nemo_action放在~/.local/share/nemo/actions/下。

然后,要进行击键,在您想要的字母前放置一个下划线_。例如,在Hello _Shortcut中,s是关键。因此,您按右键单击,然后按s

Bellow是我使用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

全球快捷方式

如果您想要全局快捷方式,则应使用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']