Created
June 19, 2018 20:38
-
-
Save skeleten/879cc01fca26cfd81a4e3f5412be7e5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/dwm/drw.o b/dwm/drw.o | |
index 2c60e48..630eff7 100644 | |
Binary files a/dwm/drw.o and b/dwm/drw.o differ | |
diff --git a/dwm/dwm b/dwm/dwm | |
deleted file mode 100755 | |
index eb04e7b..0000000 | |
Binary files a/dwm/dwm and /dev/null differ | |
diff --git a/dwm/dwm.c b/dwm/dwm.c | |
index ef12e7f..cb71751 100644 | |
--- a/dwm/dwm.c | |
+++ b/dwm/dwm.c | |
@@ -204,6 +204,7 @@ static void setfullscreen(Client *c, int fullscreen); | |
static void setlayout(const Arg *arg); | |
static void setmfact(const Arg *arg); | |
static void setup(void); | |
+static void setup_theme(const Theme* theme); | |
static void showhide(Client *c); | |
static void sigchld(int unused); | |
static void spawn(const Arg *arg); | |
@@ -1574,12 +1575,13 @@ setup(void) | |
cursor[CurResize] = drw_cur_create(drw, XC_sizing); | |
cursor[CurMove] = drw_cur_create(drw, XC_fleur); | |
/* init appearance */ | |
- scheme[SchemeNorm].border = drw_clr_create(drw, normbordercolor); | |
- scheme[SchemeNorm].bg = drw_clr_create(drw, normbgcolor); | |
- scheme[SchemeNorm].fg = drw_clr_create(drw, normfgcolor); | |
- scheme[SchemeSel].border = drw_clr_create(drw, selbordercolor); | |
- scheme[SchemeSel].bg = drw_clr_create(drw, selbgcolor); | |
- scheme[SchemeSel].fg = drw_clr_create(drw, selfgcolor); | |
+ setup_theme(&Mint); | |
+ // scheme[SchemeNorm].border = drw_clr_create(drw, normbordercolor); | |
+ // scheme[SchemeNorm].bg = drw_clr_create(drw, normbgcolor); | |
+ // scheme[SchemeNorm].fg = drw_clr_create(drw, normfgcolor); | |
+ // scheme[SchemeSel].border = drw_clr_create(drw, selbordercolor); | |
+ // scheme[SchemeSel].bg = drw_clr_create(drw, selbgcolor); | |
+ // scheme[SchemeSel].fg = drw_clr_create(drw, selfgcolor); | |
/* init bars */ | |
updatebars(); | |
updatestatus(); | |
@@ -1597,6 +1599,17 @@ setup(void) | |
focus(NULL); | |
} | |
+void | |
+setup_theme(const Theme* theme) | |
+{ | |
+ scheme[SchemeNorm].border = drw_clr_create(drw, theme->normbordercolor); | |
+ scheme[SchemeNorm].bg = drw_clr_create(drw, theme->normbgcolor); | |
+ scheme[SchemeNorm].fg = drw_clr_create(drw, theme->normfgcolor); | |
+ scheme[SchemeSel].border = drw_clr_create(drw, theme->selbordercolor); | |
+ scheme[SchemeSel].bg = drw_clr_create(drw, theme->selbgcolor); | |
+ scheme[SchemeSel].fg = drw_clr_create(drw, theme->selfgcolor); | |
+} | |
+ | |
void | |
showhide(Client *c) | |
{ | |
diff --git a/dwm/dwm.o b/dwm/dwm.o | |
index 8862bcb..aaae7ec 100644 | |
Binary files a/dwm/dwm.o and b/dwm/dwm.o differ | |
diff --git a/dwm/themes.h b/dwm/themes.h | |
index c46f3e5..0167526 100644 | |
--- a/dwm/themes.h | |
+++ b/dwm/themes.h | |
@@ -3,25 +3,36 @@ | |
// themes.h | |
+#ifndef __THEMES_H | |
+#define __THEMES_H __THEMES_H | |
-#define Mint | |
- | |
-#ifdef Mint | |
-static const char normbordercolor[] = "#949093"; | |
-static const char normbgcolor[] = "#151b1e"; | |
-static const char normfgcolor[] = "#d4ced2"; | |
-static const char selbordercolor[] = "#d4ced2"; | |
-static const char selbgcolor[] = "#619668"; | |
-static const char selfgcolor[] = "#d4ced2"; | |
-#endif | |
+typedef struct s_Theme { | |
+ char* normbordercolor; | |
+ char* normbgcolor; | |
+ char* normfgcolor; | |
+ char* selbordercolor; | |
+ char* selbgcolor; | |
+ char* selfgcolor; | |
+} Theme; | |
+static const Theme Mint = | |
+ { | |
+ .normbordercolor = "#949093", | |
+ .normbgcolor = "#151b1e", | |
+ .normfgcolor = "#d4ced2", | |
+ .selbordercolor = "#d4ced2", | |
+ .selbgcolor = "#619668", | |
+ .selfgcolor = "#d4ced2", | |
+ }; | |
+static const Theme Arizona = | |
+ { | |
+ .normbordercolor = "#949093", | |
+ .normbgcolor = "#151b1e", | |
+ .normfgcolor = "#d4ced2", | |
+ .selbordercolor = "#d4ced2", | |
+ .selbgcolor = "#689990", | |
+ .selfgcolor = "#d4ced2", | |
+ }; | |
-#ifdef Arizona | |
-static const char normbordercolor[] = "#949093"; | |
-static const char normbgcolor[] = "#151b1e"; | |
-static const char normfgcolor[] = "#d4ced2"; | |
-static const char selbordercolor[] = "#d4ced2"; | |
-static const char selbgcolor[] = "#689990"; | |
-static const char selfgcolor[] = "#d4ced2"; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment