Положение окна приложения

Настройка графического интерфейса, Иксов, десктопов, оконных менеджеров и иксовых терминалов

Модератор: Модераторы разделов

Аватара пользователя
Jasha
Сообщения: 492
Статус: ##LinuxUser##
ОС: Debian

Положение окна приложения

Сообщение Jasha »

Вроде бы тут такие темы надо создавать, потому создаю тут :blush:
Юзаю XFCE. Запускаю под ним шахматы для КДЕ (Knights). Хочу, чтобы окно игры появлялось акурат посередине экрана. Самый удобный для меня способ: --geometry <geometry> sets the client geometry of the main widget - see man X for the argument format
. Тока man X у меня нету. Кто нить знает, как опцией geometry пользоваться?
Спасибо сказали:
allez
Сообщения: 2223
Статус: Не очень злой админ :-)
ОС: SuSE, CentOS, FreeBSD, Windows

Re: Положение окна приложения

Сообщение allez »

-geometry <width>x<height>+<offsetX>+<offsetY>

Например, -geometry 1000x500+200+100 заставит приложение открыться в окне размером 1000 пикселов в ширину и 500 в высоту. Левый верхний угол окна будет смещен на 200 пикселов вправо и 100 вниз по отношению к левому верхнему углу экрана.

P. S. Вот вам выдержка из man X по этому поводу:

(man X) писал(а):GEOMETRY SPECIFICATIONS
One of the advantages of using window systems instead of hardwired ter‐
minals 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. The X offset may be specified in the following ways:

+XOFF The left edge of the window is to be placed XOFF pixels in from
the left edge of the screen (i.e., the X coordinate of the win‐
dow's origin will be XOFF). XOFF may be negative, in which
case the window's left edge will be off the screen.

-XOFF The right edge of the window is to be placed XOFF pixels in
from the right edge of the screen. XOFF may be negative, in
which case the window's right edge will be off the screen.

The Y offset has similar meanings:

+YOFF The top edge of the window is to be YOFF pixels below the top
edge of the screen (i.e., the Y coordinate of the window's ori‐
gin will be YOFF). YOFF may be negative, in which case the
window's top edge will be off the screen.

-YOFF The bottom edge of the window is to be YOFF pixels above the
bottom edge of the screen. YOFF may be negative, in which case
the window's bottom edge will be off the screen.

Offsets must be given as pairs; in other words, in order to specify
either XOFF or YOFF both must be present. Windows can be placed in the
four corners of the screen using the following specifications:

+0+0 upper left hand corner.

-0+0 upper right hand corner.

-0-0 lower right hand corner.

+0-0 lower left hand corner.

In the following examples, a terminal emulator is placed in roughly the
center of the screen and a load average monitor, mailbox, and clock are
placed in the upper right hand corner:

xterm -fn 6x10 -geometry 80x24+30+200 &
xclock -geometry 48x48-0+0 &
xload -geometry 48x48-96+0 &
xbiff -geometry 48x48-48+0 &


P. P. S. Если каких-то манов у вас нет локально (что маловероятно), то их без особого труда можно найти в Интернете.
Спасибо сказали:
Аватара пользователя
Jasha
Сообщения: 492
Статус: ##LinuxUser##
ОС: Debian

Re: Положение окна приложения

Сообщение Jasha »

Спасибо, помогло.
Если бы был ман, не лез бы с вопросом, а так приходиццо...
Спасибо сказали:
allez
Сообщения: 2223
Статус: Не очень злой админ :-)
ОС: SuSE, CentOS, FreeBSD, Windows

Re: Положение окна приложения

Сообщение allez »

allez писал(а): ↑
09.12.2008 10:41
P. P. S. Если каких-то манов у вас нет локально (что маловероятно), то их без особого труда можно найти в Интернете.

http://www.opennet.ru/man.shtml?topic=X&...DA%C1%D4%D8+man
;)
Спасибо сказали:
Аватара пользователя
Rootlexx
Бывший модератор
Сообщения: 4471
Статус: GNU generation
ОС: Debian GNU/Linux

Re: Положение окна приложения

Сообщение Rootlexx »

Более того, если кто-то не знал, на форуме есть тег «man».

Код: Выделить всё

[man]X[/man]
приведёт к созданию такой ссылки: man X.
Спасибо сказали:
allez
Сообщения: 2223
Статус: Не очень злой админ :-)
ОС: SuSE, CentOS, FreeBSD, Windows

Re: Положение окна приложения

Сообщение allez »

Да, действительно не знал. Спасибо, приятный тег. :)
Спасибо сказали: