Minor tweaks

main
kvj 2023-10-24 12:46:31 +02:00
parent 4cc3ea3e1a
commit 1b91a8df3d
12 changed files with 3517 additions and 61 deletions

0
barinfo Normal file → Executable file
View File

227
config.def.h.orig Normal file
View File

@ -0,0 +1,227 @@
/* See LICENSE file for copyright and license details. */
/* appearance */
#include <X11/XF86keysym.h>
static const unsigned int borderpx = 1; /* border pixel of windows */
static const int user_bh = 27; /* 0 means that dwm will calculate bar height, >=
1 means dwm will user_bh as bar height */
static const int swallowfloating =
0; /* 1 means swallow floating windows by default */
static const unsigned int snap = 1; /* snap pixel */
static const unsigned int gappih = 6; /* horiz inner gap between windows */
static const unsigned int gappiv = 6; /* vert inner gap between windows */
static const unsigned int gappoh =
6; /* horiz outer gap between windows and screen edge */
static const unsigned int gappov =
6; /* vert outer gap between windows and screen edge */
static const char buttonbar[] = "";
static int smartgaps =
0; /* 1 means no outer gap when there is only one window */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const int horizpadbar = 3; /* horizontal padding for statusbar */
static const int vertpadbar = 10; /* vertical padding for statusbar */
static const int vertpad = 0; /* vertical padding of bar */
static const int sidepad = 0; /* horizontal padding of bar */
static const unsigned int systraypinning =
0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor
X */
static const unsigned int systrayonleft =
0; /* 0: systray in the right corner, >0: systray on left of status text */
static const unsigned int systrayspacing = 2; /* systray spacing */
static const int systraypinningfailfirst =
1; /* 1: if pinning fails, display systray on the first monitor, False:
display systray on the last monitor*/
static const unsigned int systrayiconsize = 20; /* systray icon size in px */
static const int showsystray = 1; /* 0 means no systray */
static const char *fonts[] = {
"Iosevka Nerd Font:size=12:style=Regular",
"Noto Color Emoji:size=12:antialias=true:autohint=true",
"Material Design Icons Desktop:size=11"};
static const char dmenufont[] = "Iosevka Nerd Font:size=12";
static const char col_back[] = "#121111";
static const char col_gray1[] = "#212126";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#dbdfdf";
static const char col_blue[] = "#808fbe";
static const char col_orange[] = "#eaac79";
static const char col_red[] = "#c15a5e";
static const char col_green[] = "#8fa176";
static const char col_cyan[] = "#8cb5af";
static const char col_yellow[] = "#d8b170";
static const char col_magenta[] = "#b183ba";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = {col_gray3, col_back, col_gray2},
[SchemeBtn] = {col_blue, col_gray1, col_gray2},
[SchemeLt] = {col_gray4, col_back, col_gray2},
[SchemeSel] = {col_gray4, col_blue, col_blue},
};
static const char *tagsel[][2] = {
{col_green, col_back}, {col_red, col_back}, {col_yellow, col_back},
{col_blue, col_back}, {col_magenta, col_back}, {col_cyan, col_back},
};
typedef struct {
const char *name;
const void *cmd;
} Sp;
const char *spcmd1[] = {"st", "-n", "spterm", "-g", "120x28", NULL};
const char *spcmd2[] = {"st", "-n", "spmpd", "-e", "ncmpcpp", NULL};
static Sp scratchpads[] = {
/* name cmd */
{"spterm", spcmd1},
{"spmpd", spcmd2},
};
static const StatusCmd statuscmds[] = {
{"~/.local/bin/statusbar/power", 1},
{"~/.local/bin/statusbar/wifi", 2},
{"~/.local/bin/statusbar/calendar", 3},
{"~/.local/bin/statusbar/battery", 4},
{"~/.local/bin/statusbar/sound", 5},
{"~/.local/bin/statusbar/mindash", 6},
{"~/.local/bin/statusbar/mincalendar", 7},
{"~/.local/bin/statusbar/notifications", 8},
};
static const char *statuscmd[] = {"/bin/bash", "-c", NULL, NULL};
/* tagging */
static char *tags[] = {"cmd", "www", "dev", "chat", "sys", "med"};
static char *alttags[] = {"[cmd]", "[www]", "[dev]",
"[chat]", "[sys]", "[med]"};
static const unsigned int ulinepad =
2; /* horizontal padding between the underline and tag */
static const unsigned int ulinestroke =
2; /* thickness / height of the underline */
static const unsigned int ulinevoffset =
0; /* how far above the bottom of the bar the line should appear */
static const int ulineall =
0; /* 1 to show underline on all tags, 0 for just the active ones */
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating isterminal
noswallow monitor */
{"Gimp", NULL, NULL, 0, 1, 0, 0, -1},
{"Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1},
{"st-256color", NULL, NULL, 0, 0, 1, 0, -1},
{NULL, NULL, "Event Tester", 0, 0, 0, 1, -1}, /* xev */
{NULL, "spterm", NULL, SPTAG(0), 1, 1, 0, -1},
{NULL, "spmpd", NULL, SPTAG(1), 1, 1, 0, -1},
};
/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints =
1; /* 1 means respect size hints in tiled resizals */
static const int lockfullscreen =
1; /* 1 will force focus on the fullscreen window */
#define FORCE_VSPLIT \
1 /* nrowgrid layout: force two clients to always split vertically */
#include "vanitygaps.c"
static const Layout layouts[] = {
/* symbol arrange function */
{"[]", tile}, /* first entry is default */
{"//", NULL}, /* no layout function means floating behavior */
{"[@]", spiral}, {"[\\]", dwindle},
{"[M]", monocle}, {"|M|", centeredmaster},
{NULL, NULL},
};
/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY, TAG) \
{MODKEY, KEY, view, {.ui = 1 << TAG}}, \
{MODKEY | ControlMask, KEY, toggleview, {.ui = 1 << TAG}}, \
{MODKEY | ShiftMask, KEY, tag, {.ui = 1 << TAG}}, \
{MODKEY | ControlMask | ShiftMask, KEY, toggletag, {.ui = 1 << TAG}},
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) \
{ \
.v = (const char *[]) { "/bin/sh", "-c", cmd, NULL } \
}
/* commands */
static const char *btncmd[] = {"rofi", "-show", "drun", NULL};
static const Key keys[] = {
/* modifier key function argument */
{MODKEY, XK_b, togglebar, {0}},
{MODKEY, XK_j, focusstack, {.i = +1}},
{MODKEY, XK_k, focusstack, {.i = -1}},
{MODKEY, XK_i, incnmaster, {.i = +1}},
{MODKEY, XK_d, incnmaster, {.i = -1}},
{MODKEY, XK_h, setmfact, {.f = -0.05}},
{MODKEY, XK_l, setmfact, {.f = +0.05}},
{MODKEY | ShiftMask, XK_h, setcfact, {.f = +0.25}},
{MODKEY | ShiftMask, XK_l, setcfact, {.f = -0.25}},
{MODKEY | ShiftMask, XK_o, setcfact, {.f = 0.00}},
{MODKEY, XK_Return, zoom, {0}},
{MODKEY | Mod4Mask, XK_u, incrgaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_u, incrgaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_i, incrigaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_i, incrigaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_o, incrogaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_o, incrogaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_6, incrihgaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_6, incrihgaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_7, incrivgaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_7, incrivgaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_8, incrohgaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_8, incrohgaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_9, incrovgaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_9, incrovgaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_0, togglegaps, {0}},
{MODKEY | Mod4Mask | ShiftMask, XK_0, defaultgaps, {0}},
{MODKEY, XK_Tab, view, {0}},
{MODKEY | ShiftMask, XK_c, killclient, {0}},
{MODKEY, XK_t, setlayout, {.v = &layouts[0]}},
{MODKEY, XK_f, setlayout, {.v = &layouts[1]}},
{MODKEY, XK_m, setlayout, {.v = &layouts[2]}},
{MODKEY | ControlMask, XK_comma, cyclelayout, {.i = -1}},
{MODKEY | ControlMask, XK_period, cyclelayout, {.i = +1}},
{MODKEY, XK_space, setlayout, {0}},
{MODKEY | ShiftMask, XK_space, togglefloating, {0}},
{MODKEY | ShiftMask, XK_f, togglefullscr, {0}},
{MODKEY, XK_0, view, {.ui = ~0}},
{MODKEY | ShiftMask, XK_0, tag, {.ui = ~0}},
{MODKEY, XK_comma, focusmon, {.i = -1}},
{MODKEY, XK_period, focusmon, {.i = +1}},
{MODKEY | ShiftMask, XK_comma, tagmon, {.i = -1}},
{MODKEY | ShiftMask, XK_period, tagmon, {.i = +1}},
{MODKEY | ShiftMask, XK_b, togglescratch, {.ui = 0}},
{MODKEY | ShiftMask, XK_v, togglescratch, {.ui = 1}},
TAGKEYS(XK_1, 0) TAGKEYS(XK_2, 1) TAGKEYS(XK_3, 2) TAGKEYS(XK_4, 3)
TAGKEYS(XK_5, 4) TAGKEYS(XK_6, 5)
TAGKEYS(XK_7, 6){MODKEY | ShiftMask, XK_q, quit, {0}},
};
/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
* ClkClientWin, or ClkRootWin */
static const Button buttons[] = {
/* click event mask button function argument */
{ClkButton, 0, Button1, spawn, {.v = btncmd}},
{ClkLtSymbol, 0, Button1, setlayout, {0}},
{ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]}},
{ClkStatusText, 0, Button1, spawn, {.v = statuscmd}},
{ClkStatusText, 0, Button2, spawn, {.v = statuscmd}},
{ClkStatusText, 0, Button3, spawn, {.v = statuscmd}},
{ClkClientWin, MODKEY, Button1, movemouse, {0}},
{ClkClientWin, MODKEY, Button2, togglefloating, {0}},
{ClkClientWin, MODKEY, Button3, resizemouse, {0}},
{ClkTagBar, 0, Button1, view, {0}},
{ClkTagBar, 0, Button3, toggleview, {0}},
{ClkTagBar, MODKEY, Button1, tag, {0}},
{ClkTagBar, MODKEY, Button3, toggletag, {0}},
};

