我正在使用 Ubuntu 19.04,我想为所有 9 个数字键盘数字创建快捷方式,例如Super+Num_7将活动窗口移动到左上角,Super+Num_4将活动窗口移动到左侧等。
怎么做?
答案1
带有 GNOME 桌面环境的 Ubuntu 不支持四分之一平铺(您想要的那种平铺)。
有一些 GNOME Shell 扩展提供了更高级的平铺选项,但我不确定它们是否能完全满足您的要求。最受欢迎的是:
要安装并试用它们,您必须先安装 Tweaks 并chrome-gnome-shell
运行:
sudo apt install gnome-tweaks chrome-gnome-shell
然后点击上面的扩展链接,将开关切换到在并点击安装在弹出对话框中。
我也发现了这个Python 脚本由此Stack Overflow 问题。我还没有尝试过,但看起来它可以工作。我尝试后会更新我的答案。
您还可以尝试其他 Ubuntu 版本,例如 Xubuntu、Kubuntu 或 Ubuntu-MATE,它们都提供了您想要执行的选项(Xubuntu 默认启用了您需要的快捷方式;我不确定其他环境)。
答案2
有带键绑定的内置函数wm
。
要查看这些功能,请使用gsettings
命令或使用 dconf-editor 工具(安装dconf-editor
运行sudo apt install dconf-editor
)
gsettings 命令:
gsettings list-recursively | grep wm.keybindings | grep move-to
pratap@pratap:~$ gsettings list-recursively | grep wm.keybindings | grep move-to
org.gnome.desktop.wm.keybindings move-to-workspace-7 @as []
org.gnome.desktop.wm.keybindings move-to-workspace-8 @as []
org.gnome.desktop.wm.keybindings move-to-workspace-9 @as []
org.gnome.desktop.wm.keybindings move-to-monitor-left ['<Super>KP_4']
org.gnome.desktop.wm.keybindings move-to-workspace-5 @as []
org.gnome.desktop.wm.keybindings move-to-workspace-6 @as []
org.gnome.desktop.wm.keybindings move-to-workspace-10 @as []
org.gnome.desktop.wm.keybindings move-to-workspace-11 @as []
org.gnome.desktop.wm.keybindings move-to-workspace-12 @as []
org.gnome.desktop.wm.keybindings move-to-center @as []
org.gnome.desktop.wm.keybindings move-to-corner-ne @as []
org.gnome.desktop.wm.keybindings move-to-side-e @as []
org.gnome.desktop.wm.keybindings move-to-workspace-right ['<Control><Shift><Alt>Right']
org.gnome.desktop.wm.keybindings move-to-workspace-up ['<Super><Shift>Page_Up', '<Control><Shift><Alt>Up']
org.gnome.desktop.wm.keybindings move-to-side-n @as []
org.gnome.desktop.wm.keybindings move-to-side-s @as []
org.gnome.desktop.wm.keybindings move-to-side-w ['<Super>KP_4']
org.gnome.desktop.wm.keybindings move-to-corner-nw ['<super>KP_7']
org.gnome.desktop.wm.keybindings move-to-monitor-down ['<Super><Shift>Down']
org.gnome.desktop.wm.keybindings move-to-workspace-left ['<Control><Shift><Alt>Left']
org.gnome.desktop.wm.keybindings move-to-corner-se @as []
org.gnome.desktop.wm.keybindings move-to-monitor-right ['<Super><Shift>Right']
org.gnome.desktop.wm.keybindings move-to-workspace-last ['<Super><Shift>End']
org.gnome.desktop.wm.keybindings move-to-monitor-up ['<Super><Shift>Up']
org.gnome.desktop.wm.keybindings move-to-corner-sw @as []
org.gnome.desktop.wm.keybindings move-to-workspace-down ['<Super><Shift>Page_Down', '<Control><Shift><Alt>Down']
org.gnome.desktop.wm.keybindings move-to-workspace-1 ['<Super><Shift>Home']
org.gnome.desktop.wm.keybindings move-to-workspace-2 @as []
org.gnome.desktop.wm.keybindings move-to-workspace-3 @as []
org.gnome.desktop.wm.keybindings move-to-workspace-4 @as []
pratap@pratap:~$
您可以使用此语法['<Super>KP_4']
来分配快捷方式Super+KP_4
gsettings set org.gnome.desktop.wm.keybindings move-to-side-w "['<Super>KP_4']"
或者使用 dconf-editor 的简单 GUI 方式