关于linux:从openbox了解Linux桌面相关知识

6次阅读

共计 17394 个字符,预计需要花费 44 分钟才能阅读完成。

OpenBox 是什么?

Openbox 是运行于搭载 X11 的 GNU/Linux 上的笨重窗口管理器,Openbox 以 GPL 协定形式凋谢源代码,是收费自由软件。Openbox 基于 Blackbox,后者被认为原始窗口管理器之一(即代码自有)。

总言之:openbox 是窗口管理器

如果不必窗口管理器,会怎么样?

       如果 linux 下,没有窗口管理器,程序也能失常运行。

       但显著的变动,就是没有“标题栏”,程序也不能用鼠标进行拖动。

        还有显著的变动,按“Start+D”也不能返回到桌面了

由此可见,这些都跟窗口管理器无关,而不是你本人程序控制的。

或换句话,如果你感觉“标题栏”不合乎你的程序格调,并不是通过程序自身代码批改,而是通过配置窗口管理器的参数去配置

实际上,咱们能够演绎总结下:

你的程序显示界面

       UI 库(像 qt)

窗口管理器(像 openbox)

       视窗零碎(像 x11)

       硬件驱动

如下图:

openbox 有哪些长处?也就是,咱们什么时候应该用

  1. 速度十分快,资源占用极少。(适宜嵌入式,也就意味着可能存在一些考虑不周的状况)
  2. 可高度定制化,可能对应用程序加以灵便管制。(配置灵便,确实挺好,而且很好了解)
  3. 可能绑定键盘和鼠标。比方,你能够为程序设定启动快捷键,也能够为最小 / 大化窗口设置热键。对于鼠标,同样如此。
  4. 具备主动启动脚本,可能随机主动启动各种程序。
  5. 主题资源丰盛,与 *box 类视觉款式兼容。Openbox 的外观是简洁而不简略。
  6. 反对会话,可深刻 GNOME、KDE、Xfce 等桌面环境应用。换句话说,Openbox 可代替这些桌面环境中默认的窗口管理器,而其余桌面组件仍旧放弃原样。

另外,实质上源码也比拟少,如果呈现一些问题,也能够通过批改源码的形式,也会容易一些

好了,openbox 介绍也差不多。咱们来理解下,openbox 精髓局部,配置

配置文件在  

/etc/xdg/openbox/
有几个 xml
能够看下

menu.xml 

  1. 首先,让咱们来创立一个一级菜单。要定义一个菜单,咱们须要应用 <menu> 标签。该标签具备 id、label、以及 execute 属性:

    • id:每一个菜单我的项目都必须指定一个惟一的 id,以用来辨别其余菜单我的项目。
    • label:用来形容一个菜单的名称。
    • execute:执行一个命令,罕用于创立动静菜单。

    例如,咱们能够将 Openbox 的 Root 菜单定义如下:<menu id="root-menu" label="Openbox Root Menu"> ... </menu>

    如果一个菜单中没有任何我的项目,我想是不能称其为真正的菜单吧。所以,咱们还须要为菜单创立具体的菜单我的项目。要定义菜单我的项目,咱们能够应用 <item> 标签。与 <menu> 标签一样,<item> 标签也具备形容菜单项目名称的 label 属性。咱们试着扩大下面的例子:

    <menu id="root-menu" label="Openbox Root Menu">
    <item label="URxvt">
    ...
    </item>
    ...
    </menu> 
    

    当初,咱们曾经有了一个名为 URxvt 的菜单我的项目。依据该名称的命名初衷,咱们当然心愿通过该菜单我的项目可能启动 URxvt 终端程序。要实现这个工作,咱们须要应用 <action> 标签。该标签次要用来执行一个操作,比方启动程序。<action> 标签具备 name 属性。咱们持续扩大先前的例子:

    <menu id="root-menu" label="Openbox Root Menu">
    <item label="URxvt">
    <action name="Execute">
    ...
    </action>
    </item>
    ...
    </menu> 
    

    该例中 name 属性曾经蕴含了“Execute”值,其作用是启动一个程序。

    我想,你曾经猜到接下来咱们须要做什么了。要启动程序,没有具体的命令是不行的。这能够通过 <command> 标签来实现。咱们仍以后面的例子来阐明:

    <menu id="root-menu" label="Openbox Root Menu">
    <item label="URxvt">
    <action name="Execute">
    <command>urxvt</command>
    </action>
    </item>
    ...
    </menu> 
    

    值得一提的是,命令能够附带门路或选项参数。

  2. 几个非凡的菜单我的项目

    在此,咱们介绍几个较为非凡的菜单我的项目:

    • 分隔线:能够应用 <separator> 标签在菜单我的项目间绘制一条分隔线。<separator> 标签同样具备 label 属性。须要留神的是,因为 <separator> 标签没有具体的内容,所以在敞开该标签时,应照上面的形式进行:

      <separator />

      这是另一个例子,蕴含 label 属性:

      <separator label=”tools” />

    • 重新配置 Openbox:应用该菜单项目标益处是,当你对 Openbox 的配置文件进行批改后,不用登记零碎便可即时失效。该菜单我的项目定义如下:

      <item label=”Reconfigure”>
      <action name=”Reconfigure” />
      </item>

      留神,这里 <action> 标签的敞开形式与 <separator> 一样。

    • 重新启动 Openbox:

      <item label=”Restart”>
      <action name=”Restart” />
      </item>

    • 退出 Openbox:

      <item label=”Exit”>
      <action name=”Exit” />
      </item>

    • 登记会话:

      <item label=”Session Logout”>
      <action name=”SessionLogout” />
      </item>

      留神,须要启动带会话反对的 Openbox 才无效。

rc.xml

<keybind key=”W-d”>
<action name=”ToggleShowDesktop”/>
</keybind>
b. rc.xml 中的”截屏”快捷键, 截取以后窗口, ctrl+Print Screen

<keybind key=”C-Print”>
<action name=”Execute”>
<command>scrot -s“/home/allblue/pictures/scrot/cut-%m.%d-%H%M%S.png”</command>
</action>
</keybind>
全屏载取, Print Screen

<keybind key=”Print”>
<action name=”Execute”>
<command>scrot“/home/allblue/pictures/scrot/screen-%m.%d-%H%M%S.png”</command>
</action>
</keybind>
c. rc.xml 多媒体快捷键设置
音量放大

<keybind key=”XF86AudioRaiseVolume”>
<action name=”Execute”>
<command>amixer set Master 5%+ unmute</command>
</action>
</keybind>
静音

<keybind key=”XF86AudioMute”>
<action name=”Execute”>
<command>amixer set Master toggle</command>
</action>
</keybind>
关上主页

<keybind key=”XF86HomePage”>
<action name=”Execute”>
<command>firefox</command>
</action>
</keybind>
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…
http://github.com/threebb10/w…
https://github.com/threebb10/…
https://www.github.com/threeb…

正文完
 0