18
config.def.h.rej Normal file
View File

@ -0,0 +1,18 @@
--- config.def.h
+++ config.def.h
@@ -5,7 +5,6 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
-static const char buttonbar[] = "<O>";
static const char *fonts[] = { "monospace:size=10" };
static const char dmenufont[] = "monospace:size=10";
static const char col_gray1[] = "#222222";
@@ -101,7 +100,6 @@ static Key keys[] = {
/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument */
- { ClkButton, 0, Button1, spawn, {.v = dmenucmd } },
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} },

View File

@ -9,18 +9,17 @@ static const int user_bh = 27; /* 0 means that dwm will calculate bar height, >=
static const int swallowfloating =
0; /* 1 means swallow floating windows by default */
static const unsigned int snap = 1; /* snap pixel */
static const unsigned int gappih = 6; /* horiz inner gap between windows */
static const unsigned int gappiv = 6; /* vert inner gap between windows */
static const unsigned int gappih = 7; /* horiz inner gap between windows */
static const unsigned int gappiv = 7; /* vert inner gap between windows */
static const unsigned int gappoh =
6; /* horiz outer gap between windows and screen edge */
7; /* horiz outer gap between windows and screen edge */
static const unsigned int gappov =
6; /* vert outer gap between windows and screen edge */
static const char buttonbar[] = "";
7; /* vert outer gap between windows and screen edge */
static int smartgaps =
0; /* 1 means no outer gap when there is only one window */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const int horizpadbar = 3; /* horizontal padding for statusbar */
static const int horizpadbar = 10; /* horizontal padding for statusbar */
static const int vertpadbar = 10; /* vertical padding for statusbar */
static const int vertpad = 0; /* vertical padding of bar */
static const int sidepad = 0; /* horizontal padding of bar */
@ -40,7 +39,7 @@ static const char *fonts[] = {
"Noto Color Emoji:size=12:antialias=true:autohint=true",
"Material Design Icons Desktop:size=11"};
static const char dmenufont[] = "Iosevka Nerd Font:size=12";
static const char col_back[] = "#121111";
static const char col_back[] = "#010101";
static const char col_gray1[] = "#212126";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
@ -55,10 +54,10 @@ static const char col_magenta[] = "#b183ba";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = {col_gray3, col_back, col_gray2},
[SchemeBtn] = {col_blue, col_gray1, col_gray2},
[SchemeLt] = {col_gray4, col_back, col_gray2},
[SchemeSel] = {col_gray4, col_blue, col_blue},
[SchemeNorm] = {col_gray3, col_back, col_gray1},
[SchemeBtn] = {col_blue, col_gray1, col_gray1},
[SchemeLt] = {col_gray4, col_back, col_gray1},
[SchemeSel] = {col_gray4, col_blue, col_gray2},
};
static const char *tagsel[][2] = {
{col_green, col_back}, {col_red, col_back}, {col_yellow, col_back},
@ -70,10 +69,10 @@ typedef struct {
const void *cmd;
} Sp;
const char *terminal[] = {"st", NULL};
const char *scrot[] = {"scrot", NULL};
const char *scrots[] = {"scrot", "-s", NULL};
/*const char *launch[] = {"dmenu", "-h '37'", "-nf '#bbbbbb'", "-nb '#121111'", "-sf '#dbdfdf'", "-sb '#212126'", "-p '󱎰 |Search:'", "-fn 'Iosevka Nerd Font:size=12:style=regular'", NULL};*/
const char *launch[] = {"dmenu_k", NULL};
const char *scrot[] = {"screenshot_fullscreen", NULL};
const char *scrots[] = {"screenshot_select", NULL};
/*const char *launch[] = {"dmenu_run", "-h '37'", "-nf '#bbbbbb'", "-nb '#000000'", "-sf '#dbdfdf'", "-sb '#000000'", "-p '󱎰 |Search:'", "-fn 'Iosevka Nerd Font:size=12:style=regular," ,NULL};*/
const char *launch[] = {"run", NULL};
static Sp scratchpads[] = {
/* name cmd */

249
config.h.save Normal file
View File

@ -0,0 +1,249 @@
/* See LICENSE file for copyright and license details. */
/* appearance */
#include <X11/XF86keysym.h>
static const unsigned int borderpx = 2; /* border pixel of windows */
static const int user_bh = 27; /* 0 means that dwm will calculate bar height, >=
1 means dwm will user_bh as bar height */
static const int swallowfloating =
0; /* 1 means swallow floating windows by default */
static const unsigned int snap = 1; /* snap pixel */
static const unsigned int gappih = 6; /* horiz inner gap between windows */
static const unsigned int gappiv = 6; /* vert inner gap between windows */
static const unsigned int gappoh =
6; /* horiz outer gap between windows and screen edge */
static const unsigned int gappov =
6; /* vert outer gap between windows and screen edge */
static const char buttonbar[] = " ";
static int smartgaps =
0; /* 1 means no outer gap when there is only one window */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const int horizpadbar = 3; /* horizontal padding for statusbar */
static const int vertpadbar = 10; /* vertical padding for statusbar */
static const int vertpad = 0; /* vertical padding of bar */
static const int sidepad = 0; /* horizontal padding of bar */
static const unsigned int systraypinning =
0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor
X */
static const unsigned int systrayonleft =
0; /* 0: systray in the right corner, >0: systray on left of status text */
static const unsigned int systrayspacing = 2; /* systray spacing */
static const int systraypinningfailfirst =
1; /* 1: if pinning fails, display systray on the first monitor, False:
display systray on the last monitor*/
static const unsigned int systrayiconsize = 20; /* systray icon size in px */
static const int showsystray = 1; /* 0 means no systray */
static const char *fonts[] = {
"Iosevka Nerd Font:size=12:style=Regular",
"Noto Color Emoji:size=12:antialias=true:autohint=true",
"Material Design Icons Desktop:size=11"};
static const char dmenufont[] = "Iosevka Nerd Font:size=12";
static const char col_back[] = "#121111";
static const char col_gray1[] = "#212126";:q
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#dbdfdf";
static const char col_blue[] = "#808fbe";
static const char col_orange[] = "#eaac79";
static const char col_red[] = "#c15a5e";
static const char col_green[] = "#8fa176";
static const char col_cyan[] = "#8cb5af";
static const char col_yellow[] = "#d8b170";
static const char col_magenta[] = "#b183ba";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = {col_gray3, col_back, col_gray2},
[SchemeBtn] = {col_blue, col_gray1, col_gray2},
[SchemeLt] = {col_gray4, col_back, col_gray2},
[SchemeSel] = {col_gray4, col_blue, col_blue},
};
static const char *tagsel[][2] = {
{col_green, col_back}, {col_red, col_back}, {col_yellow, col_back},
{col_blue, col_back}, {col_magenta, col_back}, {col_cyan, col_back},
};
typedef struct {
const char *name;
const void *cmd;
} Sp;
const char *terminal[] = {"st", NULL};
const char *scrot[] = {"scrot", NULL};
const char *scrots[] = {"scrot", "-s", NULL};
const char *launch[] = {"dmenu_run", "-h '37'", "-nf '#bbbbbb'", "-nb '#121111'", "-sf '#dbdfdf'", "-sb '#212126'", "-p '󱎰 |Search:'", "-fn 'Iosevka Nerd Font:size=12:style=regular," ,NULL};
static Sp scratchpads[] = {
/* name cmd */
{"launch", launch},
{"terminal", terminal},
{"scrot", scrot},
{"scrots", scrots},
};
#include <X11/XF86keysym.h>
/* Add somewhere in your constants definition section */
static const char *upvol[] = { "pactl", "set-sink-volume", "0", "+5%", NULL };
static const char *downvol[] = { "pactl", "set-sink-volume", "0", "-5%", NULL };
static const char *mutevol[] = { "pactl", "set-sink-mute", "0", "toggle", NULL };
static const StatusCmd statuscmds[] = {
{"~/.local/bin/statusbar/power", 1},
{"~/.local/bin/statusbar/wifi", 2},
{"~/.local/bin/statusbar/calendar", 3},
{"~/.local/bin/statusbar/battery", 4},
{"~/.local/bin/statusbar/sound", 5},
{"~/.local/bin/statusbar/mindash", 6},
{"~/.local/bin/statusbar/mincalendar", 7},
{"~/.local/bin/statusbar/notifications", 8},
};
static const char *statuscmd[] = {"/bin/bash", "-c", NULL, NULL};
/* tagging */
static char *tags[] = {"cmd", "www", "dev", "chat", "sys", "med"};
static char *alttags[] = {"[cmd]", "[www]", "[dev]",
"[chat]", "[sys]", "[med]"};
static const unsigned int ulinepad =
2; /* horizontal padding between the underline and tag */
static const unsigned int ulinestroke =
2; /* thickness / height of the underline */
static const unsigned int ulinevoffset =
0; /* how far above the bottom of the bar the line should appear */
static const int ulineall =
0; /* 1 to show underline on all tags, 0 for just the active ones */
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating isterminal
noswallow monitor */
{"Gimp", NULL, NULL, 0, 1, 0, 0, -1},
{"Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1},
{"st-256color", NULL, NULL, 0, 0, 1, 0, -1},
{NULL, NULL, "Event Tester", 0, 0, 0, 1, -1}, /* xev */
{NULL, "spterm", NULL, SPTAG(0), 1, 1, 0, -1},
{NULL, "spmpd", NULL, SPTAG(1), 1, 1, 0, -1},
};
/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints =
1; /* 1 means respect size hints in tiled resizals */
static const int lockfullscreen =
1; /* 1 will force focus on the fullscreen window */
#define FORCE_VSPLIT \
1 /* nrowgrid layout: force two clients to always split vertically */
#include "vanitygaps.c"
/*#include "layout_grid.h"
#include "layout_grid.c"*/
static const Layout layouts[] = {
/* symbol arrange function */
{"[]", tile}, /* first entry is default */
{"{}", spiral},
{"//", NULL}, /* no layout function means floating behavior */
/* {"[@]", spiral}, {"[\\]", dwindle},*/
{"[M]", monocle}, {"|M|", centeredmaster},
{NULL, NULL},
};
/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY, TAG) \
{MODKEY, KEY, view, {.ui = 1 << TAG}}, \
{MODKEY | ControlMask, KEY, toggleview, {.ui = 1 << TAG}}, \
{MODKEY | ShiftMask, KEY, tag, {.ui = 1 << TAG}}, \
{MODKEY | ControlMask | ShiftMask, KEY, toggletag, {.ui = 1 << TAG}},
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) \
{ \
.v = (const char *[]) { "/bin/sh", "-c", cmd, NULL } \
}
/* commands */
static const Key keys[] = {
/* modifier key function argument */
{MODKEY, XK_Print, spawn, {.v = scrot} },
{MODKEY | ShiftMask, XK_Print, spawn, {.v = scrots } },
{MODKEY, XK_e, spawn, {.v = terminal } },
{MODKEY, XK_d, spawn, {.v = launch } },
{MODKEY, XK_b, togglebar, {0}},
{ 0, XK_F11, spawn, {.v = downvol } },
{ 0, XK_F10, spawn, {.v = mutevol } },
{ 0, XK_F12, spawn, {.v = upvol } },
/*boring stuff*/
{MODKEY, XK_j, focusstack, {.i = +1}},
{MODKEY, XK_k, focusstack, {.i = -1}},
{MODKEY, XK_i, incnmaster, {.i = +1}},
{MODKEY, XK_h, setmfact, {.f = -0.05}},
{MODKEY, XK_l, setmfact, {.f = +0.05}},
{MODKEY | ShiftMask, XK_h, setcfact, {.f = +0.25}},
{MODKEY | ShiftMask, XK_l, setcfact, {.f = -0.25}},
{MODKEY | ShiftMask, XK_o, setcfact, {.f = 0.00}},
{MODKEY, XK_Return, zoom, {0}},
{MODKEY | Mod4Mask, XK_u, incrgaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_u, incrgaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_i, incrigaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_i, incrigaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_o, incrogaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_o, incrogaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_6, incrihgaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_6, incrihgaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_7, incrivgaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_7, incrivgaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_8, incrohgaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_8, incrohgaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_9, incrovgaps, {.i = +1}},
{MODKEY | Mod4Mask | ShiftMask, XK_9, incrovgaps, {.i = -1}},
{MODKEY | Mod4Mask, XK_0, togglegaps, {0}},
{MODKEY | Mod4Mask | ShiftMask, XK_0, defaultgaps, {0}},
{MODKEY, XK_Tab, view, {0}},
{MODKEY, XK_w, killclient, {0}},
{MODKEY, XK_t, setlayout, {.v = &layouts[0]}},
{MODKEY | ShiftMask, XK_f, setlayout, {.v = &layouts[1]}},
{MODKEY, XK_m, setlayout, {.v = &layouts[2]}},
{MODKEY | ControlMask, XK_comma, cyclelayout, {.i = -1}},
{MODKEY | ControlMask, XK_period, cyclelayout, {.i = +1}},
{MODKEY, XK_space, setlayout, {0}},
{MODKEY, XK_s, togglefloating, {0}},
{MODKEY, XK_f, togglefullscr, {0}},
{MODKEY, XK_0, view, {.ui = ~0}},
{MODKEY | ShiftMask, XK_0, tag, {.ui = ~0}},
{MODKEY, XK_comma, focusmon, {.i = -1}},
{MODKEY, XK_period, focusmon, {.i = +1}},
{MODKEY | ShiftMask, XK_comma, tagmon, {.i = -1}},
{MODKEY | ShiftMask, XK_period, tagmon, {.i = +1}},
{MODKEY | ShiftMask, XK_b, togglescratch, {.ui = 0}},
{MODKEY | ShiftMask, XK_v, togglescratch, {.ui = 1}},
TAGKEYS(XK_1, 0) TAGKEYS(XK_2, 1) TAGKEYS(XK_3, 2) TAGKEYS(XK_4, 3)
TAGKEYS(XK_5, 4) TAGKEYS(XK_6, 5)
TAGKEYS(XK_7, 6){MODKEY | ShiftMask, XK_q, quit, {0}},
};
/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
* ClkClientWin, or ClkRootWin */
static const Button buttons[] = {
/* click event mask button function argument */
{ClkButton, 0, Button1, spawn, {.v = launch}},
{ClkLtSymbol, 0, Button1, setlayout, {0}},
{ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]}},
{ClkStatusText, 0, Button1, spawn, {.v = statuscmd}},
{ClkStatusText, 0, Button2, spawn, {.v = statuscmd}},
{ClkStatusText, 0, Button3, spawn, {.v = statuscmd}},
{ClkClientWin, MODKEY, Button1, movemouse, {0}},
{ClkClientWin, MODKEY, Button2, togglefloating, {0}},
{ClkClientWin, MODKEY, Button3, resizemouse, {0}},
{ClkTagBar, 0, Button1, view, {0}},
{ClkTagBar, 0, Button3, toggleview, {0}},
{ClkTagBar, MODKEY, Button1, tag, {0}},
{ClkTagBar, MODKEY, Button3, toggletag, {0}},
};

