如何在 Openbox 中运行命令?

Cao*_*iếu 0 openbox lxde

我安装了新的,openbox但我不知道如何为应用程序或目录执行命令。

如果不知道命令,我无法添加任何应用程序?

Rav*_*ina 5

首先安装 openbox 后,将 openbox 的基本配置复制到您自己的主目录以进行自定义:

mkdir -p ~/.config/openbox
cp /etc/xdg/openbox/* ~/.config/openbox/
Run Code Online (Sandbox Code Playgroud)

现在您有了一个可以在其上构建的基本配置。


使用命令:

安装gmrundmenusuckless-tools包。

sudo apt install gmrun
Run Code Online (Sandbox Code Playgroud)

现在~/.config/openbox/rc.xml使用编辑器打开文件:

nano ~/.config/openbox/rc.xml
Run Code Online (Sandbox Code Playgroud)

搜索“keybind”并添加如下内容:

<keybind key="A-F2">
   <action name="Execute">
     <command>gmrun</command>
   </action>
</keybind>
Run Code Online (Sandbox Code Playgroud)

到此文件,在运行之后openbox --reconfigure,现在使用Alt+F2提示要求您输入命令:

在此处输入图片说明

然后你可以输入你想要的命令并按下enter运行它。


使用图形用户界面

我更喜欢的一个程序是xfce4-appfinder,使用以下方法安装它:

sudo apt install xfce4-appfinder
Run Code Online (Sandbox Code Playgroud)

现在像以前一样为命令添加一个键绑定xfce4-appfinder,例如:

<keybind key="A-F3">
   <action name="Execute">
     <command>xfce4-appfinder</command>
   </action>
</keybind>
Run Code Online (Sandbox Code Playgroud)

每次你按下Alt+F3一个像这样的窗口就会打开:

在此处输入图片说明

您可以按类别浏览安装在您机器上的程序,甚至可以搜索它们的名称。

使用右键菜单

打开这个文件:

nano ~/.config/openbox/menu.xml
Run Code Online (Sandbox Code Playgroud)

将这些行添加到其中:

<menu id="/Debian" label="">
        <item label="New Item">
                <action name="Execute">
                        <execute>command</execute>
                </action>
        </item>
</menu>
Run Code Online (Sandbox Code Playgroud)

并运行:

openbox --reconfigure
Run Code Online (Sandbox Code Playgroud)

现在,每次右键单击右键菜单中的任意位置时,都会有一个名为“Debian”的项目,其中包含 Ubuntu 上所有已安装的应用程序。