Linux

如何只在特定區域製作openbox顯示視窗

  • October 8, 2015

我有一個原始解析度為 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"

嘗試

<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>

引用自:https://unix.stackexchange.com/questions/232868