diff options
| author | bakkeby <[email protected]> | 2019-10-05 23:56:43 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2019-10-05 23:56:43 +0200 |
| commit | ac4269a4f28f29bad9a319993ad814830248f89a (patch) | |
| tree | eabfabfca7ce1b90129364b9e21f53a2418f5b06 | |
| parent | f096d003d9c33ec08f1d563e8f52c44f32ed80c8 (diff) | |
| download | dwm-flexipatch-ac4269a4f28f29bad9a319993ad814830248f89a.tar.gz dwm-flexipatch-ac4269a4f28f29bad9a319993ad814830248f89a.zip | |
Adding cmdcustomize patch
| -rw-r--r-- | README.md | 5 | ||||
| -rw-r--r-- | dwm.c | 29 | ||||
| -rw-r--r-- | patch/cmdcustomize.c | 5 | ||||
| -rw-r--r-- | patch/cmdcustomize.h | 1 | ||||
| -rw-r--r-- | patch/include.c | 4 | ||||
| -rw-r--r-- | patch/include.h | 4 | ||||
| -rw-r--r-- | patches.h | 5 |
7 files changed, 52 insertions, 1 deletions
@@ -13,7 +13,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t ### Changelog: -2019-10-05 - Added killunsel, taggrid and hidevacanttags patches +2019-10-05 - Added killunsel, taggrid, hidevacanttags and cmdcustomize patches 2019-10-04 - Added maximize, movestack, monoclesymbol, noborder, tagall and tagintostack patches @@ -88,6 +88,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t - [cfacts](https://dwm.suckless.org/patches/cfacts/) - the cfacts patch provides the ability to assign different weights to clients in their respective stack in tiled layout + - [cmdcustomize](https://dwm.suckless.org/patches/cmdcustomize/) + - allows color attributes to be set through the command line + - [combo](https://dwm.suckless.org/patches/combo/) - allows you to select multiple tags by pressing all the right keys as a combo, e.g. hold MOD and press and hold 1 and 3 together to view those two tags @@ -3380,10 +3380,39 @@ zoom(const Arg *arg) int main(int argc, char *argv[]) { + #if CMDCUSTOMIZE + for (int i=1;i<argc;i+=1) + if (!strcmp("-v", argv[i])) + die("dwm-"VERSION); + else if (!strcmp("-h", argv[i]) || !strcmp("--help", argv[i])) + die(help()); + else if (!strcmp("-fn", argv[i])) /* font set */ + fonts[0] = argv[++i]; + else if (!strcmp("-nb", argv[i])) /* normal background color */ + colors[SchemeNorm][1] = argv[++i]; + else if (!strcmp("-nf", argv[i])) /* normal foreground color */ + colors[SchemeNorm][0] = argv[++i]; + else if (!strcmp("-sb", argv[i])) /* selected background color */ + colors[SchemeSel][1] = argv[++i]; + else if (!strcmp("-sf", argv[i])) /* selected foreground color */ + colors[SchemeSel][0] = argv[++i]; + else if (!strcmp("-df", argv[i])) /* dmenu font */ + dmenucmd[4] = argv[++i]; + else if (!strcmp("-dnb", argv[i])) /* dmenu normal background color */ + dmenucmd[6] = argv[++i]; + else if (!strcmp("-dnf", argv[i])) /* dmenu normal foreground color */ + dmenucmd[8] = argv[++i]; + else if (!strcmp("-dsb", argv[i])) /* dmenu selected background color */ + dmenucmd[10] = argv[++i]; + else if (!strcmp("-dsf", argv[i])) /* dmenu selected foreground color */ + dmenucmd[12] = argv[++i]; + else die(help()); + #else if (argc == 2 && !strcmp("-v", argv[1])) die("dwm-"VERSION); else if (argc != 1) die("usage: dwm [-v]"); + #endif // CMDCUSTOMIZE if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) fputs("warning: no locale support\n", stderr); if (!(dpy = XOpenDisplay(NULL))) diff --git a/patch/cmdcustomize.c b/patch/cmdcustomize.c new file mode 100644 index 0000000..1e62d20 --- /dev/null +++ b/patch/cmdcustomize.c @@ -0,0 +1,5 @@ +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"; +}
\ No newline at end of file diff --git a/patch/cmdcustomize.h b/patch/cmdcustomize.h new file mode 100644 index 0000000..280f5b8 --- /dev/null +++ b/patch/cmdcustomize.h @@ -0,0 +1 @@ +static char* help();
\ No newline at end of file diff --git a/patch/include.c b/patch/include.c index 084f64e..8f4a0d0 100644 --- a/patch/include.c +++ b/patch/include.c @@ -24,6 +24,10 @@ #include "cfacts.c" #endif +#if CMDCUSTOMIZE +#include "cmdcustomize.c" +#endif + #if COMBO_PATCH #include "combo.c" #endif diff --git a/patch/include.h b/patch/include.h index 426853d..237b725 100644 --- a/patch/include.h +++ b/patch/include.h @@ -24,6 +24,10 @@ #include "cfacts.h" #endif +#if CMDCUSTOMIZE +#include "cmdcustomize.h" +#endif + #if COMBO_PATCH #include "combo.h" #endif @@ -98,6 +98,11 @@ */ #define CFACTS_PATCH 0 +/* This patch allows color attributes to be set through the command line. + * https://dwm.suckless.org/patches/cmdcustomize/ + */ +#define CMDCUSTOMIZE 0 + /* This patch tweaks the tagging interface so that you can select multiple tags for tag * or view by pressing all the right keys as a combo. For example to view tags 1 and 3, * hold MOD and then press and hold 1 and 3 together. |
