dwm: gaps de 4px con atajos, audio con límite 100%, micro, bloqueo, capturas y clipmenu

- config.h regenerado desde config.def.h (faltaban los atajos de setgaps)
  e indentado con tabuladores
- gaps: Mod+-/Mod++ (teclado español) y Mod+Shift++ para quitarlos
- volumen limitado a 100% y refresco inmediato de slstatus
- silenciar micro con Mod+ñ y XF86AudioMicMute
- slock con Mod+Shift+l, clipmenu con Mod+v
- capturas con Impr (pantalla) y Shift+Impr (selección) usando maim
- quitar regla de Firefox que no hacía nada
- arreglar indentación de tile() tras el parche fullgaps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alejandro Guerrero 2026-09-25 10:53:55 +02:00
parent af283c5c2d
commit bd84917dfe
2 changed files with 98 additions and 73 deletions

View file

@ -4,7 +4,7 @@
/* appearance */ /* appearance */
static const unsigned int borderpx = 2; /* border pixel of windows */ static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int gappx = 10; /* gaps between windows */ static const unsigned int gappx = 4; /* gaps between windows */
static const unsigned int snap = 32; /* snap pixel */ static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */ static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */ static const int topbar = 1; /* 0 means bottom bar */
@ -34,7 +34,6 @@ static const Rule rules[] = {
*/ */
/* class instance title tags mask isfloating monitor */ /* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, 1, -1 }, { "Gimp", NULL, NULL, 0, 1, -1 },
{ "Firefox", NULL, NULL, 0, 0, -1 },
}; };
/* layout(s) */ /* layout(s) */
@ -66,16 +65,29 @@ static const Layout layouts[] = {
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_bg, "-nf", col_fg, "-sb", col_accent, "-sf", col_accent_fg, NULL }; static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_bg, "-nf", col_fg, "-sb", col_accent, "-sf", col_accent_fg, NULL };
static const char *termcmd[] = { "st", NULL }; static const char *termcmd[] = { "st", NULL };
static const char *clipcmd[] = { "clipmenu", NULL };
static const char *lockcmd[] = { "slock", NULL };
/* Comandos de volumen */ /* Audio: tras cada cambio se avisa a slstatus (SIGUSR1) para que refresque la barra al momento */
static const char *upvol[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "5%+", NULL }; #define STATUSREFRESH "; pkill -USR1 -x slstatus"
static const char *downvol[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "5%-", NULL }; #define VOLUP SHCMD("wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+" STATUSREFRESH)
static const char *mutevol[] = { "wpctl", "set-mute", "@DEFAULT_AUDIO_SINK@", "toggle", NULL }; #define VOLDOWN SHCMD("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" STATUSREFRESH)
#define VOLMUTE SHCMD("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" STATUSREFRESH)
#define MICMUTE SHCMD("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" STATUSREFRESH)
/* Capturas: se guardan en ~/Imágenes/Capturas y se copian al portapapeles */
#define SCREENSHOT(opts) SHCMD( \
"d=\"$HOME/Imágenes/Capturas\"; mkdir -p \"$d\"; " \
"f=\"$d/$(date +%Y-%m-%d_%H-%M-%S).png\"; " \
"maim " opts " \"$f\" && xclip -selection clipboard -t image/png -i \"$f\" " \
"&& notify-send -i \"$f\" 'Captura guardada' \"$f\"")
static const Key keys[] = { static const Key keys[] = {
/* modifier key function argument */ /* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } }, { MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } }, { MODKEY, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_v, spawn, {.v = clipcmd } },
{ MODKEY|ShiftMask, XK_l, spawn, {.v = lockcmd } },
{ MODKEY, XK_b, togglebar, {0} }, { MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } }, { MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } },
@ -97,6 +109,10 @@ static const Key keys[] = {
{ MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
/* gaps: en teclado español '+' y '-' están sin Shift (XK_equal no existe sin Shift) */
{ MODKEY, XK_minus, setgaps, {.i = -1 } },
{ MODKEY, XK_plus, setgaps, {.i = +1 } },
{ MODKEY|ShiftMask, XK_plus, setgaps, {.i = 0 } },
TAGKEYS( XK_1, 0) TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1) TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2) TAGKEYS( XK_3, 2)
@ -108,12 +124,20 @@ static const Key keys[] = {
TAGKEYS( XK_9, 8) TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_m, quit, {0} }, { MODKEY|ShiftMask, XK_m, quit, {0} },
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } }, /* audio */
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } }, { 0, XF86XK_AudioRaiseVolume, spawn, VOLUP },
{ 0, XF86XK_AudioMute, spawn, {.v = mutevol } }, { 0, XF86XK_AudioLowerVolume, spawn, VOLDOWN },
{ 0, XF86XK_AudioMute, spawn, VOLMUTE },
{ 0, XF86XK_AudioMicMute, spawn, MICMUTE },
{ MODKEY, XK_ntilde, spawn, MICMUTE },
/* capturas */
{ 0, XK_Print, spawn, SCREENSHOT("") },
{ ShiftMask, XK_Print, spawn, SCREENSHOT("-s") },
}; };
/* button definitions */ /* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static const Button buttons[] = { static const Button buttons[] = {
/* click event mask button function argument */ /* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} }, { ClkLtSymbol, 0, Button1, setlayout, {0} },
@ -128,3 +152,4 @@ static const Button buttons[] = {
{ ClkTagBar, MODKEY, Button1, tag, {0} }, { ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} }, { ClkTagBar, MODKEY, Button3, toggletag, {0} },
}; };