From da869fadd0aa4ecd0be5ee0c4576d8160cb9f4b4 Mon Sep 17 00:00:00 2001 From: Jackson Taylor Date: Sat, 18 Jun 2022 21:47:42 -0400 Subject: Add cmd-customize patch --- dwm.1 | 65 +++++++++++- dwm.c | 37 ++++++- patches/dwm-cmdcustomize-20180504-3bd8466.diff | 139 +++++++++++++++++++++++++ 3 files changed, 236 insertions(+), 5 deletions(-) create mode 100644 patches/dwm-cmdcustomize-20180504-3bd8466.diff diff --git a/dwm.1 b/dwm.1 index 3d310acc..97d958e4 100644 --- a/dwm.1 +++ b/dwm.1 @@ -3,7 +3,27 @@ dwm \- dynamic window manager .SH SYNOPSIS .B dwm -.RB [ \-v ] +.RB [ \-vh ] +.RB [ \-fn +.IR font ] +.RB [ \-nb +.IR color ] +.RB [ \-nf +.IR color ] +.RB [ \-sb +.IR color ] +.RB [ \-sf +.IR color ] +.RB [ \-df +.IR font ] +.RB [ \-dnb +.IR color ] +.RB [ \-dnf +.IR color ] +.RB [ \-dsb +.IR color ] +.RB [ \-dsf +.IR color ] .SH DESCRIPTION dwm is a dynamic window manager for X. It manages windows in tiled, monocle and floating layouts. Either layout can be applied dynamically, optimising the @@ -34,6 +54,49 @@ dwm draws a small border around windows to indicate the focus state. .TP .B \-v prints version information to stderr, then exits. +.TP +.B \-v + prints version information to standard output, then exits. +.TP +.B \-h --help +prints short help +.TP +.BI \-fn " font" +defines the font or font set used. +.TP +.BI \-nb " color" +defines the normal background color. +.IR #RGB , +.IR #RRGGBB , +and X color names are supported. +.TP +.BI \-nf " color" +defines the normal foreground color. +.TP +.BI \-sb " color" +defines the selected background color. +.TP +.BI \-sf " color" +defines the selected foreground color. +.TP +.BI \-df " font" +defines the font used in dmenu_run. +.TP +.BI \-dnb " color" +defines the normal background color in dmenu_run. +.TP +.BI \-dnf " color" +defines the normal foreground color in dmenu_run. +.TP +.BI \-dsb " color" +defines the selected background color in dmenu_run. +.TP +.BI \-dsf " color" +defines the selected foreground color in dmenu_run. +.TP + .SH USAGE + .SS Status bar + .TP .SH USAGE .SS Status bar .TP diff --git a/dwm.c b/dwm.c index 0f23ab16..ebbf7dd7 100644 --- a/dwm.c +++ b/dwm.c @@ -175,6 +175,7 @@ static long getstate(Window w); static int gettextprop(Window w, Atom atom, char *text, unsigned int size); static void grabbuttons(Client *c, int focused); static void grabkeys(void); +static char* help(); static void incnmaster(const Arg *arg); static void keypress(XEvent *e); static void killclient(const Arg *arg); @@ -973,6 +974,12 @@ grabkeys(void) } } +char* +help(void) +{ + return "usage: dwm [-hv] [-fn font] [-nb color] [-nf color] [-sb color] [-sf color]\n[-df font] [-dnf color] [-dnb color] [-dsf color] [-dsb color]\n"; +} + void incnmaster(const Arg *arg) { @@ -2147,10 +2154,32 @@ zoom(const Arg *arg) int main(int argc, char *argv[]) { - if (argc == 2 && !strcmp("-v", argv[1])) - die("dwm-"VERSION); - else if (argc != 1) - die("usage: dwm [-v]"); + for(int i=1;i