如何让openbox只在特定区域显示窗口

如何让openbox只在特定区域显示窗口

我的显示器的原始分辨率为 1024X600。我将其设置为1024X724,因为有些窗口无法以原始分辨率显示。我必须使用鼠标进行平移。但对于大多数窗口来说,本机分辨率就足够了。

1 有没有办法设置所有窗口都显示在显示屏的上部 1024X600 区域?

2 对于某些应用程序,我想指定确切的位置和大小。我在 emacs 上尝试过这个,位置和大小都不起作用。有任何想法吗?

<application name="emacs24" class="Emacs" type="normal">
<position force="yes">
    <x>0</x>
    <y>0</y>
</position>
    <height>600</height>
    <width>1024</width>
<decor>no</decor>
<maximized>no</maximized>
</application>

obxprop 的输出是:

_OB_APP_TYPE(UTF8_STRING) = "normal"
_OB_APP_CLASS(UTF8_STRING) = "Emacs"
_OB_APP_NAME(UTF8_STRING) = "emacs24"

答案1

尝试

<application name="emacs*" class="Emacs*" type="normal">
    <position force="yes">
        <x>0</x>
        <y>0</y>
    </position>
    <size>
        <height>600</height>
        <width>1024</width>
    </size>
    <decor>no</decor>
    <maximized>no</maximized>
</application>

<height>需要<width>位于<size>标签中。

来自Openbox的示例配置

<position force="no">
  # the position is only used if both an x and y coordinate are provided
  # (and not set to 'default')
  # when force is "yes", then the window will be placed here even if it
  # says you want it placed elsewhere.  this is to override buggy
  # applications who refuse to behave
  <x>center</x>
  # a number like 50, or 'center' to center on screen. use a negative number
  # to start from the right (or bottom for <y>), ie -50 is 50 pixels from
  # the right edge (or bottom). use 'default' to specify using value
  # provided by the application, or chosen by openbox, instead.
  <y>200</y>
  <monitor>1</monitor>
  # specifies the monitor in a xinerama setup.
  # 1 is the first head, or 'mouse' for wherever the mouse is
</position>

<size>
  # the size to make the window.
  <width>20</width>
  # a number like 20, or 'default' to use the size given by the application.
  # you can use fractions such as 1/2 or percentages such as 75% in which
  # case the value is relative to the size of the monitor that the window
  # appears on.
  <height>30%</height>
</size>

相关内容