如何在KDE Plasma中启用HUD以搜索菜单项?

我曾经是Unity用户,当Ubuntu还有Unity桌面环境的时候。我喜欢按下alt键后,能够得到一个用于在应用程序菜单栏中搜索的搜索栏的功能。这个功能被称为HUD(Head Up Display)。我在我的KDE安装下使用全局菜单小部件,我想知道是否有一种方法可以像在Unity中那样在菜单中进行搜索。 谢谢你的帮助。目前,我唯一的方法是通过sudo apt install unity -y来安装Unity,但这不是一个可行的选择。

左边的Windows(超级)键在GNOME中打开一个搜索栏。 - graham
我实际上是在谈论Plasma,以及在菜单中进行搜索。Gnome的搜索功能并不会在菜单中进行搜索。无论如何,非常感谢您参与这个问题。 - Andrew
1Ubuntu Mate 版本已经加入了这个功能(作为一个选项)。然而,确实,Plasma 也应该支持 HUD 功能。 - vanadium
1个回答

enter image description here

您需要启用全局菜单小部件,或在标题栏中添加应用程序菜单按钮。

  • 要安装依赖项,请运行
sudo apt install rofi python3 python3-dbus python3-setproctitle python3-xlib gir1.2-gtk-3.0
sudo apt install appmenu-gtk2-module appmenu-gtk3-module
  • 下载源代码:
git clone https://github.com/Zren/plasma-hud
cd plasma-hud

使用以下命令安装文件。
sudo mkdir -p /usr/lib/plasma-hud
sudo cp usr/lib/plasma-hud/plasma-hud /usr/lib/plasma-hud/
sudo mkdir -p /etc/xdg/autostart
sudo cp etc/xdg/autostart/plasma-hud.desktop /etc/xdg/autostart/
  • 退出并重新登录。

  • 依次运行以下两个命令,将 Alt 键绑定到 HUD。

kwriteconfig5 --file ~/.config/kwinrc --group ModifierOnlyShortcuts --key Alt "com.github.zren.PlasmaHUD,/PlasmaHUD,com.github.zren.PlasmaHUD,toggleHUD"
qdbus org.kde.KWin /KWin reconfigure

这个答案是基于this项目的README。

经过测试,在Kubuntu 19.10中完美运行,需要注意的是appmenu-qt软件包不可用,但似乎并不需要。 - castaway
@castaway 太好了。appmenu-qt在18.04版本中是可用的。我会打开一个GitHub问题,让开发人员知道。 - Archisman Panigrahi