BIN
drw.o

Binary file not shown.

BIN
dwm

Binary file not shown.

55
dwm.c
View File

@ -586,49 +586,15 @@ void buttonpress(XEvent *e) {
i = x = occ = 0;
/* Bitmask of occupied tags */
for (c = m->clients; c; c = c->next)
occ |= c->tags;
x += TEXTW(buttonbar);
if (ev->x < x) {
click = ClkButton;
} else {
do
x += TEXTW(occ & 1 << i ? alttags[i] : tags[i]);
while (ev->x >= x && ++i < LENGTH(tags));
if (i < LENGTH(tags)) {
click = ClkTagBar;
arg.ui = 1 << i;
} else if (ev->x < x + TEXTW(selmon->ltsymbol))
click = ClkLtSymbol;
else if (ev->x > selmon->ww - statusw - stw - 2 * sp) {
char *text, *s, ch;
*lastbutton = '0' + ev->button;
x = selmon->ww - statusw - stw - 2 * sp - getsystraywidth();
click = ClkStatusText;
statuscmdn = 0;
for (text = s = stext; *s && x <= ev->x; s++) {
if ((unsigned char)(*s) < ' ') {
ch = *s;
*s = '\0';
x += TEXTW(text) - lrpad;
*s = ch;
text = s + 1;
if (x >= ev->x)
break;
statuscmdn = ch;
} else if (*s == '^') {
*s = '\0';
x += TEXTW(text) - lrpad;
*s = '^';
if (*(++s) == 'f')
x += atoi(++s);
while (*(s++) != '^')
;
text = s;
s--;
}
}
}
}
do
x += TEXTW(tags[i]);
while (ev->x >= x && ++i < LENGTH(tags));
if (i < LENGTH(tags)) {
click = ClkTagBar;
arg.ui = 1 << i;}
else if (ev->x > selmon->ww - TEXTW(stext))
click = ClkStatusText;
} else if ((c = wintoclient(ev->window))) {
focus(c);
restack(selmon);
@ -1097,9 +1063,6 @@ void drawbar(Monitor *m) {
urg |= c->tags;
}
x = 0;
w = TEXTW(buttonbar);
drw_setscheme(drw, scheme[SchemeBtn]);
x = drw_text(drw, x, 0, w, bh, lrpad / 2, buttonbar, 0);
for (i = 0; i < LENGTH(tags); i++) {
tagtext = occ & 1 << i ? alttags[i] : tags[i];
w = TEXTW(tagtext);

2943
dwm.c.orig Normal file

File diff suppressed because it is too large Load Diff

57
dwm.c.rej Normal file
View File

@ -0,0 +1,57 @@
--- dwm.c
+++ dwm.c
@@ -64,7 +64,7 @@ enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
-enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkButton, ClkWinTitle,
+enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
typedef union {
@@ -431,23 +431,18 @@ buttonpress(XEvent *e)
}
if (ev->window == selmon->barwin) {
i = x = 0;
- x += TEXTW(buttonbar);
- if(ev->x < x) {
- click = ClkButton;
- } else {
- do
- x += TEXTW(tags[i]);
- while (ev->x >= x && ++i < LENGTH(tags));
- if (i < LENGTH(tags)) {
- click = ClkTagBar;
- arg.ui = 1 << i;
- } else if (ev->x < x + blw)
- click = ClkLtSymbol;
- else if (ev->x > selmon->ww - TEXTW(stext))
- click = ClkStatusText;
- else
- click = ClkWinTitle;
- }
+ do
+ x += TEXTW(tags[i]);
+ while (ev->x >= x && ++i < LENGTH(tags));
+ if (i < LENGTH(tags)) {
+ click = ClkTagBar;
+ arg.ui = 1 << i;
+ } else if (ev->x < x + blw)
+ click = ClkLtSymbol;
+ else if (ev->x > selmon->ww - TEXTW(stext))
+ click = ClkStatusText;
+ else
+ click = ClkWinTitle;
} else if ((c = wintoclient(ev->window))) {
focus(c);
restack(selmon);
@@ -719,9 +714,6 @@ drawbar(Monitor *m)
urg |= c->tags;
}
x = 0;
- w = blw = TEXTW(buttonbar);
- drw_setscheme(drw, scheme[SchemeNorm]);
- x = drw_text(drw, x, 0, w, bh, lrpad / 2, buttonbar, 0);
for (i = 0; i < LENGTH(tags); i++) {
w = TEXTW(tags[i]);
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);

BIN
dwm.o

Binary file not shown.

BIN
util.o

Binary file not shown.