summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.def.h16
-rw-r--r--config.h8
-rw-r--r--drw.c2
-rw-r--r--drw.obin11128 -> 11136 bytes
-rw-r--r--dwmbin85960 -> 86016 bytes
-rw-r--r--dwm.c86
-rw-r--r--dwm.obin73112 -> 74048 bytes
7 files changed, 83 insertions, 29 deletions
diff --git a/config.def.h b/config.def.h
index b55a0c7..d28ff55 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,7 +1,7 @@
/* See LICENSE file for copyright and license details. */
/* Constants */
-#define TERMINAL "xterm"
+#define TERMINAL "st"
#define BROWSER "librewolf"
/* appearance */
@@ -47,9 +47,9 @@ static const Rule rules[] = {
{ "qBittorrent", NULL, NULL, 0, 1, 0, 0, -1 },
{ "qBittorrent", "qbittorrent", NULL, 0, 0, 0, 0, -1 },
{ "St", "st", NULL, 0, 0, 1, 0, -1 },
+ { "XTerm", "xterm", NULL, 0, 0, 1, 0, -1 },
{ "scrcpy", NULL, NULL, 0, 1, 0, 0, -1 },
{ "LibreWolf", "Alert", NULL, 0, 1, 0, 0, -1 },
- { "Nsxiv", NULL, NULL, 0, 1, 0, 0, -1 },
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 },
};
@@ -103,8 +103,8 @@ static const Key keys[] = {
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY|ShiftMask, XK_Return, setlayout, {0} },
{ MODKEY, XK_Return, togglefloating, {0} },
- { MODKEY, XK_0, view, {.ui = ~0 } },
- { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
+ { MODKEY, XK_grave, view, {.ui = ~0 } },
+ { MODKEY|ShiftMask, XK_grave, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
@@ -132,6 +132,7 @@ static const Key keys[] = {
{ MODKEY, XK_Escape, spawn, SHCMD(TERMINAL" -e htop")},
{ MODKEY, XK_n, spawn, SHCMD(TERMINAL" -e newsboat")},
{ MODKEY, XK_e, spawn, SHCMD(TERMINAL" -e lfub")},
+ { MODKEY, XK_slash, spawn, SHCMD(TERMINAL" -e menu") },
{ MODKEY, XK_Print, spawn, SHCMD("maimpick") },
{ MODKEY, XK_Up, spawn, SHCMD("dwmvol up") },
{ MODKEY, XK_Down, spawn, SHCMD("dwmvol down") },
@@ -145,15 +146,16 @@ static const Key keys[] = {
{ MODKEY, XK_F11, spawn, SHCMD("dwmstats") },
{ MODKEY, XK_F12, spawn, SHCMD("dwmext") },
{ MODKEY, XK_F8, spawn, SHCMD("dwmnet") },
- { MODKEY, XK_slash, spawn, SHCMD("demu") },
{ MODKEY, XK_s, spawn, SHCMD("steam") },
{ Mod1Mask|ControlMask, XK_Delete, spawn, SHCMD("slock") },
{ MODKEY, XK_w, spawn, SHCMD(BROWSER) },
{ MODKEY, XK_c, spawn, SHCMD("cliphist add") },
{ MODKEY, XK_v, spawn, SHCMD("cliphist sel") },
{ MODKEY, XK_x, spawn, SHCMD("xkill") },
- { MODKEY, XK_h, shiftview, { .i = -1 } },
- { MODKEY, XK_l, shiftview, { .i = +1 } },
+ { MODKEY, XK_h, viewprev, {0} },
+ { MODKEY, XK_l, viewnext, {0} },
+ { MODKEY|ShiftMask, XK_h, tagtoprev, {0} },
+ { MODKEY|ShiftMask, XK_l, tagtonext, {0} },
{ MODKEY|ShiftMask, XK_r, quit, {1} },
/* Unused keys */
diff --git a/config.h b/config.h
index 45cc4df..d28ff55 100644
--- a/config.h
+++ b/config.h
@@ -1,7 +1,7 @@
/* See LICENSE file for copyright and license details. */
/* Constants */
-#define TERMINAL "xterm"
+#define TERMINAL "st"
#define BROWSER "librewolf"
/* appearance */
@@ -152,8 +152,10 @@ static const Key keys[] = {
{ MODKEY, XK_c, spawn, SHCMD("cliphist add") },
{ MODKEY, XK_v, spawn, SHCMD("cliphist sel") },
{ MODKEY, XK_x, spawn, SHCMD("xkill") },
- { MODKEY, XK_h, shiftview, { .i = -1 } },
- { MODKEY, XK_l, shiftview, { .i = +1 } },
+ { MODKEY, XK_h, viewprev, {0} },
+ { MODKEY, XK_l, viewnext, {0} },
+ { MODKEY|ShiftMask, XK_h, tagtoprev, {0} },
+ { MODKEY|ShiftMask, XK_l, tagtonext, {0} },
{ MODKEY|ShiftMask, XK_r, quit, {1} },
/* Unused keys */
diff --git a/drw.c b/drw.c
index a58a2b4..927db1f 100644
--- a/drw.c
+++ b/drw.c
@@ -190,6 +190,8 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
DefaultColormap(drw->dpy, drw->screen),
clrname, dest))
die("error, cannot allocate color '%s'", clrname);
+
+ dest->pixel |= 0xff << 24;
}
/* Wrapper to create color schemes. The caller has to call free(3) on the
diff --git a/drw.o b/drw.o
index 86ba36a..6b6988b 100644
--- a/drw.o
+++ b/drw.o
Binary files differ
diff --git a/dwm b/dwm
index 26bcabc..3095857 100644
--- a/dwm
+++ b/dwm
Binary files differ
diff --git a/dwm.c b/dwm.c
index aa1205d..9461252 100644
--- a/dwm.c
+++ b/dwm.c
@@ -183,7 +183,6 @@ static void focusin(XEvent *e);
static void focusmon(const Arg *arg);
static void focusstackvis(const Arg *arg);
static void movestack(const Arg *arg);
-static void shiftview(const Arg *arg);
static void focusstack(int inc, int vis);
static Atom getatomprop(Client *c, Atom prop);
static int getrootptr(int *x, int *y);
@@ -202,6 +201,12 @@ static void maprequest(XEvent *e);
static void monocle(Monitor *m);
static void motionnotify(XEvent *e);
static void movemouse(const Arg *arg);
+static unsigned int nexttag(void);
+static unsigned int prevtag(void);
+static void tagtonext(const Arg *arg);
+static void tagtoprev(const Arg *arg);
+static void viewnext(const Arg *arg);
+static void viewprev(const Arg *arg);
static Client *nexttiled(Client *c);
static void pop(Client *c);
static void propertynotify(XEvent *e);
@@ -1016,21 +1021,6 @@ movestack(const Arg *arg)
}
void
-shiftview(const Arg *arg)
-{
- Arg shifted;
- if(arg->i > 0)
- shifted.ui = (selmon->tagset[selmon->seltags] << arg->i)
- | (selmon->tagset[selmon->seltags] >> (LENGTH(tags) - arg->i));
-
- else
- shifted.ui = selmon->tagset[selmon->seltags] >> (- arg->i)
- | selmon->tagset[selmon->seltags] << (LENGTH(tags) + arg->i);
-
- view(&shifted);
-}
-
-void
focusstack(int inc, int hid)
{
Client *c = NULL, *i;
@@ -1446,6 +1436,58 @@ movemouse(const Arg *arg)
}
}
+unsigned int
+nexttag(void)
+{
+ unsigned int seltag = selmon->tagset[selmon->seltags];
+ return seltag == (1 << (LENGTH(tags) - 1)) ? 1 : seltag << 1;
+}
+
+unsigned int
+prevtag(void)
+{
+ unsigned int seltag = selmon->tagset[selmon->seltags];
+ return seltag == 1 ? (1 << (LENGTH(tags) - 1)) : seltag >> 1;
+}
+
+void
+tagtonext(const Arg *arg)
+{
+ unsigned int tmp;
+
+ if (selmon->sel == NULL)
+ return;
+
+ tmp = nexttag();
+ tag(&(const Arg){.ui = tmp});
+ view(&(const Arg){.ui = tmp});
+}
+
+void
+tagtoprev(const Arg *arg)
+{
+ unsigned int tmp;
+
+ if (selmon->sel == NULL)
+ return;
+
+ tmp = prevtag();
+ tag(&(const Arg){.ui = tmp});
+ view(&(const Arg){.ui = tmp});
+}
+
+void
+viewnext(const Arg *arg)
+{
+ view(&(const Arg){.ui = nexttag()});
+}
+
+void
+viewprev(const Arg *arg)
+{
+ view(&(const Arg){.ui = prevtag()});
+}
+
Client *
nexttiled(Client *c)
{
@@ -1695,14 +1737,20 @@ sendmon(Client *c, Monitor *m)
{
if (c->mon == m)
return;
+ int hadfocus = (c == selmon->sel);
unfocus(c, 1);
detach(c);
detachstack(c);
+ arrange(c->mon);
c->mon = m;
attach(c);
attachstack(c);
- focus(NULL);
- arrange(NULL);
+ arrange(m);
+ if (hadfocus) {
+ focus(c);
+ restack(m);
+ } else
+ focus(NULL);
}
void
@@ -2360,7 +2408,7 @@ void
updatestatus(void)
{
if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
- strcpy(stext, "");
+ strcpy(stext, "*");
drawbar(selmon);
}
diff --git a/dwm.o b/dwm.o
index 37dcf5e..9ca5831 100644
--- a/dwm.o
+++ b/dwm.o
Binary files differ