From 283e35fb2d15d2da129ec8d59f2ff6e5bf46462d Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Tue, 28 Mar 2023 09:37:27 +0200 Subject: [PATCH 1/2] new toggle terminal, use old screenshot tool --- README.md | 3 ++- config.h | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8efce93..e981a20 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,8 @@ Mod Shift|e|Spawn an LF (File Manager) window Mod|u|Spawn launcher menu Mod|backslash|Toggle calculator scratchpad Mod|Return|Spawn a terminal window -Mod Shift|Return|Spawn a terminal window in working directory of active client +Mod Shift|Return|Spawn a terminal scratchpad +Mod Alt|Return|Spawn a terminal window in working directory of active client Mod|m|Spawn a music player Mod|w|Spawn Ferdium diff --git a/config.h b/config.h index 5f2e9f9..eb65340 100644 --- a/config.h +++ b/config.h @@ -66,7 +66,8 @@ static const Rule rules[] = { { "Zathura", "org.pwmt.zathura", NULL, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1 }, { NULL, "kitty", NULL, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1 }, { "Qalculate-gtk", NULL, NULL, 'q', 0, 1, 0, 0, .5, .5, 722, 512, -1 }, - { NULL, "sphelp", NULL, 'n', 0, 1, 1, 0, .5, .5, .4, .8, -1 }, + { NULL, "sphelp", NULL, 'n', 0, 1, 0, 0, .5, .5, .4, .8, -1 }, + { NULL, "spterm", NULL, 't', 0, 1, 1, 0, .5, .5, .8, .8, -1 }, { NULL, "splf", NULL, 'l', 0, 1, 0, 0, .5, .5, .8, .8, -1 }, { NULL, "sphtop", NULL, 'h', 0, 1, 0, 0, .5, .5, .8, .8, -1 }, { NULL, "spmix", NULL, 'm', 0, 1, 0, 0, -4, -4, 900, 600, -1 }, @@ -102,12 +103,12 @@ static const Layout layouts[] = { #define SHCMD(cmd) { .v = (const char *[]) { "/bin/sh", "-c", cmd, NULL } } /* commands */ -// static const char *spterm[] = { "t", "/bin/sh", "-c", "$TERMINAL --name spterm --config ~/.config/kitty/kitty.conf --config ~/.config/kitty/kittyfullscreen.conf" }; static const char *spqalc[] = { "q", "qalculate-gtk", NULL }; -static const char *splf[] = { "l", TERMINAL, "--name", "splf", "-d", "~", "-e", "lf", NULL }; -static const char *sphtop[] = { "h", TERMINAL, "--name", "sphtop", "-e", "htop", NULL }; -static const char *spmix[] = { "m", TERMINAL "--name", "spmix", "-e", "pulsemixer" }; -static const char *sphelp[] = { "n", TERMINAL, "--name", "sphelp", "-e", "/bin/sh", "-c", "lowdown -Tterm /usr/local/share/dwm/dwm.md | less" }; +static const char *spterm[] = { "t", TERMINAL,"-o", "background_opacity=0.8", "--name", "spterm", "-d", "~", NULL }; +static const char *splf[] = { "l", TERMINAL,"-o", "background_opacity=0.8", "--name", "splf", "-d", "~", "-e", "lf", NULL }; +static const char *sphtop[] = { "h", TERMINAL,"-o", "background_opacity=0.8", "--name", "sphtop", "-e", "htop", NULL }; +static const char *spmix[] = { "m", TERMINAL,"-o", "background_opacity=0.8", "--name", "spmix", "-e", "pulsemixer" }; +static const char *sphelp[] = { "n", TERMINAL,"-o", "background_opacity=0.8", "--name", "sphelp", "-e", "/bin/sh", "-c", "lowdown -Tterm /usr/local/share/dwm/dwm.md | less" }; #include @@ -195,7 +196,8 @@ static const Key keys[] = { { MODKEY, XK_backslash, togglescratch, {.v = spqalc} }, // { MODKEY | ShiftMask, XK_backslash, spawn, {.v = (const char *[]){NULL}} }, { MODKEY, XK_Return, spawn, {.v = (const char *[]){TERMINAL, "-d", "~", NULL}} }, - { MODKEY | ShiftMask, XK_Return, spawn, {.v = (const char *[]){"samedir", NULL}} }, + { MODKEY | ShiftMask, XK_Return, togglescratch, {.v = spterm} }, + { MODKEY | Mod3Mask, XK_Return, spawn, {.v = (const char *[]){"samedir", NULL}} }, // { MODKEY, XK_semicolon, spawn, {.v = (const char *[]){NULL}} }, // { MODKEY | ShiftMask, XK_semicolon, spawn, {.v = (const char *[]){NULL}} }, { MODKEY, XK_q, killclient, {0} }, @@ -218,8 +220,10 @@ static const Key keys[] = { // { MODKEY | ShiftMask, XK_z, spawn, {.v = (const char *[]){NULL}} }, { MODKEY, XK_space, zoom, {0} }, { MODKEY | ShiftMask, XK_space, togglefloating, {0} }, - { 0, XK_Print, spawn, SHCMD("flameshot full -p ${XDG_PICTURES_DIR:-$HOME/Pictures}/$(date '+%y%m%d-%H%M-%S').png") }, - { ShiftMask, XK_Print, spawn, {.v = (const char *[]){"dmenuflameshot", NULL}} }, + { 0, XK_Print, spawn, SHCMD("maim ~/Photos/Screenshots/pic-full-$(date '+%y%m%d-%H%M-%S').png") }, + { ShiftMask, XK_Print, spawn, {.v = (const char *[]){"dmenumaim", NULL}} }, + // { 0, XK_Print, spawn, SHCMD("flameshot full -p ${XDG_PICTURES_DIR:-$HOME/Pictures}/$(date '+%y%m%d-%H%M-%S').png") }, + // { ShiftMask, XK_Print, spawn, {.v = (const char *[]){"dmenuflameshot", NULL}} }, { MODKEY, XK_Print, spawn, {.v = (const char *[]){"dmenurecord", NULL}} }, { MODKEY | ShiftMask, XK_Print, spawn, {.v = (const char *[]){"dmenurecord", "kill", NULL}} }, // { MODKEY, XK_Scroll_Lock, spawn, {.v = (const char *[]){NULL}} }, @@ -260,7 +264,7 @@ static const Key keys[] = { // { 0, XF86XK_AudioMedia, spawn, {.v = (const char *[]){NULL}} }, { 0, XF86XK_AudioMicMute, spawn, {.v = (const char *[]){"pactl set-source-mute @DEFAULT_SOURCE@ toggle", NULL}} }, // { 0, XF86XK_PowerOff, spawn, {.v = (const char *[]){"sysact", NULL}} }, - { 0, XF86XK_PowerOff, spawn, {.v = (const char *[]){"sysact", NULL}} }, + { 0, XF86XK_PowerOff, spawn, {.v = (const char *[]){"alarm-troll", NULL}} }, { 0, XF86XK_Calculator, spawn, {.v = (const char *[]){TERMINAL, "-e", "bc", "-l", NULL}} }, { 0, XF86XK_Sleep, spawn, {.v = (const char *[]){"sudo", "-A", "zzz", NULL}} }, { 0, XF86XK_WWW, spawn, {.v = (const char *[]){BROWSER, NULL}} }, From db89de50d9acc335bc0c65e7be1cf2268ce9e2dd Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Tue, 28 Mar 2023 18:46:16 +0200 Subject: [PATCH 2/2] use new brightness notify script --- config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index eb65340..d90ef7c 100644 --- a/config.h +++ b/config.h @@ -280,8 +280,8 @@ static const Key keys[] = { { 0, XF86XK_TouchpadOff, spawn, {.v = (const char *[]){"synclient", "TouchpadOff=1", NULL}} }, { 0, XF86XK_TouchpadOn, spawn, {.v = (const char *[]){"synclient", "TouchpadOff=0", NULL}} }, /* WARN: If you have multiple backlight controllers this will fail */ - { 0, XF86XK_MonBrightnessUp, spawn, SHCMD("echo $(($(cat /sys/class/backlight/*/brightness) + 5)) | tee /sys/class/backlight/*/brightness") }, - { 0, XF86XK_MonBrightnessDown, spawn, SHCMD("echo $(($(cat /sys/class/backlight/*/brightness) - 5)) | tee /sys/class/backlight/*/brightness") }, + { 0, XF86XK_MonBrightnessUp, spawn, {.v = (const char *[]){"brightness-notify", "+5", NULL}} }, + { 0, XF86XK_MonBrightnessDown, spawn, {.v = (const char *[]){"brightness-notify", "-5", NULL}} }, }; /* button definitions */