summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryuzu-eva <stevenhu@web.de>2023-10-28 22:48:46 +0200
committeryuzu-eva <stevenhu@web.de>2023-10-28 22:48:46 +0200
commit86453ba85dbae3c8ae26079093536cc3fd6cdcee (patch)
tree69cc506dacbb9cafd93667677d4d0cbe529d8d25
parentf71141882690b15bc256e4145ea2ead87be6af2d (diff)
update
-rw-r--r--config.h25
-rw-r--r--config.mk5
-rw-r--r--drw.obin11104 -> 11072 bytes
-rwxr-xr-xdwmbin75272 -> 75296 bytes
-rw-r--r--dwm.c47
-rw-r--r--dwm.obin63880 -> 64536 bytes
-rw-r--r--util.obin2256 -> 2224 bytes
7 files changed, 58 insertions, 19 deletions
diff --git a/config.h b/config.h
index ca566d2..c03ef0c 100644
--- a/config.h
+++ b/config.h
@@ -4,14 +4,13 @@
#define TERMCLASS "st-256color"
/* appearance */
-static const unsigned int borderpx = 0; /* border pixel of windows */
+static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const unsigned int minwsz = 20; /* Minimal height of a client for smfact */
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
-static const int focusonwheel = 0;
-static const char *fonts[] = { "Hack Nerd Font:size=11", "JoyPixels:pixelsize:11:antialias=true:autohint=true"};
+static const char *fonts[] = { "Hack Nerd Font:size=11", "JoyPixels:pixelsize:10:antialias=true:autohint=true"};
static const char dmenufont[] = "Hack Nerd Font:size=11";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
@@ -36,7 +35,7 @@ static const Rule rules[] = {
{ "Gimp", NULL, NULL, 0, 1, 0, 0, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 },
{ "floating", NULL, NULL, 0, 1, 0, 0, -1 },
- { "Steam", NULL, NULL, 0, 1, 0, -1, -1 },
+ { "steam", NULL, NULL, 0, 1, 0, -1, -1 },
{ TERMCLASS, NULL, NULL, 0, 0, 1, 0, -1 },
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
};
@@ -79,7 +78,7 @@ static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
- { MODKEY|ShiftMask, XK_b, togglebar, {0} },
+ { MODKEY|ShiftMask|ControlMask, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
@@ -91,7 +90,7 @@ static Key keys[] = {
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
- { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
+ { MODKEY, XK_b, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
@@ -99,15 +98,15 @@ static Key keys[] = {
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
- { MODKEY, XK_b, spawn, {.v = (const char*[]){ "firefox-bin", "-P", "default-release", NULL } } },
- { MODKEY, XK_v, spawn, {.v = (const char*[]){ "firefox-bin", "-P", "less-strict", NULL } } },
- { MODKEY, XK_e, spawn, {.v = (const char*[]){ "emacsclient", "-c", "-a", "emacs", NULL } } },
- { MODKEY|ShiftMask, XK_v, spawn, {.v = (const char*[]){ TERMINAL, "pulsemixer", NULL } } },
+ { MODKEY|ShiftMask, XK_f, spawn, {.v = (const char*[]){ "firefox", "-P", "default-release", NULL } } },
+ { MODKEY|ShiftMask, XK_b, spawn, {.v = (const char*[]){ "firefox", "-P", "less-strict", NULL } } },
+ { MODKEY|ShiftMask, XK_e, spawn, {.v = (const char*[]){ "emacsclient", "-c", "-a", "emacs", NULL } } },
{ MODKEY|ShiftMask, XK_n, spawn, {.v = (const char*[]){ TERMINAL, "newsboat", NULL } } },
- { MODKEY|ShiftMask, XK_y, spawn, {.v = (const char*[]){ TERMINAL, "ytdl", NULL } } },
- { MODKEY, XK_c, spawn, {.v = (const char*[]){ "mpdmenu", NULL } } },
+ { MODKEY|ShiftMask, XK_m, spawn, {.v = (const char*[]){ "mpdinfo", NULL } } },
+ { MODKEY|ShiftMask, XK_v, spawn, {.v = (const char*[]){ TERMINAL, "pulsemixer", NULL } } },
+ { MODKEY|ControlMask, XK_c, spawn, {.v = (const char*[]){ "mpdmenu", NULL } } },
{ MODKEY|ControlMask, XK_b, spawn, SHCMD("$BROWSER $(grep -v '^#' ~/.config/bookmarks | dmenu -i -l 50 | cut -d' ' -f1)") },
- { MODKEY, XK_q, spawn, SHCMD("~/.local/bin/qrshare") },
+ { MODKEY|ControlMask, XK_q, spawn, SHCMD("~/.local/bin/qrshare") },
{ MODKEY, XK_Print, spawn, SHCMD("sleep 0.3s; scrot -s -e 'mv $f ~/pics/'") },
{ 0, XK_Print, spawn, SHCMD("scrot -u -e 'mv $f ~/pics/'") },
TAGKEYS( XK_1, 0)
diff --git a/config.mk b/config.mk
index 9a23b63..5e8e0e0 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
# dwm version
-VERSION = 6.4
+VERSION = 6.3
# Customize below to fit your system
@@ -17,6 +17,7 @@ XINERAMAFLAGS = -DXINERAMA
# freetype
FREETYPELIBS = -lfontconfig -lXft
FREETYPEINC = /usr/include/freetype2
+#KVMLIB = -lkvm
# OpenBSD (uncomment)
#FREETYPEINC = ${X11INC}/freetype2
#MANPREFIX = ${PREFIX}/man
@@ -26,7 +27,7 @@ INCS = -I${X11INC} -I${FREETYPEINC}
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lX11-xcb -lxcb -lxcb-res ${KVMLIB}
# flags
-CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
+CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
LDFLAGS = ${LIBS}
diff --git a/drw.o b/drw.o
index 1dac747..eb6ee1a 100644
--- a/drw.o
+++ b/drw.o
Binary files differ
diff --git a/dwm b/dwm
index 6db5fd3..01aad5f 100755
--- a/dwm
+++ b/dwm
Binary files differ
diff --git a/dwm.c b/dwm.c
index 8540612..fc1d697 100644
--- a/dwm.c
+++ b/dwm.c
@@ -176,6 +176,7 @@ static void detachstack(Client *c);
static Monitor *dirtomon(int dir);
static void drawbar(Monitor *m);
static void drawbars(void);
+static void enternotify(XEvent *e);
static void expose(XEvent *e);
static void focus(Client *c);
static void focusin(XEvent *e);
@@ -194,6 +195,7 @@ static void manage(Window w, XWindowAttributes *wa);
static void mappingnotify(XEvent *e);
static void maprequest(XEvent *e);
static void monocle(Monitor *m);
+static void motionnotify(XEvent *e);
static void movemouse(const Arg *arg);
static Client *nexttiled(Client *c);
static void pop(Client *c);
@@ -267,11 +269,13 @@ static void (*handler[LASTEvent]) (XEvent *) = {
[ConfigureRequest] = configurerequest,
[ConfigureNotify] = configurenotify,
[DestroyNotify] = destroynotify,
+ [EnterNotify] = enternotify,
[Expose] = expose,
[FocusIn] = focusin,
[KeyPress] = keypress,
[MappingNotify] = mappingnotify,
[MapRequest] = maprequest,
+ [MotionNotify] = motionnotify,
[PropertyNotify] = propertynotify,
[UnmapNotify] = unmapnotify
};
@@ -493,8 +497,7 @@ buttonpress(XEvent *e)
click = ClkRootWin;
/* focus monitor if necessary */
- if ((m = wintomon(ev->window)) && m != selmon
- && (focusonwheel || (ev->button != Button4 && ev->button != Button5))) {
+ if ((m = wintomon(ev->window)) && m != selmon) {
unfocus(selmon->sel, 1);
selmon = m;
focus(NULL);
@@ -514,8 +517,8 @@ buttonpress(XEvent *e)
else
click = ClkWinTitle;
} else if ((c = wintoclient(ev->window))) {
- if (focusonwheel || (ev->button != Button4 && ev->button != Button5))
- focus(c);
+ focus(c);
+ restack(selmon);
XAllowEvents(dpy, ReplayPointer, CurrentTime);
click = ClkClientWin;
}
@@ -830,6 +833,25 @@ drawbars(void)
}
void
+enternotify(XEvent *e)
+{
+ Client *c;
+ Monitor *m;
+ XCrossingEvent *ev = &e->xcrossing;
+
+ if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
+ return;
+ c = wintoclient(ev->window);
+ m = c ? c->mon : wintomon(ev->window);
+ if (m != selmon) {
+ unfocus(selmon->sel, 1);
+ selmon = m;
+ } else if (!c || c == selmon->sel)
+ return;
+ focus(c);
+}
+
+void
expose(XEvent *e)
{
Monitor *m;
@@ -1183,6 +1205,23 @@ monocle(Monitor *m)
}
void
+motionnotify(XEvent *e)
+{
+ static Monitor *mon = NULL;
+ Monitor *m;
+ XMotionEvent *ev = &e->xmotion;
+
+ if (ev->window != root)
+ return;
+ if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
+ unfocus(selmon->sel, 1);
+ selmon = m;
+ focus(NULL);
+ }
+ mon = m;
+}
+
+void
movemouse(const Arg *arg)
{
int x, y, ocx, ocy, nx, ny;
diff --git a/dwm.o b/dwm.o
index e329880..8034b97 100644
--- a/dwm.o
+++ b/dwm.o
Binary files differ
diff --git a/util.o b/util.o
index 90954d9..8e55fa1 100644
--- a/util.o
+++ b/util.o
Binary files differ