Ubuntu 19.04,在同一桌面上创建自定义快捷方式,例如SUPER + NUM(收藏的应用程序创建|显示)快捷方式

时间:2019-05-27 13:58:45

标签: keyboard-shortcuts ubuntu-19.04

在同一桌面上创建显示或隐藏我想要的任何窗口,而不是默认的 SUPER + NUM 功能。

  

我也要删除默认的(旧)。

1 个答案:

答案 0 :(得分:0)

删除默认快捷方式:

通过终端命令

function solution(x) {
  for (let i = 0; i < x.length; i++) {
    for (let j = 0; j < x.length; j++) {
      if (x[i][j] == x[i][j + 1] && x[i][j] !== 0) {
        x[i][j + 1] = x[i][j] * 2;
        x[i][j] = 0;
        // If you only want one move, you can break here
        break;
      }
    }
  }
  return JSON.stringify(x)
}

console.log(solution([[0,0,2,2], [4,4,8,4], [64,64,8,4], [16,8,64,8]]));
console.log(solution([[2,2,4,8],[8,8,64,64],[64,8,16,8],[8,8,8,8]]))
console.log(solution([[64,64,64,64],[8,8,8,8],[4,4,4,4],[2,2,2,2]]))
console.log(solution([[0,0,4,4],[4,8,4,8],[8,8,8,8],[64,8,16,8]]))
console.log(solution([[2,0,4,4],[4,4,4,4],[8,0,0,8],[0,64,64,64]]))

通过Dconf-Editor的GUI

  • 安装dconf编辑器gsettings set org.gnome.shell.extensions.dash-to-dock hot-keys false gsettings set org.gnome.shell.keybindings switch-to-application-1 [] gsettings set org.gnome.shell.keybindings switch-to-application-2 [] gsettings set org.gnome.shell.keybindings switch-to-application-3 [] gsettings set org.gnome.shell.keybindings switch-to-application-4 [] gsettings set org.gnome.shell.keybindings switch-to-application-5 [] gsettings set org.gnome.shell.keybindings switch-to-application-6 [] gsettings set org.gnome.shell.keybindings switch-to-application-7 [] gsettings set org.gnome.shell.keybindings switch-to-application-8 [] gsettings set org.gnome.shell.keybindings switch-to-application-9 []
  • 启动编辑器sudo apt get install dconf-editor
  • 移动dconf-editor,然后单击并设置“ []”(可能不正确)

制作自定义快捷方式

  • 复制下面的我的脚本中的所有文本
  • 打开终端并输入org.gnome.shell.keybindings并粘贴剪贴板内容
  • 授予可执行权限gedit ~/Tools/ywm.sh
  • SUPER 键,然后输入sudo chmod u+x '~/Tools/ywm.sh'
  • 滚动到窗口底部,单击Shortcut按钮
  • 键入这些命令(只是示例)并设置您喜欢的快捷方式
    • 对于终端,+
    • 对于Google Chrome,bash -c "bash ~/Tools/ywm.sh gnome-terminal"
    • 对于Vscode,bash -c "bash ~/Tools/ywm.sh google-chrome"
    • 对于文件浏览器,bash -c "bash ~/Tools/ywm.sh code"
    • 对于文本编辑,请bash -c "bash ~/Tools/ywm.sh nautilus"

我的脚本

bash -c "bash ~/Tools/ywm.sh gedit"