summaryrefslogtreecommitdiff
path: root/x-on-resize.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-02-28 16:13:59 -0800
committerKeith Packard <keithp@keithp.com>2013-02-28 16:13:59 -0800
commita6c8969ab1ab47f72f0f00bd32f100c1661ffdef (patch)
tree3e96b8e741aca045b9c008e3d7957a1d40e2aeb1 /x-on-resize.c
parentd45135b4d283ce19545ef4696be4b91747ce03f8 (diff)
Add --auto switch, a shortcut for --config "xrandr --auto"
Makes it slightly easier to use. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'x-on-resize.c')
-rw-r--r--x-on-resize.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/x-on-resize.c b/x-on-resize.c
index 12f9558..a6cdd10 100644
--- a/x-on-resize.c
+++ b/x-on-resize.c
@@ -111,9 +111,9 @@ main (int argc, char **argv)
int major, minor;
XEvent ev;
XRRNotifyEvent *nev;
- char *config = NULL;
- char *resize = NULL;
- char *display = NULL;
+ const char *config = NULL;
+ const char *resize = NULL;
+ const char *display = NULL;
int c, o;
int start = 0;
XRRScreenResources *resources;
@@ -122,6 +122,7 @@ main (int argc, char **argv)
{ "config", 1, NULL, 'c' },
{ "resize", 1, NULL, 'r' },
{ "start", 0, NULL, 's' },
+ { "auto", 0, NULL, 'a' },
{ "display", 1, NULL, 'd' },
{ "help", 0, NULL, 'h' },
{ 0, 0, NULL, 0 }
@@ -138,6 +139,9 @@ main (int argc, char **argv)
case 'd':
display = optarg;
break;
+ case 'a':
+ config = "xrandr --auto";
+ break;
case 's':
start = 1;
break;