Skip to content

Commit 7156045

Browse files
committed
Merge branch 'speediegq-master'
2 parents d21f630 + b9938cb commit 7156045

File tree

2 files changed

+14
-60
lines changed

2 files changed

+14
-60
lines changed

dwm.c

+13-59
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,6 @@
6868
#define SPTAG(i) ((1 << LENGTH(tags)) << (i))
6969
#define SPTAGMASK (((1 << LENGTH(scratchpads))-1) << LENGTH(tags))
7070
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
71-
#define XRDB_LOAD_COLOR(R,V) if (XrmGetResource(xrdb, R, NULL, &type, &value) == True) { \
72-
if (value.addr != NULL && strnlen(value.addr, 8) == 7 && value.addr[0] == '#') { \
73-
int i = 1; \
74-
for (; i <= 6; i++) { \
75-
if (value.addr[i] < 48) break; \
76-
if (value.addr[i] > 57 && value.addr[i] < 65) break; \
77-
if (value.addr[i] > 70 && value.addr[i] < 97) break; \
78-
if (value.addr[i] > 102) break; \
79-
} \
80-
if (i == 7) { \
81-
strncpy(V, value.addr, 7); \
82-
V[7] = '\0'; \
83-
} \
84-
} \
85-
}
8671
#define TRUNC(X,A,B) (MAX((A), MIN((X), (B))))
8772

8873
/* enums */
@@ -228,7 +213,6 @@ static void grabkeys(void);
228213
static void incnmaster(const Arg *arg);
229214
static void keypress(XEvent *e);
230215
static void killclient(const Arg *arg);
231-
static void loadxrdb(void);
232216
static void manage(Window w, XWindowAttributes *wa);
233217
static void mappingnotify(XEvent *e);
234218
static void maprequest(XEvent *e);
@@ -296,8 +280,8 @@ static Monitor *wintomon(Window w);
296280
static int xerror(Display *dpy, XErrorEvent *ee);
297281
static int xerrordummy(Display *dpy, XErrorEvent *ee);
298282
static int xerrorstart(Display *dpy, XErrorEvent *ee);
299-
static void xrdb(const Arg *arg);
300283
static void zoom(const Arg *arg);
284+
static void xrdb(const Arg *arg);
301285
static void load_xresources(void);
302286
static void resource_load(XrmDatabase db, char *name, enum resource_type rtype, void *dst);
303287

@@ -1223,37 +1207,6 @@ killclient(const Arg *arg)
12231207
}
12241208
}
12251209

1226-
void
1227-
loadxrdb()
1228-
{
1229-
Display *display;
1230-
char * resm;
1231-
XrmDatabase xrdb;
1232-
char *type;
1233-
XrmValue value;
1234-
1235-
display = XOpenDisplay(NULL);
1236-
1237-
if (display != NULL) {
1238-
resm = XResourceManagerString(display);
1239-
1240-
if (resm != NULL) {
1241-
xrdb = XrmGetStringDatabase(resm);
1242-
1243-
if (xrdb != NULL) {
1244-
XRDB_LOAD_COLOR("dwm.color0", normbordercolor);
1245-
XRDB_LOAD_COLOR("dwm.color0", normbgcolor);
1246-
XRDB_LOAD_COLOR("dwm.color4", normfgcolor);
1247-
XRDB_LOAD_COLOR("dwm.color8", selbordercolor);
1248-
XRDB_LOAD_COLOR("dwm.color4", selbgcolor);
1249-
XRDB_LOAD_COLOR("dwm.color0", selfgcolor);
1250-
}
1251-
}
1252-
}
1253-
1254-
XCloseDisplay(display);
1255-
}
1256-
12571210
void
12581211
manage(Window w, XWindowAttributes *wa)
12591212
{
@@ -2623,17 +2576,6 @@ xerrorstart(Display *dpy, XErrorEvent *ee)
26232576
return -1;
26242577
}
26252578

2626-
void
2627-
xrdb(const Arg *arg)
2628-
{
2629-
loadxrdb();
2630-
int i;
2631-
for (i = 0; i < LENGTH(colors); i++)
2632-
scheme[i] = drw_scm_create(drw, colors[i], 3);
2633-
focus(NULL);
2634-
arrange(NULL);
2635-
}
2636-
26372579
void
26382580
zoom(const Arg *arg)
26392581
{
@@ -2646,6 +2588,18 @@ zoom(const Arg *arg)
26462588
pop(c);
26472589
}
26482590

2591+
void
2592+
xrdb(const Arg *arg)
2593+
{
2594+
load_xresources();
2595+
2596+
for (int i = 0; i < LENGTH(colors); i++)
2597+
scheme[i] = drw_scm_create(drw, colors[i], 3);
2598+
2599+
focus(NULL);
2600+
arrange(NULL);
2601+
}
2602+
26492603
void
26502604
resource_load(XrmDatabase db, char *name, enum resource_type rtype, void *dst)
26512605
{

larbs.mom

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ There are nine tags, active tags are highlighted in the top left.
225225
.ITEM
226226
\f(CWMod+`\fP \(en Select an emoji to copy to clipboard
227227
.ITEM
228-
\f(CWMod+Insert\fP \(en Show contents of clipboard/primary selection
228+
\f(CWMod+Insert\fP \(en Pastes text you have saved in a file at ~/.local/share/larbs/snippets
229229
.LIST OFF
230230
.HEADING 2 "Audio"
231231
.PP

0 commit comments

Comments
 (0)