You are not logged in.

#1 2008-01-30 09:50:27

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Obtain windows position & dimensions

hi! i want to add to my fluxbox startup 5 terminals open but at specific place, and 1 at a specific dimension, is there a way to know the exact position and size of a window so i can yust add the parameters to the startup fluxbox file?

Thanks!


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#2 2008-01-30 10:14:48

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: Obtain windows position & dimensions

xprop


1000

Offline

#3 2008-01-30 10:28:39

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: Obtain windows position & dimensions

xwininfo, it is in xorg-utils

Offline

#4 2008-01-30 21:24:44

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: Obtain windows position & dimensions

Thanks! but how i can achieve that at the start of fluxbox startup file or my ~/.xinitrc i have various aterm's in the right position? i mean, in the place of the desktop i want and not randomly?


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#5 2008-01-30 22:03:33

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: Obtain windows position & dimensions

leo2501 wrote:

Thanks! but how i can achieve that at the start of fluxbox startup file or my ~/.xinitrc i have various aterm's in the right position? i mean, in the place of the desktop i want and not randomly?

http://www.xfree86.org/current/X.7.html wrote:

One of the advantages of using window systems instead of hardwired terminals is that applications don't have to be restricted to a particular size or location on the screen. Although the layout of windows on a display is controlled by the window manager that the user is running (described below), most X programs accept a command line argument of the form -geometry WIDTHxHEIGHT+XOFF+YOFF (where WIDTH, HEIGHT, XOFF, and YOFF are numbers) for specifying a preferred size and location for this application's main window.

The WIDTH and HEIGHT parts of the geometry specification are usually measured in either pixels or characters, depending on the application. The XOFF and YOFF parts are measured in pixels and are used to specify the distance of the window from the left or right and top and bottom edges of the screen, respectively. Both types of offsets are measured from the indicated edge of the screen to the corresponding edge of the window.

For a more complete description read that man page.

so you can start aterm with a specific size on a specific location using

aterm -geometry WIDTHxHEIGHT+XOFF+YOFF

ps. I think both WIDTH and HEIGHT are measured in characters and not in pixels so it can be a bit trial and error to find the location you want.

Offline

#6 2008-01-30 23:15:05

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: Obtain windows position & dimensions

well neither xprop or xwininfo give me the right position of my windows... dont know why... i use fluxbox and like to have a lot of aterms with no borders for different tasks, only i want is no need to assembly them every time i restart my pc tongue


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#7 2008-01-30 23:20:51

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: Obtain windows position & dimensions

leo2501 wrote:

well neither xprop or xwininfo give me the right position of my windows... dont know why... i use fluxbox and like to have a lot of aterms with no borders for different tasks, only i want is no need to assembly them every time i restart my pc tongue

You need to run xwininfo from the cli because that's where the information is printed. If the information you need is not there, tell me what is printed after you have clicked a window.

For the other thing, I just told you how you can start aterm using the -geometry option.

Offline

#8 2008-01-31 09:48:35

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: Obtain windows position & dimensions

when i click a window that is near the bottom edge, i get:

[aleyscha@aleyscha ~]$ xwininfo

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 0x1600002 "aterm"

  Absolute upper-left X:  72
  Absolute upper-left Y:  680
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 564
  Height: 340
  Depth: 24
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +72+680  -1044+680  -1044-30  +72-30
  -geometry 80x24+72-30

but if i run my aterm with the -g 80x24+72-30 i dont get the app in the same position neutral strange to me... same with a lot more, and with another app if i change manually some vamues og the -g option, i get the same window position neutral


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#9 2008-01-31 10:54:45

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: Obtain windows position & dimensions

leo2501 wrote:

but if i run my aterm with the -g 80x24+72-30 i dont get the app in the same position neutral strange to me...

yes strange indeed neutral

what happends when you do start multiple aterm instances from within your wm session with that command:

aterm -g 80x24+72-30

are they both on the same position ?

and are they on the same position if you start it from .xinitrc ?

Is it wm specific or does it also happen in other window managers, say twm ?

Offline

#10 2008-01-31 16:25:03

Zer0
Member
From: Windsor, ON, Canada
Registered: 2006-08-25
Posts: 299

Re: Obtain windows position & dimensions

I think your going to have to set the rules for window placement in your WM.

Absolute upper-left X:  72
Absolute upper-left Y:  680

would be the position rules to use, I don't use fluxbox but in compiz this works for me..

aterms geometry setting probably only sets the window size and not placement.

Offline

#11 2008-01-31 21:31:16

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Obtain windows position & dimensions

Have a look at devilspie, it can position and change windows depending on criteria set in a file

Offline

#12 2008-01-31 22:27:26

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: Obtain windows position & dimensions

what happends when you do start multiple aterm instances from within your wm session with that command:
aterm -g 80x24+72-30

Yes, they open in the exact position, one above another...

and are they on the same position if you start it from .xinitrc ?
Is it wm specific or does it also happen in other window managers, say twm ?

i really don't try that, i supose that if inside the wm they behave like that, if not wm is loaded windows manage the same... mmm can be wrong actually, so i gonna try that, the thing is that i really want that some cli apps like mc and elinks open in determinated space and specific size, and dont want they open when computer starts...

I think your going to have to set the rules for window placement in your WM.

mmm... i check fluxbox config to see if there is such a config... but there is none

i read about devilspie and looks amazing but it seems to work with one app at the time, i mean if i open 4 identical apps all of them will behave the same (correct me if im wrong)

I should have probably posted this, my roomate found a solution. If you are using compiz then you need to do the following command:

(set_viewport 2)

not set_workspace. Here is a little devilspie file that I have:

(begin
(if
(is (application_name) "Thunderbird")
(begin
(set_viewport 2)
(maximize)
)
)
(if
(is (window_name) "Buddy List")
(begin
(skip_tasklist)
(undecorate)
(opacity 60)
(below)
(stick)
)
)
)

Works fantastic. I have my buddy list basically embedded into my desktop, somewhat transparent and underneath all windows (as well as pinned to all viewpoints). Then I just have Thunderbird maximize on the second viewpoint. Hope that helps

Thanks for all the responses! really big_smile


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

Board footer

Powered by FluxBB