You are not logged in.

#1 2016-01-19 01:54:25

12oclocker
Member
Registered: 2016-01-18
Posts: 48

application window centering

The application window centering is driving me crazy.
When I open an application such as terminal, filemanager, geany, or whatver...
Sometimes its on the top left of the screen, sometimes the bottom right, sometimes is somewhere in the middle of the screen, it makes no sense.
How to make applications open in the middle of the screen?
I think it's an openbox issue... I tried the fix in post #6 here...
https://bbs.archlinux.org/viewtopic.php?id=165625
But upon reboot it made my tint2 bar in the center of the screen, which is obviously no good.

Last edited by 12oclocker (2016-01-19 02:01:44)

Offline

#2 2016-01-19 02:34:51

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,140
Website

Re: application window centering

These are the available options in Openbox...
http://openbox.org/wiki/Help:Configuration#Placement

In BL, the center option is set by default to "yes" in rc.xml, but openbox doesn't have an option to open every window center screen. Other window managers do, xfwm4, for instance, but if you switch it for openbox you'll lose the openbox right-click menu. There are other ways to get a root menu, though.


I don't care what you do at home. Would you care to explain?

Offline

#3 2016-01-19 03:00:16

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,654
Website

Re: application window centering

hhh wrote:

Other window managers do, xfwm4, for instance, but if you switch it for openbox you'll lose the openbox right-click menu. There are other ways to get a root menu, though.

Even if you get a menu, the pipemenus won't work without openbox.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#4 2016-01-19 03:03:21

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,140
Website

Re: application window centering

^Yes, without Openbox our bl-* stuff is crippled.


I don't care what you do at home. Would you care to explain?

Offline

#5 2016-01-19 04:29:21

nore
>2⁹
From: squirrels' nest
Registered: 2015-09-29
Posts: 537

Re: application window centering

12oclocker wrote:

But upon reboot it made my tint2 bar in the center of the screen, which is obviously no good.

  1. Find out name, class etc.

  2. Try something like

    <application name="tint2">
        <position force="no">
        <x>center</x>
        <y>-0</y>
      </position>
    </application>

(Sorry, I don't have time to actually test it right now.)
Corrected and confirmed on BunsenLabs.

Last edited by nore (2016-01-19 13:55:57)

Offline

#6 2016-01-19 06:21:45

gako
Member
Registered: 2015-10-02
Posts: 241

Re: application window centering

for terminal programs you could use geometry definitions like

x-terminal-emulator -g +0+0 -e mc
# or
x-terminal-emulator -title "Task Manager" -g -0+0 -e htop

if what nore ^ wrote doesn't work  you could always call an xdotool script.
kinda hacky feeling but works well

you can also use xwininfo, xprop for finding window information.

Offline

#7 2016-01-19 06:39:39

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,140
Website

Re: application window centering

The easiest workaround would be to install and configure devilspie to center all windows.


I don't care what you do at home. Would you care to explain?

Offline

#8 2016-01-19 07:56:46

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: application window centering

It is a much-disliked Openbox "feature" which was introduced in 3.5.something. I set my config to start windows at the mouse position, or force a placement in the <application> section of rc.xml.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#9 2016-01-19 08:33:01

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: application window centering

hhh wrote:

These are the available options in Openbox...
http://openbox.org/wiki/Help:Configuration#Placement

this.
and it's "center of available space", not center of screen.
the center=yes option was absent in openbox for a while, but has been re-introduced.
i'm not 100% sure whether debian's version has reintroduced it or not.
in any case, if you set
<center>no</center>
it will place new windows in the top left of available space (unless you choose undermouse, which i always found to be insanely annoying), and that's all there is to it.
i know, because i recently had a similar gripe with it.

Offline

#10 2016-01-19 13:54:45

nore
>2⁹
From: squirrels' nest
Registered: 2015-09-29
Posts: 537

Re: application window centering

<application class="tint2">

does not work,

<application name="tint2">

works on BunsenLabs. I edited my last post.

    <application name="*">
      <position force="yes">
        <x>center</x>
        <y>center</y>
      </position>
    </application>
    
    <application name="tint2">
      <position force="no">
        <x>center</x>
        <y>-0</y>
      </position>
    </application>

Last edited by nore (2016-01-19 14:00:54)

Offline

#11 2016-01-19 21:18:29

12oclocker
Member
Registered: 2016-01-18
Posts: 48

Re: application window centering

thanks everyone, I ended up going with nore's method...

"Preferences->OpenBox->Edit rc.xml"
//scroll to bottom and add the following Before "</applications>"...
//use "<y>-0</y>" to put your tint2 on the bottom, or "<y>0</y>" to put it on the top
<!-- BEGIN MY MOD -->
    <application name="*">
      <position force="yes">
        <x>center</x>
        <y>center</y>
      </position>
    </application>
   
    <application name="tint2">
      <position force="no">
        <x>center</x>
        <y>-0</y>
      </position>
    </application>
<!-- END MY MOD -->

Offline

#12 2016-01-19 21:48:37

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: application window centering

ohnonot wrote:

...
the center=yes option was absent in openbox for a while, but has been re-introduced.
i'm not 100% sure whether debian's version has reintroduced it or not.
....

The feature was reintroduced in Openbox 3.6, which is now in stretch/sid


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

Board footer

Powered by FluxBB