summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorProsperousPotato <ProsperousPotato@users.noreply.github.com>2026-01-03 17:18:54 +0000
committerProsperousPotato <ProsperousPotato@users.noreply.github.com>2026-01-03 17:18:54 +0000
commitf02c46f670993700cd9166f118da171deb6eaf01 (patch)
tree97c7360f9bb1e017e836b7ff46abc7cab4f26d5b
parent4602687c6d5a49475bd33b12af5d6f5c39b63e86 (diff)
super + a swaps to last used window, default browser: glide
-rw-r--r--config.h5
-rw-r--r--dwm.c13
2 files changed, 17 insertions, 1 deletions
diff --git a/config.h b/config.h
index 7ae0f8f..4d814df 100644
--- a/config.h
+++ b/config.h
@@ -2,7 +2,7 @@
/* Constants */
#define TERMINAL "st"
-#define BROWSER "icecat"
+#define BROWSER "glide"
/* appearance */
static const unsigned int borderpx = 2; /* border pixel of windows */
@@ -117,8 +117,11 @@ static const Key keys[] = {
{ MODKEYTWO, XK_Escape, spawn, SHCMD(TERMINAL" -c stfloat -e htop") },
{ MODKEY, XK_x, spawn, SHCMD("xkill") },
{ MODKEY, XK_w, spawn, SHCMD(BROWSER) },
+ { MODKEY|ShiftMask, XK_w, spawn, SHCMD("icecat") },
+ { MODKEY, XK_a, swapfocus, {0} },
#ifdef __linux__
+ { MODKEY, XK_g, spawn, SHCMD(TERMINAL" -c stfloat -e watch -c -n 2 genlop -c") },
{ MODKEY, XK_s, spawn, SHCMD("steam -dev") },
{ MODKEY|ShiftMask, XK_s, spawn, SHCMD("pkill steam") },
diff --git a/dwm.c b/dwm.c
index ba69655..0024a03 100644
--- a/dwm.c
+++ b/dwm.c
@@ -211,6 +211,7 @@ static void showhide(Client *c);
static void sighup(int unused);
static void sigterm(int unused);
static void spawn(const Arg *arg);
+static void swapfocus();
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
static void tile(Monitor *m);
@@ -246,6 +247,7 @@ static Client *termforwin(const Client *c);
static pid_t winpid(Window w);
/* variables */
+static Client *prevclient = NULL;
static const char broken[] = "broken";
static int screen;
static int sw, sh; /* X display screen geometry width, height */
@@ -1891,6 +1893,15 @@ spawn(const Arg *arg)
}
void
+swapfocus()
+{
+ Client *c;
+ for(c = selmon->clients; c && c != prevclient; c = c->next) ;
+ if(c == prevclient)
+ focus(prevclient);
+}
+
+void
tag(const Arg *arg)
{
if (selmon->sel && arg->ui & TAGMASK) {
@@ -2014,6 +2025,7 @@ unfocus(Client *c, int setfocus)
{
if (!c)
return;
+ prevclient = c;
grabbuttons(c, 0);
if (c->isfloating)
XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColFloat].pixel);
@@ -2485,6 +2497,7 @@ void
zoom(const Arg *arg)
{
Client *c = selmon->sel;
+ prevclient = selmon->clients;
if (!selmon->lt[selmon->sellt]->arrange || !c || c->isfloating)
return;