diff options
author | Simon Bertrang <simon@cvs.openbsd.org> | 2008-03-23 15:09:22 +0000 |
---|---|---|
committer | Simon Bertrang <simon@cvs.openbsd.org> | 2008-03-23 15:09:22 +0000 |
commit | d2a4422fbc8b149613fb5ec67ecc4faacafdae8f (patch) | |
tree | caaed8392cbfda508ac4e4efe4a66374833c8ac7 /app/cwm/calmwm.c | |
parent | 0f9e6db73fe4522b0314d9cc3ee39591cc0e7cb9 (diff) |
Replace the symlink configuration scheme with a simple yacc parser as
found in other places of the tree. Remove sticky and font commandline
options and add another one for alternative config locations.
Split off cwmrc(5) from cwm(1), nuke #ifdef __OpenBSD__ while there.
tested by various kind people, feedback from oga@ and okan@ - thanks!
ok oga@, jasper@, okan@
Diffstat (limited to 'app/cwm/calmwm.c')
-rw-r--r-- | app/cwm/calmwm.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/app/cwm/calmwm.c b/app/cwm/calmwm.c index 680acb4c1..123bdcc97 100644 --- a/app/cwm/calmwm.c +++ b/app/cwm/calmwm.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: calmwm.c,v 1.12 2008/03/22 15:09:45 oga Exp $ + * $Id: calmwm.c,v 1.13 2008/03/23 15:09:21 simon Exp $ */ #include "headers.h" @@ -38,8 +38,7 @@ struct client_ctx_q Clientq; int Doshape, Shape_ev; int Starting; struct conf Conf; -struct fontdesc *DefaultFont; -char *DefaultFontName; +struct fontdesc *DefaultFont = NULL; /* From TWM */ #define gray_width 2 @@ -53,23 +52,18 @@ int main(int argc, char **argv) { int ch; - int conf_flags = 0; + const char *conffile = NULL; char *display_name = NULL; - DefaultFontName = "sans-serif:pixelsize=14:bold"; - - while ((ch = getopt(argc, argv, "d:sf:")) != -1) { + while ((ch = getopt(argc, argv, "c:d:")) != -1) { switch (ch) { + case 'c': + conffile = optarg; + break; case 'd': display_name = optarg; break; - case 's': - conf_flags |= CONF_STICKY_GROUPS; - break; - case 'f': - DefaultFontName = xstrdup(optarg); - break; default: usage(); } @@ -87,8 +81,7 @@ main(int argc, char **argv) group_init(); Starting = 1; - conf_setup(&Conf); - Conf.flags |= conf_flags; + conf_setup(&Conf, conffile); client_setup(); x_setup(display_name); Starting = 0; @@ -209,7 +202,7 @@ x_setupscreen(struct screen_ctx *sc, u_int which) GCLineWidth|GCSubwindowMode, &gv); font_init(sc); - DefaultFont = font_getx(sc, DefaultFontName); + DefaultFont = font_getx(sc, Conf.DefaultFontName); /* * XXX - this should *really* be in screen_init(). ordering |