Release 1.6.0.
[xtoys] / xscsize.1
CommitLineData
b6eb57e6 1.\" -*-nroff-*-
ec19d7af 2.TH xscsize 1 "15 November 1998" "Straylight/Edgeware" "xtoys"
90b2c5d4 3.SH NAME
4xscsize \- return size of an X display to a shell script
5.SH SYNOPSIS
6.B xscsize
243654c4 7.RB [ \-bcmx ]
90b2c5d4 8.RB [ \-d
9.IR display ]
10.SH DESCRIPTION
11The
12.B xscsize
13program interrogates an X display and writes the size of the root
14window to standard output in the form of a shell variable assignment
15statement. The dimensions are returned in the
16.B XWIDTH
17and
18.B XHEIGHT
19variables.
20.PP
243654c4
MW
21With the
22.B \-m
23option (see below),
24.B xscsize
25instead reports the geometry of the individual monitors (CRTCs) of a
26(possibly) multihead display.
27.PP
90b2c5d4 28Command line options can be used to force output in either Bourne or C
29shell syntax. In the absence of any explicit instructions,
30.B xscsize
31looks at the
32.B SHELL
33environment variable to help make its mind up.
34.PP
35Typical use would be something like
36.RS 5
37.ft B
38.nf
39eval `xscsize`
40.ft R
41.fi
e571b0f1 42.SS Options
90b2c5d4 43.TP 5
f3b35b6b 44.BI "\-d, \-\-display " display
45Choose which display to connect to.
46.TP 5
47.B \-b, --bourne-shell
90b2c5d4 48Output the assignments in Bourne shell syntax (usable by Bourne,
49POSIX, Korn, Z and Bourne Again shells).
50.TP 5
f3b35b6b 51.B \-c, --c-shell
90b2c5d4 52Output the assignments in C shell syntax (usable by C and Terminal C
53shells).
54.TP 5
243654c4
MW
55.B \-m, \-\-multiscreen
56Output geometry information about the individual monitors of a
57(possibly) multihead display, rather than the overall size of the root
58window. This sets
59.B XNSCR
60to the number of monitors, and
61.BI XSCR n _X \fR,
62.BI XSCR n _Y \fR,
63.BI XSCR n _WIDTH \fR,
64and
65.BI XSCR n _HEIGHT \fR
66to the
67.IR x -
68and
69.IR y -coordinates
70of the pixel shown in the top-left of monitor
71.I n
72(starting from zero), and the width and height of monitor
73.I n
74in pixels. The monitors will be sorted in order of increasing
75.IR y -coordinate
76(i.e., top to bottom), with monitors with equal
77.IR y -coordinates
78sorted in order of increasing
79.IR x -coordinate
80(i.e., left to right). Usually, then, the first monitor will be at
81(0, 0).
82.IP
83This requires that support libraries for the X RANDR extension were
84available when
85.B xscsize
86was compiled, and that the display actually implements at least version
871.2 of the RANDR extension. If not,
88.B xscsize
89will still accept the
90.B \-m
91option, and produce appropriately formatted output, but will assume that
92there is exactly one monitor, and that it shows the entire root window.
93.TP 5
f3b35b6b 94.B \-x, --export
90b2c5d4 95Output a variable export command, so that the screen size is inherited
96by child processes. The default is to just set local shell variables.
97.SH ENVIRONMENT
98.TP
99.B XWIDTH
243654c4
MW
100Set to the width of the display in pixels (not in
101.B \-m
102mode).
c5f8baff 103.TP
90b2c5d4 104.B XHEIGHT
243654c4
MW
105Set to the height of the display in pixels (not in
106.B \-m
107mode).
108.TP
109.B XNSCR
110The number of monitors attached to the display (only in
111.B \-m
112mode).
113.TP
114.BI XSCR n _X
115The
116.I x -coordinate
117of the top-left pixel shown on monitor number
118.I n
119counting from zero (only in
120.B \-m
121mode).
122.TP
123.BI XSCR n _Y
124The
125.I y -coordinate
126of the top-left pixel shown on monitor number
127.I n
128counting from zero (only in
129.B \-m
130mode).
131.TP
132.BI XSCR n _WIDTH
133The width, in pixels, of the portion of the root window shown on monitor
134number
135.I n
136counting from zero (only in
137.B \-m
138mode).
139.TP
140.BI XSCR n _HEIGHT
141The height, in pixels, of the portion of the root window shown on monitor
142number
143.I n
144counting from zero (only in
145.B \-m
146mode).
c5f8baff 147.TP
90b2c5d4 148.B SHELL
149Used to decide the nature of the calling shell. If absent, a Bourne
150shell is assumed.
90b2c5d4 151.SH BUGS
152Hopefully none.
f6795c17
MW
153.SH AUTHOR
154Mark Wooding (mdw@distorted.org.uk).