commit c7bf484ec10a5da26fa9ef38c61e6f7dddb8c907
parent 70a4a41feabe3919ae952bf9648ce245521aa2d6
Author: klewer-martin <martin.cachari@gmail.com>
Date: Fri, 15 Oct 2021 13:55:47 -0300
Synced inspiron dwm build, and also tmux, vimrc, and x config files
Diffstat:
17 files changed, 574 insertions(+), 101 deletions(-)
diff --git a/.Xresources b/.Xresources
@@ -0,0 +1 @@
+Xcursor.size: 16
diff --git a/.config/dwm/config.def.h b/.config/dwm/config.def.h
@@ -1,11 +1,11 @@
/* appearance */
-static const unsigned int borderpx = 2; /* border pixel of windows */
-static const unsigned int snap = 8; /* snap pixel */
-static const unsigned int gappih = 20; /* horiz inner gap between windows */
-static const unsigned int gappiv = 9; /* vert inner gap between windows */
-static const unsigned int gappoh = 23; /* horiz outer gap between windows and screen edge */
-static const unsigned int gappov = 22; /* 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 unsigned int borderpx = 0; /* border pixel of windows */
+static const unsigned int snap = 16; /* snap pixel */
+static const unsigned int gappih = 3; /* horiz inner gap between windows */
+static const unsigned int gappiv = 3; /* vert inner gap between windows */
+static const unsigned int gappoh = 6; /* horiz outer gap between windows and screen edge */
+static const unsigned int gappov = 8; /* vert outer gap between windows and screen edge */
+static int smartgaps = 1; /* 1 means no outer gap when there is only one window */
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 = 0; /* systray spacing */
@@ -13,12 +13,11 @@ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display
static const int showsystray = 1; /* 0 means no systray */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 0; /* 0 means bottom bar */
-static const char *fonts[] = { "Source Code Pro:style=Regular:size=8", "JoyPixels:style=Regular:size=7:antialias=true:autohint=true" };
-static const char dmenufont[] = { "JoyPixels:style=Regular:size=7:antialias=true:autohint=true" };
-//static const char dmenufont[] = "DejaVuSansMono Nerd Font:style=Regular:size=8";
+static const char *fonts[] = { "Source Code Pro:style=Regular:size=8", "JoyPixels:style=Regular:size=7:antialias=true:autohint=true", "DejaVu Sans" };
+static const char dmenufont[] = "DejaVuSansMono Nerd Font:style=Regular:size=8";
static const char col_gray1[] = "#000000";
static const char col_gray2[] = "#444444";
-static const char col_gray3[] = "#bbbbbb";
+static const char col_gray3[] = "#cccccc";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
static const char col_blue[] = "#0055ff";
@@ -26,6 +25,8 @@ static const char col_red[] = "#ff1100";
static const char col_orange[] = "#ff1100";
static const char col_violet[] = "#EE82EE";
static const char col_darkmagenta[] = "#8B008B";
+/* static const unsigned int baralpha = 0xd0; */
+/* static const unsigned int borderalpha = OPAQUE; */
static const char *colors[][3] = {
/* fg bg border */
@@ -34,6 +35,12 @@ static const char *colors[][3] = {
[SchemeTitle] = { col_gray4, col_gray1, col_cyan },
};
+/* static const unsigned int alphas[][3] = { */
+/* /1* fg bg border *1/ */
+/* [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, */
+/* [SchemeSel] = { OPAQUE, baralpha, borderalpha }, */
+/* }; */
+
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" };
@@ -42,11 +49,11 @@ static const Rule rules[] = {
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
- /* class instance title tags mask isfloating monitor */
- { "Gimp", NULL, NULL, 0, 1, -1 },
- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
-// { "Calculator", NULL, NULL, 1 << 8, 1, -1 },
- { "calculator", NULL, NULL, 0, 1, -1 },
+ /* class instance title tags mask isfloating monitor float x,y,w,h floatborderpx*/
+ { "Gimp", NULL, NULL, 0, 0, -1 },
+ { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
+ { "calculator", NULL, NULL, 0, 1, -1, 80,50,400,300, 1 },
+ { "floating", NULL, NULL, 0, 1, -1, 80,50,800,600, 0 },
};
/* layout(s) */
@@ -92,33 +99,39 @@ static const Layout layouts[] = {
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
-static const char *dmenucmd[] = { "dmenu_run_history", "-h", "16", "-b", "-m", dmenumon, /*"-fn", dmenufont, */"-nb", col_gray1, "-nf", col_gray3, "-sb", col_darkmagenta, "-sf", col_gray4, NULL };
-/* static const char *dmenucmd[] = { "dmenu_run", NULL }; */
-/* static const char *termcmd[] = { "alacritty", "-o", "cursor.style.blinking=Always", NULL }; */
+static const char *dmenucmd[] = { "dmenu_run_history", "-h", "16", "-b", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_darkmagenta, "-sf", col_gray4, NULL };
+/* static const char *termcmd[] = { "alacritty", "-o", "cursor.style.blinking=Always", NULL }; */
static const char *termcmd[] = { "kitty", NULL };
+static const char *ftermcmd[] = { "kitty", "--class", "floating", NULL };
static const char *webcmd[] = { "firefox", NULL };
static const char *filescmd[] = { "alacritty", "-e", "ranger", NULL };
-static const char *gfilescmd[] = { "pcmanfm-qt", NULL };
+static const char *gfilescmd[] = { "pcmanfm-qt", "-n", NULL };
static const char *bookscmd[] = { "openbook", "-nb", col_gray1, "-nf", col_gray3, "-sb", col_darkmagenta, "-sf", col_gray4, NULL };
static const char *spotifycmd[] = { "spotify", NULL };
static const char *virtualboxcmd[] = { "virtualbox", NULL };
static const char *calccmd[] = { "gnome-calculator", NULL };
+static const char *lutriscmd[] = { "lutris", NULL };
+static const char *switchkblayout[] = { "switchkblayout", NULL };
+
/* commands spawned when clicking statusbar, the mouse button pressed is exported as BUTTON */
-static char *statuscmds[] = { "notify-send Mouse$BUTTON" };
+static char *statuscmds[] = { "notify-send -r Mouse$BUTTON" };
static char *statuscmd[] = { "/bin/sh", "-c", NULL, NULL };
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_d, spawn, {.v = dmenucmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
+ { MODKEY|ShiftMask, XK_Return, spawn, {.v = ftermcmd } },
{ MODKEY, XK_w, spawn, {.v = webcmd } },
- { MODKEY, XK_e, spawn, {.v = filescmd } },
- { MODKEY|ShiftMask, XK_e, spawn, {.v = gfilescmd } },
+ { MODKEY, XK_e, spawn, {.v = gfilescmd } },
+ { MODKEY, XK_z, spawn, {.v = lutriscmd } },
+ { MODKEY|ShiftMask, XK_e, spawn, {.v = filescmd } },
{ MODKEY, XK_v, spawn, {.v = virtualboxcmd } },
{ MODKEY, XK_b, spawn, {.v = bookscmd } },
{ MODKEY, XK_s, spawn, {.v = spotifycmd } },
{ MODKEY, XK_c, spawn, {.v = calccmd } },
+ { MODKEY|MOD2KEY, XK_l, spawn, {.v = switchkblayout } },
{ MODKEY|ShiftMask, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
diff --git a/.config/dwm/config.h b/.config/dwm/config.h
@@ -1,11 +1,11 @@
/* appearance */
-static const unsigned int borderpx = 2; /* border pixel of windows */
-static const unsigned int snap = 8; /* snap pixel */
-static const unsigned int gappih = 20; /* horiz inner gap between windows */
-static const unsigned int gappiv = 9; /* vert inner gap between windows */
-static const unsigned int gappoh = 23; /* horiz outer gap between windows and screen edge */
-static const unsigned int gappov = 22; /* 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 unsigned int borderpx = 0; /* border pixel of windows */
+static const unsigned int snap = 16; /* snap pixel */
+static const unsigned int gappih = 3; /* horiz inner gap between windows */
+static const unsigned int gappiv = 3; /* vert inner gap between windows */
+static const unsigned int gappoh = 6; /* horiz outer gap between windows and screen edge */
+static const unsigned int gappov = 8; /* vert outer gap between windows and screen edge */
+static int smartgaps = 1; /* 1 means no outer gap when there is only one window */
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 = 0; /* systray spacing */
@@ -13,12 +13,11 @@ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display
static const int showsystray = 1; /* 0 means no systray */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 0; /* 0 means bottom bar */
-static const char *fonts[] = { "Source Code Pro:style=Regular:size=8", "JoyPixels:style=Regular:size=7:antialias=true:autohint=true" };
-static const char dmenufont[] = { "JoyPixels:style=Regular:size=7:antialias=true:autohint=true" };
-//static const char dmenufont[] = "DejaVuSansMono Nerd Font:style=Regular:size=8";
+static const char *fonts[] = { "Source Code Pro:style=Regular:size=8", "JoyPixels:style=Regular:size=7:antialias=true:autohint=true", "DejaVu Sans" };
+static const char dmenufont[] = "DejaVuSansMono Nerd Font:style=Regular:size=8";
static const char col_gray1[] = "#000000";
static const char col_gray2[] = "#444444";
-static const char col_gray3[] = "#bbbbbb";
+static const char col_gray3[] = "#cccccc";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
static const char col_blue[] = "#0055ff";
@@ -26,6 +25,8 @@ static const char col_red[] = "#ff1100";
static const char col_orange[] = "#ff1100";
static const char col_violet[] = "#EE82EE";
static const char col_darkmagenta[] = "#8B008B";
+/* static const unsigned int baralpha = 0xd0; */
+/* static const unsigned int borderalpha = OPAQUE; */
static const char *colors[][3] = {
/* fg bg border */
@@ -34,6 +35,12 @@ static const char *colors[][3] = {
[SchemeTitle] = { col_gray4, col_gray1, col_cyan },
};
+/* static const unsigned int alphas[][3] = { */
+/* /1* fg bg border *1/ */
+/* [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, */
+/* [SchemeSel] = { OPAQUE, baralpha, borderalpha }, */
+/* }; */
+
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" };
@@ -42,11 +49,11 @@ static const Rule rules[] = {
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
- /* class instance title tags mask isfloating monitor */
- { "Gimp", NULL, NULL, 0, 1, -1 },
- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
-// { "Calculator", NULL, NULL, 1 << 8, 1, -1 },
- { "calculator", NULL, NULL, 0, 1, -1 },
+ /* class instance title tags mask isfloating monitor float x,y,w,h floatborderpx*/
+ { "Gimp", NULL, NULL, 0, 0, -1 },
+ { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
+ { "calculator", NULL, NULL, 0, 1, -1, 80,50,400,300, 1 },
+ { "floating", NULL, NULL, 0, 1, -1, 80,50,800,600, 0 },
};
/* layout(s) */
@@ -92,33 +99,39 @@ static const Layout layouts[] = {
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
-static const char *dmenucmd[] = { "dmenu_run_history", "-h", "16", "-b", "-m", dmenumon, /*"-fn", dmenufont, */"-nb", col_gray1, "-nf", col_gray3, "-sb", col_darkmagenta, "-sf", col_gray4, NULL };
-/* static const char *dmenucmd[] = { "dmenu_run", NULL }; */
-/* static const char *termcmd[] = { "alacritty", "-o", "cursor.style.blinking=Always", NULL }; */
+static const char *dmenucmd[] = { "dmenu_run_history", "-h", "16", "-b", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_darkmagenta, "-sf", col_gray4, NULL };
+/* static const char *termcmd[] = { "alacritty", "-o", "cursor.style.blinking=Always", NULL }; */
static const char *termcmd[] = { "kitty", NULL };
+static const char *ftermcmd[] = { "kitty", "--class", "floating", NULL };
static const char *webcmd[] = { "firefox", NULL };
static const char *filescmd[] = { "alacritty", "-e", "ranger", NULL };
-static const char *gfilescmd[] = { "pcmanfm-qt", NULL };
+static const char *gfilescmd[] = { "pcmanfm-qt", "-n", NULL };
static const char *bookscmd[] = { "openbook", "-nb", col_gray1, "-nf", col_gray3, "-sb", col_darkmagenta, "-sf", col_gray4, NULL };
static const char *spotifycmd[] = { "spotify", NULL };
static const char *virtualboxcmd[] = { "virtualbox", NULL };
static const char *calccmd[] = { "gnome-calculator", NULL };
+static const char *lutriscmd[] = { "lutris", NULL };
+static const char *switchkblayout[] = { "switchkblayout", NULL };
+
/* commands spawned when clicking statusbar, the mouse button pressed is exported as BUTTON */
-static char *statuscmds[] = { "notify-send Mouse$BUTTON" };
+static char *statuscmds[] = { "notify-send -r Mouse$BUTTON" };
static char *statuscmd[] = { "/bin/sh", "-c", NULL, NULL };
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_d, spawn, {.v = dmenucmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
+ { MODKEY|ShiftMask, XK_Return, spawn, {.v = ftermcmd } },
{ MODKEY, XK_w, spawn, {.v = webcmd } },
- { MODKEY, XK_e, spawn, {.v = filescmd } },
- { MODKEY|ShiftMask, XK_e, spawn, {.v = gfilescmd } },
+ { MODKEY, XK_e, spawn, {.v = gfilescmd } },
+ { MODKEY, XK_z, spawn, {.v = lutriscmd } },
+ { MODKEY|ShiftMask, XK_e, spawn, {.v = filescmd } },
{ MODKEY, XK_v, spawn, {.v = virtualboxcmd } },
{ MODKEY, XK_b, spawn, {.v = bookscmd } },
{ MODKEY, XK_s, spawn, {.v = spotifycmd } },
{ MODKEY, XK_c, spawn, {.v = calccmd } },
+ { MODKEY|MOD2KEY, XK_l, spawn, {.v = switchkblayout } },
{ MODKEY|ShiftMask, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
diff --git a/.config/dwm/drw.c b/.config/dwm/drw.c
@@ -203,6 +203,8 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
DefaultColormap(drw->dpy, drw->screen),
clrname, dest))
die("error, cannot allocate color '%s'", clrname);
+
+ dest->pixel |= 0xff << 24;
}
/* Wrapper to create color schemes. The caller has to call free(3) on the
diff --git a/.config/dwm/drw.o b/.config/dwm/drw.o
Binary files differ.
diff --git a/.config/dwm/dwm b/.config/dwm/dwm
Binary files differ.
diff --git a/.config/dwm/dwm.c b/.config/dwm/dwm.c
@@ -113,6 +113,7 @@ struct Client {
int bw, oldbw;
unsigned int tags;
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
+ int floatborderpx;
Client *next;
Client *snext;
Monitor *mon;
@@ -165,6 +166,8 @@ typedef struct {
unsigned int tags;
int isfloating;
int monitor;
+ int floatx, floaty, floatw, floath;
+ int floatborderpx;
} Rule;
typedef struct Systray Systray;
@@ -365,6 +368,13 @@ applyrules(Client *c)
{
c->isfloating = r->isfloating;
c->tags |= r->tags;
+ c->floatborderpx = r->floatborderpx;
+ if (r->isfloating) {
+ c->x = r->floatx;
+ c->y = r->floaty;
+ c->w = r->floatw;
+ c->h = r->floath;
+ }
for (m = mons; m && m->num != r->monitor; m = m->next);
if (m)
c->mon = m;
@@ -1546,7 +1556,10 @@ resizeclient(Client *c, int x, int y, int w, int h)
c->oldy = c->y; c->y = wc.y = y;
c->oldw = c->w; c->w = wc.width = w;
c->oldh = c->h; c->h = wc.height = h;
- wc.border_width = c->bw;
+ if (c->isfloating)
+ wc.border_width = c->floatborderpx;
+ else
+ wc.border_width = c->bw;
XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
configure(c);
XSync(dpy, False);
@@ -1986,6 +1999,7 @@ setup(void)
scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
for (i = 0; i < LENGTH(colors); i++)
scheme[i] = drw_scm_create(drw, colors[i], 3);
+ /* scheme[i] = drw_scm_create(drw, colors[i], alphas[i], 3); */
/* init system tray */
updatesystray();
/* init bars */
@@ -2306,6 +2320,9 @@ updatebars(void)
Monitor *m;
XSetWindowAttributes wa = {
.override_redirect = True,
+ /* .background_pixel = 0, */
+ /* .border_pixel = 0, */
+ /* .colormap = cmap, */
.background_pixmap = ParentRelative,
.event_mask = ButtonPressMask|ExposureMask
};
@@ -2317,6 +2334,9 @@ updatebars(void)
if (showsystray && m == systraytomon(m))
w -= getsystraywidth();
+ /* m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, depth, */
+ /* InputOutput, visual, */
+ /* CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa); */
m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
CopyFromParent, DefaultVisual(dpy, screen),
CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
diff --git a/.config/dwm/dwm.o b/.config/dwm/dwm.o
Binary files differ.
diff --git a/.config/dwm/patches/dwm-fixborders-6.2.diff b/.config/dwm/patches/dwm-fixborders-6.2.diff
@@ -0,0 +1,27 @@
+From 1529909466206016f2101457bbf37c67195714c8 Mon Sep 17 00:00:00 2001
+From: Jakub Leszczak <szatan@gecc.xyz>
+Date: Fri, 22 Nov 2019 10:46:53 +0800
+Subject: [PATCH] Fix transparent borders
+
+When terminal has transparency then its borders also become transparent.
+Fix it by removing transparency from any pixels drawn.
+---
+ drw.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drw.c b/drw.c
+index 8fd1ca4..490a592 100644
+--- a/drw.c
++++ b/drw.c
+@@ -202,6 +202,8 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
+ DefaultColormap(drw->dpy, drw->screen),
+ clrname, dest))
+ die("error, cannot allocate color '%s'", clrname);
++
++ dest->pixel |= 0xff << 24;
+ }
+
+ /* Wrapper to create color schemes. The caller has to call free(3) on the
+--
+2.26.2
+
diff --git a/.config/dwm/patches/dwm-floatrules-6.2.diff b/.config/dwm/patches/dwm-floatrules-6.2.diff
@@ -0,0 +1,64 @@
+diff -u dwm/config.def.h dwmnew/config.def.h
+--- dwm/config.def.h 2020-03-01 19:10:06.676821764 +1300
++++ dwmnew/config.def.h 2020-03-01 19:29:26.276901430 +1300
+@@ -26,9 +26,9 @@
+ * WM_CLASS(STRING) = instance, class
+ * WM_NAME(STRING) = title
+ */
+- /* class instance title tags mask isfloating monitor */
+- { "Gimp", NULL, NULL, 0, 1, -1 },
+- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
++ /* class instance title tags mask isfloating monitor float x,y,w,h floatborderpx*/
++ { "Gimp", NULL, NULL, 0, 1, -1, 50,50,500,500, 5 },
++ { "Firefox", NULL, NULL, 1 << 8, 0, -1, 50,50,500,500, 5 },
+ };
+
+ /* layout(s) */
+Only in dwmnew: config.h
+Only in dwmnew: drw.o
+diff -u dwm/dwm.c dwmnew/dwm.c
+--- dwm/dwm.c 2020-03-01 19:10:06.680155097 +1300
++++ dwmnew/dwm.c 2020-03-01 19:28:26.793564016 +1300
+@@ -93,6 +93,7 @@
+ int bw, oldbw;
+ unsigned int tags;
+ int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
++ int floatborderpx;
+ Client *next;
+ Client *snext;
+ Monitor *mon;
+@@ -139,6 +140,8 @@
+ unsigned int tags;
+ int isfloating;
+ int monitor;
++ int floatx, floaty, floatw, floath;
++ int floatborderpx;
+ } Rule;
+
+ /* function declarations */
+@@ -299,6 +302,13 @@
+ {
+ c->isfloating = r->isfloating;
+ c->tags |= r->tags;
++ c->floatborderpx = r->floatborderpx;
++ if (r->isfloating) {
++ c->x = r->floatx;
++ c->y = r->floaty;
++ c->w = r->floatw;
++ c->h = r->floath;
++ }
+ for (m = mons; m && m->num != r->monitor; m = m->next);
+ if (m)
+ c->mon = m;
+@@ -1281,7 +1291,10 @@
+ c->oldy = c->y; c->y = wc.y = y;
+ c->oldw = c->w; c->w = wc.width = w;
+ c->oldh = c->h; c->h = wc.height = h;
+- wc.border_width = c->bw;
++ if (c->isfloating)
++ wc.border_width = c->floatborderpx;
++ else
++ wc.border_width = c->bw;
+ XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
+ configure(c);
+ XSync(dpy, False);
diff --git a/.config/dwm/patches/dwm-statuscmd-20210405-67d76bd.diff b/.config/dwm/patches/dwm-statuscmd-20210405-67d76bd.diff
@@ -0,0 +1,208 @@
+From f58c7e4fd05ec13383518ccd51663167d45e92d0 Mon Sep 17 00:00:00 2001
+From: Daniel Bylinka <daniel.bylinka@gmail.com>
+Date: Fri, 2 Apr 2021 19:02:58 +0200
+Subject: [PATCH] [statuscmd] Signal mouse button and click location to status
+ monitor
+
+---
+ config.def.h | 6 +++-
+ dwm.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++---
+ 2 files changed, 100 insertions(+), 6 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..154a59b 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -54,6 +54,8 @@ static const Layout layouts[] = {
+ /* helper for spawning shell commands in the pre dwm-5.0 fashion */
+ #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
+
++#define STATUSBAR "dwmblocks"
++
+ /* commands */
+ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
+ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
+@@ -103,7 +105,9 @@ static Button buttons[] = {
+ { ClkLtSymbol, 0, Button1, setlayout, {0} },
+ { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
+ { ClkWinTitle, 0, Button2, zoom, {0} },
+- { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
++ { ClkStatusText, 0, Button1, sigstatusbar, {.i = 1} },
++ { ClkStatusText, 0, Button2, sigstatusbar, {.i = 2} },
++ { ClkStatusText, 0, Button3, sigstatusbar, {.i = 3} },
+ { ClkClientWin, MODKEY, Button1, movemouse, {0} },
+ { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
+ { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
+diff --git a/dwm.c b/dwm.c
+index b0b3466..d871457 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -172,6 +172,7 @@ static void focusstack(const Arg *arg);
+ static Atom getatomprop(Client *c, Atom prop);
+ static int getrootptr(int *x, int *y);
+ static long getstate(Window w);
++static pid_t getstatusbarpid();
+ static int gettextprop(Window w, Atom atom, char *text, unsigned int size);
+ static void grabbuttons(Client *c, int focused);
+ static void grabkeys(void);
+@@ -206,6 +207,7 @@ static void setup(void);
+ static void seturgent(Client *c, int urg);
+ static void showhide(Client *c);
+ static void sigchld(int unused);
++static void sigstatusbar(const Arg *arg);
+ static void spawn(const Arg *arg);
+ static void tag(const Arg *arg);
+ static void tagmon(const Arg *arg);
+@@ -238,6 +240,9 @@ static void zoom(const Arg *arg);
+ /* variables */
+ static const char broken[] = "broken";
+ static char stext[256];
++static int statusw;
++static int statussig;
++static pid_t statuspid = -1;
+ static int screen;
+ static int sw, sh; /* X display screen geometry width, height */
+ static int bh, blw = 0; /* bar geometry */
+@@ -422,6 +427,7 @@ buttonpress(XEvent *e)
+ Client *c;
+ Monitor *m;
+ XButtonPressedEvent *ev = &e->xbutton;
++ char *text, *s, ch;
+
+ click = ClkRootWin;
+ /* focus monitor if necessary */
+@@ -440,9 +446,23 @@ buttonpress(XEvent *e)
+ arg.ui = 1 << i;
+ } else if (ev->x < x + blw)
+ click = ClkLtSymbol;
+- else if (ev->x > selmon->ww - (int)TEXTW(stext))
++ else if (ev->x > selmon->ww - statusw) {
++ x = selmon->ww - statusw;
+ click = ClkStatusText;
+- else
++ statussig = 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;
++ statussig = ch;
++ }
++ }
++ } else
+ click = ClkWinTitle;
+ } else if ((c = wintoclient(ev->window))) {
+ focus(c);
+@@ -704,9 +724,24 @@ drawbar(Monitor *m)
+
+ /* draw status first so it can be overdrawn by tags later */
+ if (m == selmon) { /* status is only drawn on selected monitor */
++ char *text, *s, ch;
+ drw_setscheme(drw, scheme[SchemeNorm]);
+- tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
+- drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
++
++ x = 0;
++ for (text = s = stext; *s; s++) {
++ if ((unsigned char)(*s) < ' ') {
++ ch = *s;
++ *s = '\0';
++ tw = TEXTW(text) - lrpad;
++ drw_text(drw, m->ww - statusw + x, 0, tw, bh, 0, text, 0);
++ x += tw;
++ *s = ch;
++ text = s + 1;
++ }
++ }
++ tw = TEXTW(text) - lrpad + 2;
++ drw_text(drw, m->ww - statusw + x, 0, tw, bh, 0, text, 0);
++ tw = statusw;
+ }
+
+ for (c = m->clients; c; c = c->next) {
+@@ -872,6 +907,30 @@ getatomprop(Client *c, Atom prop)
+ return atom;
+ }
+
++pid_t
++getstatusbarpid()
++{
++ char buf[32], *str = buf, *c;
++ FILE *fp;
++
++ if (statuspid > 0) {
++ snprintf(buf, sizeof(buf), "/proc/%u/cmdline", statuspid);
++ if ((fp = fopen(buf, "r"))) {
++ fgets(buf, sizeof(buf), fp);
++ while ((c = strchr(str, '/')))
++ str = c + 1;
++ fclose(fp);
++ if (!strcmp(str, STATUSBAR))
++ return statuspid;
++ }
++ }
++ if (!(fp = popen("pidof -s "STATUSBAR, "r")))
++ return -1;
++ fgets(buf, sizeof(buf), fp);
++ pclose(fp);
++ return strtol(buf, NULL, 10);
++}
++
+ int
+ getrootptr(int *x, int *y)
+ {
+@@ -1637,6 +1696,20 @@ sigchld(int unused)
+ while (0 < waitpid(-1, NULL, WNOHANG));
+ }
+
++void
++sigstatusbar(const Arg *arg)
++{
++ union sigval sv;
++
++ if (!statussig)
++ return;
++ sv.sival_int = arg->i;
++ if ((statuspid = getstatusbarpid()) <= 0)
++ return;
++
++ sigqueue(statuspid, SIGRTMIN+statussig, sv);
++}
++
+ void
+ spawn(const Arg *arg)
+ {
+@@ -1990,8 +2063,25 @@ updatesizehints(Client *c)
+ void
+ updatestatus(void)
+ {
+- if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
++ if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) {
+ strcpy(stext, "dwm-"VERSION);
++ statusw = TEXTW(stext) - lrpad + 2;
++ } else {
++ char *text, *s, ch;
++
++ statusw = 0;
++ for (text = s = stext; *s; s++) {
++ if ((unsigned char)(*s) < ' ') {
++ ch = *s;
++ *s = '\0';
++ statusw += TEXTW(text) - lrpad;
++ *s = ch;
++ text = s + 1;
++ }
++ }
++ statusw += TEXTW(text) - lrpad + 2;
++
++ }
+ drawbar(selmon);
+ }
+
+--
+2.31.0
+
diff --git a/.config/dwm/util.o b/.config/dwm/util.o
Binary files differ.
diff --git a/autostart.sh b/.local/share/dwm/autostart.sh
diff --git a/.tmux.conf b/.tmux.conf
@@ -1,9 +1,10 @@
-# _
-# | |_ _ __ ___ _ ___ __
-# | __| '_ ` _ \| | | \ \/ /
-# | |_| | | | | | |_| |> <
-# \__|_| |_| |_|\__,_/_/\_\
-#
+# _
+# | |_ _ __ ___ _ ___ __
+# | __| '_ ` _ \| | | \ \/ /
+# | |_| | | | | | |_| |> <
+# \__|_| |_| |_|\__,_/_/\_\
+#
+# by github.com/klewer-martin
# Use prefix + vi navigation keys to navigate panes
bind h select-pane -L
@@ -17,47 +18,32 @@ set -g base-index 1
# Avoid esc delay
set -g escape-time 10
+# Enable mouse support
set -g mouse on
-source /usr/share/powerline/bindings/tmux/powerline.conf
+#source /usr/share/powerline/bindings/tmux/powerline.conf
-# bar theme
-
-set -g status-bg 'colour235'
-# set -g message-command-fg 'colour222'
+# Status bar theme
+set -g status-bg 'colour233'
set -g status-justify 'left'
set -g status-left-length '25'
set -g status 'on'
-# set -g pane-active-border-fg 'colour154'
-# set -g message-bg 'colour238'
set -g status-right-length '100'
-# set -g status-right-attr 'none'
-# set -g message-fg 'colour222'
-# set -g message-command-bg 'colour238'
-# set -g status-attr 'none'
-# set -g status-utf8 'on'
-# set -g pane-border-fg 'colour238'
-# set -g status-left-attr 'none'
-# setw -g window-status-fg 'colour121'
-# setw -g window-status-attr 'none'
-# setw -g window-status-activity-bg 'colour235'
-# setw -g window-status-activity-attr 'none'
-# setw -g window-status-activity-fg 'colour154'
setw -g window-status-separator ''
-# setw -g window-status-bg 'colour235'
-
-set -g status-left '#[fg=colour232,bg=colour154] #S #[fg=colour154,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #W #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235] #(whoami) #(uptime | cut -d " " -f 3,5 | tr -d ",") #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]'
-
-set -g status-right '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235] %a %b %a %Y %H:%M #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #H #[fg=colour154,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour232,bg=colour154] #(rainbarf --battery --remaining --no-rgb) '
-
-setw -g window-status-format '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[default] #I #W #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]'
-
-setw -g window-status-current-format '#[fg=colour235,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #I #W #F #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]'
-set -g message-command-style fg=black,bg=cyan
+set -g message-command-style fg=black,bg=green
set -g message-style fg=black,bg=cyan
-set -g pane-active-border-style fg=cyan,bg=cyan
-set -g pane-border-style fg=cyan
+set -g pane-active-border-style fg=green
+set -g pane-border-style fg=green
setw -g window-status-style fg=yellow,none
setw -g window-status-activity-style fg=green,bg=black,none
setw -g window-status-style bg=black
+
+# Status bar style
+set -g status-left '#[fg=colour232,bg=colour112] #S #[fg=colour112,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #H #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour238,bg=colour235]#[fg=colour235,bg=colour233,nobold,nounderscore,noitalics]'
+
+set -g status-right '#[fg=colour235,bg=colour233,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235]#[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] %a %d %b #[fg=colour112,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour232,bg=colour112] %H:%M '
+
+setw -g window-status-format '#[fg=colour239,bg=colour233,nobold,nounderscore,noitalics] #I #W '
+
+setw -g window-status-current-format '#[fg=colour112,bg=colour233,nobold,nounderscore,noitalics] #I #W '
diff --git a/.vimrc b/.vimrc
@@ -1,6 +1,151 @@
-syntax on
-set encoding=utf8
-set tabstop=4
-set shiftwidth=4
-set colorcolumn=80
+ source ~/.config/vim/autoload/plug.vim
+ call plug#begin('~/.config/vim/plugged')
+
+ Plug 'flw-cn/vim-nerdtree-l-open-h-close'
+ Plug 'christoomey/vim-tmux-navigator'
+ Plug 'justinmk/vim-syntax-extra'
+ Plug 'tpope/vim-commentary'
+ Plug 'jiangmiao/auto-pairs'
+ Plug 'preservim/nerdtree'
+ Plug 'morhetz/gruvbox'
+ call plug#end()
+
+" Basic settings
+ syntax on
+ set nocompatible
+ set encoding=utf-8
+ set tabstop=4
+ set shiftwidth=4
+ set viminfo+=n~/.config/vim/viminfo
+ set path+=./**
+ set incsearch
+ set smartcase
+ set smartindent
+ set number
+ set cursorline
+ set relativenumber
+ set ruler
+ set mouse+=a
+ if &term =~ 'xterm-256color'
+ " tmux knows the extended mouse mode
+ set ttymouse=xterm2
+ endif
+
+ set undofile
+ set undodir=~/.config/vim/undodir
+ set clipboard=unnamedplus
+ set nobackup
+ set nowritebackup
+ set noswapfile
+ " set noshowmode
+ set backupdir=~/.config/vim/tmp/backup
+
+ " This fixs the delay in the cursor shape when switching mode
+ set ttimeout
+ set ttimeoutlen=1
+ set listchars=tab:>-,trail:~,extends:>,precedes:<,space:.
+ set ttyfast
+
+" Keys remap
+ let mapleader = ' '
+
+ " Open file tree;
+ map <leader>f :NERDTreeToggle<CR>
+
+ " Focus file tree;
+ map <leader>F :NERDTreeFocus<CR>
+
+ " Open current dir in NERDTree
+ map <leader>r :NERDTreeFind<CR>
+
+ " Toggle Goyo
+ map <leader>g :Goyo<CR>
+
+ " Disable ex-mode keybinding (type visual thing)
+ map Q <NOP>
+
+ " Improves indenting chunks of code with '<' '>' keys
+ vnoremap < <gv
+ vnoremap > >gv
+
+ " Move between windows with Ctrl + hjkl
+ noremap <C-h> <C-w>h
+ noremap <C-j> <C-w>j
+ noremap <C-k> <C-w>k
+ noremap <C-l> <C-w>l
+
+ " Change cursor shape with modes
+ " if exists('$TMUX')
+ " let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>[6 q\<Esc>\\"
+ " let &t_SR = "\<Esc>Ptmux;\<Esc>\<Esc>[4 q\<Esc>\\"
+ " let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>[2 q\<Esc>\\"
+ " autocmd VimLeave * silent !echo -ne "\033Ptmux;\033\033[0 q\033\\"
+ " else
+ " let &t_SI = "\<Esc>[6 q"
+ " let &t_SR = "\<Esc>[4 q"
+ " let &t_EI = "\<Esc>[2 q"
+ " endif
+
+" Enable blinking together with different cursor shapes for insert/command mode, and cursor highlighting:
+ let &t_SI = "\<Esc>[5 q"
+ let &t_SR = "\<Esc>[3 q"
+ let &t_EI = "\<Esc>[1 q"
+
+ " NetRW config
+ let g:netrw_banner=0
+ let g:netrw_winsize = 25
+ let g:netrw_browse_split=2
+ let g:netrw_altv=1
+ let g:netrw_liststyle=3
+ let g:netrwJ_list_hide=netrw_gitignore#Hide()
+ let g:netrw_dirhistmax = 0 " Disable history
+
+ " Goyo settings
+ let g:goyo_linenr = 1
+ let g:goyo_width = 100
+ let g:goyo_height = 100
+ autocmd! User GoyoLeave
+
+ " Exit Vim if NERDTree is the only window remaining in the only tab.
+ autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
+
+ " This fixes the cursor shape at vim start
+ normal! i
+
+ " Set colorscheme and transparent background
+ let g:gruvbox_transparent_bg = '0'
+ let g:gruvbox_contrast_dark = 'hard'
+ set bg=dark
+
+ colorscheme gruvbox
+ " colorscheme dracula
+
+ function! AdaptColorscheme()
+ hi clear CursorLine
+ hi Normal guibg=NONE ctermbg=NONE
+ hi LineNr guibg=NONE ctermbg=NONE
+ hi Folded guibg=NONE ctermbg=NONE
+ " hi EndOfBuffer guibg=NONE ctermbg=NONE
+ hi EndOfBuffer ctermfg=12 guibg=NONE ctermbg=NONE
+ hi SpecialKey guibg=NONE ctermbg=NONE
+ hi VertSplit guibg=NONE ctermbg=NONE
+ hi SignColumn guibg=NONE ctermbg=NONE
+
+ hi TabLineSel ctermfg=LightGreen ctermbg=NONE
+ hi TabLineFill ctermfg=Gray ctermbg=NONE
+ hi Title ctermfg=LightBlue ctermbg=NONE
+
+ hi CursorLine cterm=NONE ctermbg=235
+ endfunction
+
+ call AdaptColorscheme()
+
+ " Set the split window separator (not the pipe char)
+ set fillchars+=vert:\▏
+ highlight VertSplit cterm=NONE
+
+
+ autocmd! User GoyoLeave call AdaptColorscheme()
+
+ set clipboard=unnamedplus
diff --git a/.xinitrc b/.xinitrc
@@ -1,22 +1,15 @@
-
-# swaps lock-mayus with escape & lalt with lsuper;
-# exec keyboardmap &
-
$HOME/.config/dwmblocks/dwmblocks &
-
-xrdb ~/.Xresources &
+# $HOME/.config/dwmblocks-async/dwmblocks &
nitrogen --restore &
-# xss-lock grabs a logind suspend inhibit lock and will use betterlockscreen to lock the screen before suspend.
-# exec xss-lock -l lockscreen &
+redshift &
-# start i3 window manager;
-# exec i3
+dunst &
lockscreen
-export AWT_TOOLKIT=MToolkit &
+xrdb ~/.Xresources &
# start dynamic window manager;
exec dwm
diff --git a/README.md b/README.md
@@ -7,6 +7,7 @@
* **SHELL**: Zsh with a couple of plugins, I used to use bash before I discover zsh
* **Term**: kitty because of the ligature support, I like alacritty also
* **Editor**: vim for code and sometimes vscode to write latex papers
+* **Web Browser**: Mozilla Firefox
* **Login Manager**: autologin on tty1 and starting Xserver from zshrc
```console
# Starts the X server only on tty1
@@ -16,5 +17,5 @@ logout
fi
```
* **Lockscreen**: i3lock custom [script](https://github.com/klewer-martin/scripts/blob/inspiron/lockscreen)
-* **Notifications**: Dunst is started when X starts and the dunstify to send notifications
+* **Notifications**: Dunst is started when X starts and dunstify to send notifications
* **Blue light filter**: redshift