commit b816e5cc4e91d79844b562685627f887153cfe44
parent 1140994f4429ac5f13b103ac55e312e5414c03e3
Author: ssnf <ssnf@ssnf.xyz>
Date: Sat, 29 Oct 2022 16:27:52 +0000
screenshot shortcut, warp cursor to middle of window when using zoom()
Diffstat:
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/config.h b/config.h
@@ -67,14 +67,13 @@ static const Layout layouts[] = {
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
-static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
-/*static const char* dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_black1, "-nf", col_green1, "-sb", col_green1, "-sf", col_black3, NULL };*/
static const char* browser[] = { "browser", NULL };
static const char* caps[] = { "setxkbmap", "-option", "caps:super", NULL };
static const char* color[] = { "colorpick", NULL };
static const char* cyclebg[] = { "cyclebg", NULL };
static const char* cyclewe[] = { "cyclewe", NULL };
static const char* compositor[] = { "compositor", NULL };
+static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char* dmenucmd[] = { "dmenu_run", "-m", dmenumon, NULL };
static const char* games[] = { "games", NULL };
static const char* lock[] = { "lock", NULL };
@@ -83,6 +82,10 @@ static const char* mont[] = { "mont", NULL };
static const char* news[] = { "st", "-e", "newsboat", NULL };
static const char* pass[] = { "passd", NULL };
static const char* paste[] = { "paste", NULL };
+static const char* pscrn[] = { "pscrn", NULL };
+static const char* pscrns[] = { "pscrn", "-s", NULL };
+static const char* pscrnf[] = { "pscrnf", NULL };
+static const char* pscrnfs[] = { "pscrnf", "-s", NULL };
static const char* spkrd[] = { "pamixer", "-d", "5", NULL };
static const char* spkri[] = { "pamixer", "-i", "5", NULL };
static const char* spkrt[] = { "pamixer", "-t", NULL };
@@ -105,6 +108,10 @@ static Key keys[] = {
{ MOD, XK_n, spawn, {.v = news} },
{ MOD, XK_o, spawn, {.v = pass} },
{ MOD|SHIFT, XK_p, spawn, {.v = paste} },
+ { 0, XK_Print, spawn, {.v = pscrn} },
+ { SHIFT, XK_Print, spawn, {.v = pscrns} },
+ { MOD, XK_Print, spawn, {.v = pscrnf} },
+ { MOD|SHIFT, XK_Print, spawn, {.v = pscrnfs} },
{ 0, XF86XK_AudioMute, spawn, {.v = spkrt} },
{ MOD, XK_KP_Multiply, spawn, {.v = spkrt} },
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = spkri} },
diff --git a/dwm.c b/dwm.c
@@ -1460,6 +1460,7 @@ pop(Client* c)
attach(c);
focus(c);
arrange(c->mon);
+ XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2);
}
void