summaryrefslogtreecommitdiffstats
path: root/config.def.h
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2025-03-01 23:31:55 +0100
committerJoe <rbo@gmx.us>2025-03-01 23:31:55 +0100
commitdf7c5a9eb465cc393f26ece674f6971a6d2b1cc0 (patch)
treef2ba5283f3e3eb090b16d8e20710fcecd93102d7 /config.def.h
parentshifted (diff)
downloaddwl-df7c5a9eb465cc393f26ece674f6971a6d2b1cc0.tar.gz
dwl-df7c5a9eb465cc393f26ece674f6971a6d2b1cc0.tar.bz2
dwl-df7c5a9eb465cc393f26ece674f6971a6d2b1cc0.tar.xz
dwl-df7c5a9eb465cc393f26ece674f6971a6d2b1cc0.tar.zst
dwl-df7c5a9eb465cc393f26ece674f6971a6d2b1cc0.zip
scratchpads yey
Diffstat (limited to 'config.def.h')
-rw-r--r--config.def.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/config.def.h b/config.def.h
index 10339b6..06ee361 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,3 +1,6 @@
+#include <stdlib.h>
+#include <inttypes.h>
+
/* Taken from https://github.com/djpohly/dwl/issues/466 */
#define COLOR(hex) { ((hex >> 24) & 0xFF) / 255.0f, \
((hex >> 16) & 0xFF) / 255.0f, \
@@ -51,15 +54,28 @@ static int log_level = WLR_ERROR;
/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */
static const Rule rules[] = {
- /* app_id title tags mask isfloating isterm noswallow monitor */
+ /* app_id title tags mask isfloating isterm noswallow monitor scratchkey */
/* examples: */
- { "Gimp_EXAMPLE", NULL, 0, 1, 0, 0, -1 }, /* Start on currently visible tags floating, not tiled */
- { "firefox_EXAMPLE", NULL, 1 << 8, 0, 0, 0, -1 }, /* Start on ONLY tag "9" */
- { "Alacritty", NULL, 0, 0, 1, 1, -1 }, /* make foot swallow clients that are not foot */
- { "st", NULL, 0, 0, 1, 1, -1 }, /* make foot swallow clients that are not foot */
- { "mpv", NULL, 0, 0, 0, 0, -1 }, /* make foot swallow clients that are not foot */
+ { "Gimp_EXAMPLE", NULL, 0, 1, 0, 0, -1, 0 },
+ { "firefox_EXAMPLE", NULL, 1 << 8, 0, 0, 0, -1, 0 },
+ { "Alacritty", NULL, 0, 0, 1, 1, -1, 0 },
+ { "st", NULL, 0, 0, 1, 1, -1, 0 },
+ { "mpv", NULL, 0, 0, 0, 0, -1, 0 },
+ { NULL, "spterm", 0, 1, 1, 0, -1, 's' },
+ { NULL, "spfm", 0, 1, 1, 0, -1, 'f' },
+ { NULL, "pcmanfm", 0, 1, 0, 0, -1, 'p' },
+ { NULL, "spflip", 0, 1, 0, 0, -1, 'h' },
+ { NULL, "spmpd", 0, 1, 0, 0, -1, 'm' },
+ { NULL, "spnews", 0, 0, 0, 0, -1, 'm' },
};
+const char *spterm[] = {"s", "alacritty", "--title", "spterm", NULL };
+const char *spfm[] = {"f", "alacritty", "--title", "spfm", "-e", "zsh", "-ic", "lf", NULL };
+const char *sppcman[] = {"p", "pcmanfm", NULL };
+const char *spflip[] = {"h", "alacritty", "--title", "spflip", "-e", "hf", NULL };
+const char *spmpd[] = {"m", "alacritty", "--title", "spmpd", "-e", "ncmpc", NULL };
+const char *spnews[] = {"n", "alacritty", "--title", "spnews", "-e", "nb", NULL };
+
/* layout(s) */
static const Layout layouts[] = {
/* symbol arrange function */
@@ -170,7 +186,13 @@ static const Key keys[] = {
/* modifier key function argument */
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
{ MODKEY, XKB_KEY_Return, spawn, {.v = termcmd} },
+ { MODKEY, XKB_KEY_F1, togglescratch, {.v = spterm } },
+ { MODKEY, XKB_KEY_F2, togglescratch, {.v = spfm } },
+ { MODKEY|SHIFT, XKB_KEY_F2, togglescratch, {.v = sppcman } },
{ MODKEY, XKB_KEY_F3, spawn, {.v = browser_cmd } },
+ { MODKEY, XKB_KEY_F4, togglescratch, {.v = spflip } },
+ { MODKEY, XKB_KEY_F5, togglescratch, {.v = spmpd } },
+ { MODKEY, XKB_KEY_F6, togglescratch, {.v = spnews } },
{ MODKEY|CTRL, XKB_KEY_p, spawn, {.v = dmpass_cmd } },
{ MODKEY|CTRL|SHIFT, XKB_KEY_p, spawn, {.v = dmpass_full_cmd } },
{ MODKEY|CTRL, XKB_KEY_o, spawn, {.v = dmotp_cmd } },