summaryrefslogtreecommitdiff
path: root/zwgc
diff options
context:
space:
mode:
authorGravatar Greg Hudson <ghudson@mit.edu>1998-05-24 00:48:03 +0000
committerGravatar Greg Hudson <ghudson@mit.edu>1998-05-24 00:48:03 +0000
commit83bd77d41e39def0ffb43560a38806fe4c010f6f (patch)
tree95fbd0f228689ef4d06ee4dbf293eaff79278b18 /zwgc
parent45547d190ead32f7bc19845a90636957734423e1 (diff)
Add a -loc flag to specify alternative auxiliary location information
instead of the display name or tty.
Diffstat (limited to 'zwgc')
-rw-r--r--zwgc/main.c15
-rw-r--r--zwgc/main.h1
-rw-r--r--zwgc/zephyr.c7
-rw-r--r--zwgc/zwgc.119
4 files changed, 33 insertions, 9 deletions
diff --git a/zwgc/main.c b/zwgc/main.c
index 4a50952..0cc5145 100644
--- a/zwgc/main.c
+++ b/zwgc/main.c
@@ -67,6 +67,12 @@ char *progname = NULL;
char *subscriptions_filename_override = NULL;
+/*
+ * location_override - <<<>>> export!
+ */
+
+char *location_override = NULL;
+
/****************************************************************************/
/* */
/* Code to deal with reading in the description file: */
@@ -147,13 +153,13 @@ void usage()
#ifdef DEBUG
fprintf(stderr, "\
zwgc: usage: zwgc [-debug] [-f <filename>] [-subfile <filename>]\n\
- [-ttymode] [-nofork] [-reenter]\n\
+ [-ttymode] [-nofork] [-reenter] [-loc text]\n\
[-default <driver>] {-disable <driver>}*\n\
[output driver options]\n");
#else
fprintf(stderr, "\
zwgc: usage: zwgc [-f <filename>] [-subfile <filename>]\n\
- [-ttymode] [-nofork] [-reenter]\n\
+ [-ttymode] [-nofork] [-reenter] [-loc text]\n\
[-default <driver>] {-disable <driver>}*\n\
[output driver options]\n");
#endif
@@ -229,6 +235,11 @@ int main(argc, argv)
dofork = 0;
} else if (string_Eq(*current, "-reenter")) {
argc--; /* just throw it away */
+ } else if (string_Eq(*current, "-loc")) {
+ argc -= 2; current++;
+ if (!*current)
+ usage();
+ location_override = *current;
} else
*(new)++ = *current;
}
diff --git a/zwgc/main.h b/zwgc/main.h
index 0af201e..ef9146e 100644
--- a/zwgc/main.h
+++ b/zwgc/main.h
@@ -21,6 +21,7 @@
extern char *progname;
extern char *subscriptions_filename_override;
+extern char *location_override;
/*
* void usage()
diff --git a/zwgc/zephyr.c b/zwgc/zephyr.c
index ded5e01..d15091b 100644
--- a/zwgc/zephyr.c
+++ b/zwgc/zephyr.c
@@ -35,6 +35,7 @@ static const char rcsid_zephyr_c[] = "$Id$";
#include "subscriptions.h"
#include "variables.h"
#include "pointer.h"
+#include "main.h"
#ifndef X_DISPLAY_MISSING
#include "X_driver.h"
#endif
@@ -141,9 +142,11 @@ void zephyr_init(notice_handler)
}
/* Set hostname and tty for locations. If we support X, use the
- * display string for the tty name. */
+ * display string for the default tty name. */
+ if (location_override)
+ tty = location_override;
#ifndef X_DISPLAY_MISSING
- if (dpy)
+ else if (dpy)
tty = DisplayString(dpy);
#endif
error_code = ZInitLocationInfo(NULL, tty);
diff --git a/zwgc/zwgc.1 b/zwgc/zwgc.1
index 379b13f..3246978 100644
--- a/zwgc/zwgc.1
+++ b/zwgc/zwgc.1
@@ -44,6 +44,8 @@ zwgc \- Zephyr Windowgram Client program
.I filename
] [ \-subfile
.I filename
+] [ \-loc
+.I text
] [ \-default
.I portname
] [ \-disable
@@ -910,11 +912,10 @@ is normally invoked from
.IR $HOME/.xsession ,
or
.I /usr/athena/lib/init/xsession
-in the foreground
-and with no arguments. When it has successfully set your location, it
-will put itself into the background (unless the \-nofork option has been
-specified). At this point it is safe to
-invoke additional zephyr commands, such as
+in the foreground. When it has successfully set your location and
+obtained subscriptions, it will put itself into the background (unless
+the \-nofork option has been specified). At this point it is safe to
+invoke additional zephyr commands, such as
.IR znol (1).
(You can also put these commands in the
.I initprogs
@@ -945,6 +946,14 @@ option is specified,
will ignore any X display and use the terminal as its primary output
device. This flag overrides any setting of the fallback variable.
.PP
+If the
+.I \-loc
+option is specified,
+.I zwgc
+will use the specified string as the tty field for the location it
+sets. This allows users to potentially specify more useful auxiliary
+information than their ttys or display names.
+.PP
The
.I \-reenter
option is provided for compatibility with the previous version of