From a901d331caf577af17644a00bd0afe482d7b8935 Mon Sep 17 00:00:00 2001 From: jasper Date: Mon, 6 Dec 2010 06:49:47 +0000 Subject: [PATCH] - add a flag to specify the display to start xtsscale on. ok matthieu@ --- app/xtsscale/xtsscale.1 | 7 +++++-- app/xtsscale/xtsscale.c | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/xtsscale/xtsscale.1 b/app/xtsscale/xtsscale.1 index c61c8e838..349877648 100644 --- a/app/xtsscale/xtsscale.1 +++ b/app/xtsscale/xtsscale.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: xtsscale.1,v 1.10 2010/09/14 06:20:55 jasper Exp $ +.\" $OpenBSD: xtsscale.1,v 1.11 2010/12/06 06:49:47 jasper Exp $ .\" .\" Copyright (c) 2007 Robert Nagy .\" Copyright (c) 2009 Matthieu Herrb @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE .\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: September 14 2010 $ +.Dd $Mdocdate: December 6 2010 $ .Dt XTSSCALE 1 .Os .Sh NAME @@ -33,6 +33,7 @@ .Sh SYNOPSIS .Nm xtsscale .Bk -words +.Op Fl D Ar display .Op Fl d Ar device .Op Fl o Ar output .Op Fl v @@ -44,6 +45,8 @@ will make the pointer act at the indicated location on the screen. .Pp The following options can be used: .Bl -tag -width Ds +.It Fl D Ar display +specify the X11 display to use. .It Fl d Ar device defines the name or numerical identifier of the X Input extension device to calibrate. diff --git a/app/xtsscale/xtsscale.c b/app/xtsscale/xtsscale.c index fcc441420..e06c14a9f 100644 --- a/app/xtsscale/xtsscale.c +++ b/app/xtsscale/xtsscale.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xtsscale.c,v 1.15 2010/03/23 20:27:42 matthieu Exp $ */ +/* $OpenBSD: xtsscale.c,v 1.16 2010/12/06 06:49:47 jasper Exp $ */ /* * Copyright (c) 2007 Robert Nagy * Copyright (c) 2009 Matthieu Herrb @@ -524,7 +524,7 @@ get_xrandr_config(Display *dpy, Window root, char *name, void __dead usage(void) { - fprintf(stderr, "usage: xtsscale [-d device][-o output]\n"); + fprintf(stderr, "usage: xtsscale [-D display][-d device][-o output]\n"); exit(2); } @@ -549,8 +549,11 @@ main(int argc, char *argv[], char *env[]) int cpx[] = { 0, 0, 1, 1, 1 }; int cpy[] = { 0, 1, 0, 0, 1 }; - while ((ch = getopt(argc, argv, "d:o:v")) != -1) { + while ((ch = getopt(argc, argv, "D:d:o:v")) != -1) { switch (ch) { + case 'D': + display_name = optarg; + break; case 'd': device_name = optarg; break;