smz*_*smz 7 keyboard keyboard-layout shortcut-keys unity compiz
我已经使用 mini ISO 安装了 Ubuntu 18.04 和 Unity。所以我没有在 Unity 中安装 GNOME。我的问题是键盘快捷键(例如,启动终端或在键盘布局之间切换)不起作用。网上搜索,有人建议增加sleep 2
发射前compiz
在/usr/lib/systemd/user/unity7.service
。这工作过一次,但在我重新启动后它不再工作了。也有人建议切换Commands
在CompizConfig Settings Manager
。这有效,但我每次注销时都必须重做。有没有永久的解决方案?这真的很烦人。
更新:显然,根据此链接,这是一个错误。
1mi*_*1mi 10
编辑/tldr:
sudo add-apt-repository ppa:unity7maintainers/unity7-desktop
sudo apt-get update
reboot
Run Code Online (Sandbox Code Playgroud)
以下脚本自动切换命令插件:
#!/bin/bash
export DISPLAY=:0
activeplugins=$(dconf read /org/compiz/profiles/unity/plugins/core/active-plugins)
found=$(echo "$activeplugins" | grep commands)
echo "$found"
if [ -z "$found" ] ; then
activeplugins=$(echo "$activeplugins" | sed -r "s/animation', /animation', 'commands', /")
else
activeplugins=$(echo "$activeplugins" | sed -r "s/'commands', //" | sed -r "s/, 'commands'//")
fi
echo "$activeplugins"
dconf write /org/compiz/profiles/unity/plugins/core/active-plugins "$activeplugins"
Run Code Online (Sandbox Code Playgroud)
您可以将此脚本添加到您的启动应用程序以在登录时自动执行。但是,如果您锁定屏幕然后将其解锁,您的自定义键盘快捷键将无法再次使用。
要解决此问题,您必须按照此处所述侦听锁定/解锁事件并将此脚本添加到该脚本的解锁部分,例如echo "Screen unlocked"
另请注意,活动插件的顺序很重要:我在为我启用的“动画”之后插入了“命令”插件。如果没有为您启用“动画”,则必须在“命令”处于其通常位置时将其插入到第一个活动插件之后。