3

While setting up a configuration for a live Lubuntu, I need to launch (after booting, on startup) a terminal (lxterminal preferred) window in the left half of the screen, and an editor (gedit preferred) window in the right half. After playing with xdpyinfo to get the screen size, and the geometry of some commands (like xterm), the parametrization seems puzzling (actually, I did not succeed). On the other hand xdotool would do it by emulating Super+Right/Left hotkeys, but that might interfere with the user clicking here or there.

Is there a simple way to launch these two applications in the two halves of the screen?

1 Answers1

2

This question focuses on Lubuntu, which comes with openbox included in its latest version (14.04.5). As pointed out in the comments, by configuring the ~/.config/openbox/lubuntu-rc.xml file, you can affect the applications included in the ~/.config/autostart, that are run on startup. The following lines added to the <applications> section will place the lxterminal window on the left half, and the gedit window on the right half.

<!-- Allocate 'lxterminal' in the left half-->
<application name="x-terminal-emulator">
  <position>
    <x>0</x>
    <y>0</y>
  </position>
  <size>
    <width>50%</width>
  </size>
  <maximized>Vertical</maximized>
</application>

<!-- Allocate 'gedit' in the right half-->
<application name="gedit">
  <position>
    <x>-0</x>
    <y>0</y>
  </position>
  <size>
    <width>50%</width>
  </size>
  <maximized>Vertical</maximized>
</application>

To learn more follow this link.

Update: Regarding how to make it fit to exactly 50% of the screen, it's been posted in the comments (edited):

lxterminal, like some other terminals, uses characters (in width) and rows for height!

In the rc.xml (keybind section), you can Super+T for

sh -c "wmctrl -xa LXTerminal || lxterminal --geometry=84x44 2&gt;/dev/null"

Then, in the applications section, you write:

<application class="Lxterminal" name="lxterminal">
  <position force="yes">
    <x>-0</x> <y>0</y>
  </position>
  <decor>no</decor>
</application>.

But you have to get the values for lxterminal by trial and error for the screen with the particular chosen font type and font size.