Dotfiles config update (2022-05-21)
This commit is contained in:
parent
650b9c0d1e
commit
5b6079d88d
|
@ -112,5 +112,7 @@ ${color 4b8af4} ${color}${color e25ee6}Super + וּ + j ${color}${color 9ca
|
||||||
${color 4b8af4} ${color}${color e25ee6}Super + וּ + k ${color}${color 9ca8ce}= Switch Left${color}
|
${color 4b8af4} ${color}${color e25ee6}Super + וּ + k ${color}${color 9ca8ce}= Switch Left${color}
|
||||||
${color 4b8af4} ${color}${color e25ee6}Super + 1-9 ${color}${color 9ca8ce}= Select Workspace${color}
|
${color 4b8af4} ${color}${color e25ee6}Super + 1-9 ${color}${color 9ca8ce}= Select Workspace${color}
|
||||||
${color 4b8af4} ${color}${color e25ee6}Super + וּ + 1-9 ${color}${color 9ca8ce}= Move Workspace${color}
|
${color 4b8af4} ${color}${color e25ee6}Super + וּ + 1-9 ${color}${color 9ca8ce}= Move Workspace${color}
|
||||||
|
${color 4b8af4} ${color}${color e25ee6}Super + Ctrl + r ${color}${color 9ca8ce}= Restart${color}
|
||||||
|
${color 4b8af4} ${color}${color e25ee6}Super + Ctrl + q ${color}${color 9ca8ce}= Quit${color}
|
||||||
|
|
||||||
]];
|
]];
|
||||||
|
|
37
.config/dwm/LICENSE
Normal file
37
.config/dwm/LICENSE
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
MIT/X Consortium License
|
||||||
|
|
||||||
|
© 2006-2019 Anselm R Garbe <anselm@garbe.ca>
|
||||||
|
© 2006-2009 Jukka Salmi <jukka at salmi dot ch>
|
||||||
|
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
|
© 2007-2011 Peter Hartlich <sgkkr at hartlich dot com>
|
||||||
|
© 2007-2009 Szabolcs Nagy <nszabolcs at gmail dot com>
|
||||||
|
© 2007-2009 Christof Musik <christof at sendfax dot de>
|
||||||
|
© 2007-2009 Premysl Hruby <dfenze at gmail dot com>
|
||||||
|
© 2007-2008 Enno Gottox Boland <gottox at s01 dot de>
|
||||||
|
© 2008 Martin Hurton <martin dot hurton at gmail dot com>
|
||||||
|
© 2008 Neale Pickett <neale dot woozle dot org>
|
||||||
|
© 2009 Mate Nagy <mnagy at port70 dot net>
|
||||||
|
© 2010-2016 Hiltjo Posthuma <hiltjo@codemadness.org>
|
||||||
|
© 2010-2012 Connor Lane Smith <cls@lubutu.com>
|
||||||
|
© 2011 Christoph Lohmann <20h@r-36.net>
|
||||||
|
© 2015-2016 Quentin Rameau <quinq@fifth.space>
|
||||||
|
© 2015-2016 Eric Pruitt <eric.pruitt@gmail.com>
|
||||||
|
© 2016-2017 Markus Teich <markus.teich@stusta.mhn.de>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
DEALINGS IN THE SOFTWARE.
|
|
@ -43,6 +43,7 @@ install: all
|
||||||
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||||
sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
|
sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
|
||||||
chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
|
chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
|
||||||
|
cp -f dwm.desktop /usr/share/xsessions/
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f ${DESTDIR}${PREFIX}/bin/dwm\
|
rm -f ${DESTDIR}${PREFIX}/bin/dwm\
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Load top bar
|
# Load top bar (Optional)
|
||||||
dwmblocks &
|
#dwmblocks &
|
||||||
|
|
||||||
# Network applet
|
# Network applet
|
||||||
#connman-gtk --tray &
|
#connman-gtk --tray &
|
||||||
|
|
|
@ -2,23 +2,27 @@
|
||||||
|
|
||||||
/* appearance */
|
/* appearance */
|
||||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
static const unsigned int gappx = 5; /* gaps between windows */
|
static const unsigned int gappx = 6; /* gaps between windows */
|
||||||
static const unsigned int snap = 32; /* snap pixel */
|
static const unsigned int snap = 32; /* snap pixel */
|
||||||
static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
|
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 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 int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
|
||||||
static const int showsystray = 1; /* 0 means no systray */
|
static const int showsystray = 1; /* 0 means no systray */
|
||||||
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 */
|
||||||
static const unsigned int gappx = 6; /* gaps between windows */
|
static const char *fonts[] = { "UbuntuMono Nerd Font:size=12" };
|
||||||
|
static const char dmenufont[] = "UbuntuMono Nerd Font:size=12";
|
||||||
static const char *fonts[] = { "monospace:size=10" };
|
//static const char col_gray1[] = "#222222"; // Default grey
|
||||||
static const char dmenufont[] = "monospace:size=10";
|
//static const char col_gray1[] = "#2b303b"; // Grey Light
|
||||||
static const char col_gray1[] = "#222222";
|
//static const char col_gray1[] = "#292d3e"; // Dracula Theme
|
||||||
|
static const char col_gray1[] = "#1f1f35"; // Blue dark
|
||||||
static const char col_gray2[] = "#444444";
|
static const char col_gray2[] = "#444444";
|
||||||
static const char col_gray3[] = "#bbbbbb";
|
static const char col_gray3[] = "#bbbbbb";
|
||||||
static const char col_gray4[] = "#eeeeee";
|
static const char col_gray4[] = "#eeeeee";
|
||||||
static const char col_cyan[] = "#005577";
|
//static const char col_cyan[] = "#005577"; // Cyan
|
||||||
|
//static const char col_cyan[] = "#9341b0"; // Purple
|
||||||
|
static const char col_cyan[] = "#664477"; // Purple Light
|
||||||
static const char *colors[][3] = {
|
static const char *colors[][3] = {
|
||||||
/* fg bg border */
|
/* fg bg border */
|
||||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||||
|
@ -26,7 +30,7 @@ static const char *colors[][3] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* tagging */
|
/* tagging */
|
||||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
static const char *tags[] = { "term", "www", "chat", "files", "media", "game", "mail", "dev", "vm" };
|
||||||
|
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
/* xprop(1):
|
/* xprop(1):
|
||||||
|
@ -34,26 +38,28 @@ static const Rule rules[] = {
|
||||||
* WM_NAME(STRING) = title
|
* WM_NAME(STRING) = title
|
||||||
*/
|
*/
|
||||||
/* class instance title tags mask isfloating monitor */
|
/* class instance title tags mask isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
{ "mpv", NULL, NULL, 0, 1, -1 },
|
||||||
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
{ "Ristrettoy", NULL, NULL, 0, 1, -1 },
|
||||||
|
{ "VLC", NULL, NULL, 0, 1, -1 },
|
||||||
|
//{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
|
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 nmaster = 1; /* number of clients in master area */
|
||||||
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
|
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 */
|
||||||
|
|
||||||
#include "layouts.c"
|
|
||||||
static const Layout layouts[] = {
|
static const Layout layouts[] = {
|
||||||
/* symbol arrange function */
|
/* symbol arrange function */
|
||||||
{ "[]=", tile }, /* first entry is default */
|
{ "[]=", tile }, /* first entry is default */
|
||||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
|
||||||
{ "[M]", monocle },
|
{ "[M]", monocle },
|
||||||
{ "HHH", grid },
|
//{ "[F]", NULL }, /* no layout function means floating behavior */
|
||||||
|
{ NULL, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* key definitions */
|
/* key definitions */
|
||||||
#define MODKEY Mod1Mask
|
#define MODKEY Mod4Mask
|
||||||
#define TAGKEYS(KEY,TAG) \
|
#define TAGKEYS(KEY,TAG) \
|
||||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||||
|
@ -68,56 +74,152 @@ 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 };
|
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
||||||
static const char *termcmd[] = { "st", NULL };
|
static const char *termcmd[] = { "st", NULL };
|
||||||
|
|
||||||
|
#include <X11/XF86keysym.h>
|
||||||
static Key keys[] = {
|
static Key keys[] = {
|
||||||
/* modifier key function argument */
|
|
||||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
// ------------------ Windows ------------------
|
||||||
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
|
||||||
{ MODKEY, XK_b, togglebar, {0} },
|
// Switch between windows
|
||||||
{ MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } },
|
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||||
{ MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } },
|
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
|
||||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
// Change window sizes
|
||||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
{ MODKEY|ShiftMask, XK_i, incnmaster, {.i = -1 } },
|
||||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
{ MODKEY|ShiftMask, XK_h, setmfact, {.f = -0.05} },
|
||||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
{ MODKEY|ShiftMask, XK_l, setmfact, {.f = +0.05} },
|
||||||
{ MODKEY, XK_Return, zoom, {0} },
|
|
||||||
{ MODKEY, XK_Tab, view, {0} },
|
// Toggle floating
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
{ MODKEY|ShiftMask, XK_f, togglefloating, {0} },
|
||||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
|
||||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
// Toggle bar
|
||||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
{ MODKEY|ShiftMask, XK_b, togglebar, {0} },
|
||||||
{ MODKEY, XK_g, setlayout, {.v = &layouts[3]} },
|
|
||||||
{ MODKEY, XK_space, setlayout, {0} },
|
// Move windows in current stack
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
|
||||||
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
// Cycle layouts
|
||||||
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
{ MODKEY, XK_Tab, cyclelayout, {.i = +1 } },
|
||||||
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
{ MODKEY|ShiftMask, XK_Tab, cyclelayout, {.i = -1 } },
|
||||||
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
|
||||||
{ MODKEY, XK_minus, setgaps, {.i = -1 } },
|
// Increase - decrease gaps
|
||||||
{ MODKEY, XK_equal, setgaps, {.i = +1 } },
|
{ MODKEY, XK_g, setgaps, {.i = -1 } },
|
||||||
{ MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
|
{ MODKEY|ShiftMask, XK_g, setgaps, {.i = +1 } },
|
||||||
TAGKEYS( XK_1, 0)
|
|
||||||
TAGKEYS( XK_2, 1)
|
// Focus next - prev monitor
|
||||||
TAGKEYS( XK_3, 2)
|
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
||||||
TAGKEYS( XK_4, 3)
|
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||||
TAGKEYS( XK_5, 4)
|
|
||||||
TAGKEYS( XK_6, 5)
|
// Send window to next - prev monitor
|
||||||
TAGKEYS( XK_7, 6)
|
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||||
TAGKEYS( XK_8, 7)
|
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||||
TAGKEYS( XK_9, 8)
|
|
||||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
// Kill window
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_q, quit, {1} },
|
{ MODKEY|ShiftMask, XK_q, killclient, {0} },
|
||||||
|
|
||||||
|
// Restart dwm
|
||||||
|
{ MODKEY|ControlMask, XK_r, quit, {1} },
|
||||||
|
|
||||||
|
// Quit dwm
|
||||||
|
{ MODKEY|ControlMask, XK_q, quit, {0} },
|
||||||
|
|
||||||
|
// ---------------- Workspaces -----------------
|
||||||
|
|
||||||
|
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)
|
||||||
|
TAGKEYS(XK_8, 7)
|
||||||
|
TAGKEYS(XK_9, 8)
|
||||||
|
|
||||||
|
// ------------------- Apps --------------------
|
||||||
|
|
||||||
|
// dmenu
|
||||||
|
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = dmenucmd } },
|
||||||
|
|
||||||
|
{ MODKEY, XK_o, spawn, SHCMD("rofi -show drun") },
|
||||||
|
{ MODKEY, XK_p, spawn, SHCMD("rofi -show run") },
|
||||||
|
{ MODKEY|ShiftMask, XK_w, spawn, SHCMD("rofi -show") },
|
||||||
|
{ MODKEY, XK_Return, spawn, SHCMD("kitty") },
|
||||||
|
{ MODKEY, XK_n, spawn, SHCMD("pcmanfm") },
|
||||||
|
{ MODKEY, XK_b, spawn, SHCMD("firefox") },
|
||||||
|
{ MODKEY, XK_e, spawn, SHCMD("geany") },
|
||||||
|
{ MODKEY, XK_m, spawn, SHCMD("telegram") },
|
||||||
|
{ MODKEY, XK_z, spawn, SHCMD("nitrogen") },
|
||||||
|
{ MODKEY, XK_u, spawn, SHCMD("xterm") },
|
||||||
|
{ MODKEY, XK_t, spawn, SHCMD("rofi-theme-selector") },
|
||||||
|
{ MODKEY, XK_i, spawn, SHCMD("lxappearance") },
|
||||||
|
|
||||||
|
// Screenshot
|
||||||
|
{ MODKEY, XK_s, spawn, SHCMD("xfce4-screenshooter") },
|
||||||
|
{ MODKEY|ShiftMask, XK_s, spawn, SHCMD("scrot -s") },
|
||||||
|
|
||||||
|
// ----------------- Hardware ------------------
|
||||||
|
|
||||||
|
// Volume
|
||||||
|
{0, XF86XK_AudioLowerVolume, spawn, SHCMD("pactl set-sink-volume @DEFAULT_SINK@ -5%")},
|
||||||
|
{0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pactl set-sink-volume @DEFAULT_SINK@ +5%")},
|
||||||
|
{0, XF86XK_AudioMute, spawn, SHCMD("pactl set-sink-mute @DEFAULT_SINK@ toggle")},
|
||||||
|
|
||||||
|
// Brightness
|
||||||
|
{0, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl set +10%")},
|
||||||
|
{0, XF86XK_MonBrightnessDown, spawn, SHCMD("brightnessctl set 10%-")},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Default config
|
||||||
|
//static Key keys[] = {
|
||||||
|
/* modifier key function argument */
|
||||||
|
//{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||||
|
//{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||||
|
//{ 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, XK_Return, zoom, {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, 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, XK_minus, setgaps, {.i = -1 } },
|
||||||
|
//{ MODKEY, XK_equal, setgaps, {.i = +1 } },
|
||||||
|
//{ MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
|
||||||
|
//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)
|
||||||
|
//TAGKEYS( XK_8, 7)
|
||||||
|
//TAGKEYS( XK_9, 8)
|
||||||
|
//{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||||
|
//};
|
||||||
|
|
||||||
/* button definitions */
|
/* button definitions */
|
||||||
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
||||||
static Button buttons[] = {
|
static Button buttons[] = {
|
||||||
/* click event mask button function argument */
|
/* click event mask button function argument */
|
||||||
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||||
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||||
{ ClkWinTitle, 0, Button2, zoom, {0} },
|
{ ClkWinTitle, 0, Button2, zoom, {0} },
|
||||||
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
||||||
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
||||||
|
@ -128,3 +230,4 @@ static Button buttons[] = {
|
||||||
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||||
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,137 +1,78 @@
|
||||||
// -------------------------------- Appearance ---------------------------------
|
/* See LICENSE file for copyright and license details. */
|
||||||
|
|
||||||
// border pixel of windows
|
/* appearance */
|
||||||
static const unsigned int borderpx = 1;
|
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
// gaps between windows
|
static const unsigned int gappx = 6; /* gaps between windows */
|
||||||
static const unsigned int gappx = 6;
|
static const unsigned int snap = 32; /* snap pixel */
|
||||||
// snap pixel
|
static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
|
||||||
static const unsigned int snap = 32;
|
static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */
|
||||||
// 0: sloppy systray follows selected monitor, >0: pin systray to monitor X
|
static const unsigned int systrayspacing = 2; /* systray spacing */
|
||||||
static const unsigned int systraypinning = 0;
|
static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
|
||||||
// systray spacing
|
static const int showsystray = 1; /* 0 means no systray */
|
||||||
static const unsigned int systrayspacing = 2;
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
// 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
static const int systraypinningfailfirst = 1;
|
static const char *fonts[] = { "UbuntuMono Nerd Font:size=12" };
|
||||||
// 0 means no systray
|
static const char dmenufont[] = "UbuntuMono Nerd Font:size=12";
|
||||||
static const int showsystray = 1;
|
//static const char col_gray1[] = "#222222"; // Default grey
|
||||||
// 0 means no bar
|
//static const char col_gray1[] = "#2b303b"; // Grey Light
|
||||||
static const int showbar = 5;
|
//static const char col_gray1[] = "#292d3e"; // Dracula Theme
|
||||||
// 0 means bottom bar
|
static const char col_gray1[] = "#1f1f35"; // Blue dark
|
||||||
static const int topbar = 5;
|
static const char col_gray2[] = "#444444";
|
||||||
|
static const char col_gray3[] = "#bbbbbb";
|
||||||
// ---------------------------------- Fonts ------------------------------------
|
static const char col_gray4[] = "#eeeeee";
|
||||||
|
//static const char col_cyan[] = "#005577"; // Cyan
|
||||||
static const char *fonts[] = { "UbuntuMono Nerd Font:size=12:weight=bold:antialias=true:autohint:true" };
|
//static const char col_cyan[] = "#9341b0"; // Purple
|
||||||
static const char dmenufont[] = "UbuntuMono Nerd Font:size=12:antialias=true:autohint=true";
|
static const char col_cyan[] = "#664477"; // Purple Light
|
||||||
|
static const char *colors[][3] = {
|
||||||
// ---------------------------------- Colors -----------------------------------
|
/* fg bg border */
|
||||||
|
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||||
struct Theme {
|
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||||
char *inactive;
|
|
||||||
char *active;
|
|
||||||
char *bg;
|
|
||||||
char *focus;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct Theme material = {
|
/* tagging */
|
||||||
.inactive = "#4c566a",
|
|
||||||
.active = "#ffffff",
|
|
||||||
.bg = "#0f101a",
|
|
||||||
.focus = "#a151d3"
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct Theme onedark = {
|
|
||||||
.inactive = "#4c566a",
|
|
||||||
.active = "#ffffff",
|
|
||||||
.bg = "#1e2127",
|
|
||||||
.focus = "#E06C75"
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct Theme nord = {
|
|
||||||
.inactive = "#4c566a",
|
|
||||||
.active = "#ffffff",
|
|
||||||
.bg = "#2e3440",
|
|
||||||
.focus = "#81a1c1"
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct Theme monokai_pro = {
|
|
||||||
.inactive = "#727072",
|
|
||||||
.active = "#2d2a2e",
|
|
||||||
.bg = "#2d2a2e",
|
|
||||||
.focus = "#a9dc76"
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char window_border[] = "#000000";
|
|
||||||
|
|
||||||
static const char *colors[][3] = {
|
|
||||||
// fg bg border
|
|
||||||
{ material.inactive, material.bg, window_border },
|
|
||||||
{ material.active, material.focus, material.focus },
|
|
||||||
|
|
||||||
{ onedark.inactive, onedark.bg, window_border },
|
|
||||||
{ onedark.active, onedark.focus, onedark.focus },
|
|
||||||
|
|
||||||
{ nord.inactive, nord.bg, window_border },
|
|
||||||
{ nord.active, nord.focus, nord.focus },
|
|
||||||
|
|
||||||
{ monokai_pro.inactive, monokai_pro.bg, window_border },
|
|
||||||
{ monokai_pro.active, monokai_pro.focus, monokai_pro.focus },
|
|
||||||
};
|
|
||||||
|
|
||||||
// -------------------------------- Workspaces ---------------------------------
|
|
||||||
|
|
||||||
// static const char *tags[] = { " ", " ", " ", " ", " ", " ", " ", " ", " " };
|
|
||||||
static const char *tags[] = { "term", "www", "chat", "files", "media", "game", "mail", "dev", "vm" };
|
static const char *tags[] = { "term", "www", "chat", "files", "media", "game", "mail", "dev", "vm" };
|
||||||
|
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
/* xprop(1):
|
/* xprop(1):
|
||||||
* WM_CLASS(STRING) = instance, class
|
* WM_CLASS(STRING) = instance, class
|
||||||
* WM_NAME(STRING) = title
|
* WM_NAME(STRING) = title
|
||||||
*/
|
*/
|
||||||
|
/* class instance title tags mask isfloating monitor */
|
||||||
// class instance title tags mask isfloating monitor
|
{ "mpv", NULL, NULL, 0, 1, -1 },
|
||||||
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
{ "Ristrettoy", NULL, NULL, 0, 1, -1 },
|
||||||
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
{ "VLC", NULL, NULL, 0, 1, -1 },
|
||||||
|
//{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
// ---------------------------------- Layouts ----------------------------------
|
/* 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 */
|
||||||
|
|
||||||
static const float mfact = 0.50; // 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
|
|
||||||
|
|
||||||
#include "layouts.c"
|
|
||||||
static const Layout layouts[] = {
|
static const Layout layouts[] = {
|
||||||
// symbol arrange function
|
/* symbol arrange function */
|
||||||
{ "[]", tile }, // first entry is default
|
{ "[]=", tile }, /* first entry is default */
|
||||||
//{ "[M]", monocle },
|
{ "[M]", monocle },
|
||||||
{ "[C]", tcl },
|
//{ "[F]", NULL }, /* no layout function means floating behavior */
|
||||||
{ "[F]", NULL }, // no layout function means floating behavior
|
{ NULL, NULL },
|
||||||
//{ "[G]", grid },
|
|
||||||
{ NULL, NULL },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// -------------------------------- Keybindings --------------------------------
|
/* key definitions */
|
||||||
|
|
||||||
#define MODKEY Mod4Mask
|
#define MODKEY Mod4Mask
|
||||||
|
|
||||||
#define TAGKEYS(KEY,TAG) \
|
#define TAGKEYS(KEY,TAG) \
|
||||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
||||||
|
|
||||||
// Helper for spawning shell commands in the pre dwm-5.0 fashion
|
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||||
|
|
||||||
// Commands
|
/* commands */
|
||||||
static char dmenumon[2] = "0";
|
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||||
static const char *termcmd[] = { "kitty", NULL };
|
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
||||||
static const char *dmenucmd[] = {
|
static const char *termcmd[] = { "st", NULL };
|
||||||
"dmenu_run", "-m", dmenumon,
|
|
||||||
"-fn", dmenufont,
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
#include <X11/XF86keysym.h>
|
#include <X11/XF86keysym.h>
|
||||||
static Key keys[] = {
|
static Key keys[] = {
|
||||||
|
@ -155,8 +96,8 @@ static Key keys[] = {
|
||||||
{ MODKEY|ShiftMask, XK_b, togglebar, {0} },
|
{ MODKEY|ShiftMask, XK_b, togglebar, {0} },
|
||||||
|
|
||||||
// Move windows in current stack
|
// Move windows in current stack
|
||||||
{ MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } },
|
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||||
{ MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } },
|
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||||
|
|
||||||
// Cycle layouts
|
// Cycle layouts
|
||||||
{ MODKEY, XK_Tab, cyclelayout, {.i = +1 } },
|
{ MODKEY, XK_Tab, cyclelayout, {.i = +1 } },
|
||||||
|
@ -174,10 +115,6 @@ static Key keys[] = {
|
||||||
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||||
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||||
|
|
||||||
// Change color scheme
|
|
||||||
{ MODKEY, XK_Left, schemeToggle, {0} },
|
|
||||||
{ MODKEY, XK_Right, schemeCycle, {0} },
|
|
||||||
|
|
||||||
// Kill window
|
// Kill window
|
||||||
{ MODKEY|ShiftMask, XK_q, killclient, {0} },
|
{ MODKEY|ShiftMask, XK_q, killclient, {0} },
|
||||||
|
|
||||||
|
@ -234,18 +171,63 @@ static Key keys[] = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin
|
// Default config
|
||||||
|
//static Key keys[] = {
|
||||||
|
/* modifier key function argument */
|
||||||
|
//{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||||
|
//{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||||
|
//{ 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, XK_Return, zoom, {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, 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, XK_minus, setgaps, {.i = -1 } },
|
||||||
|
//{ MODKEY, XK_equal, setgaps, {.i = +1 } },
|
||||||
|
//{ MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
|
||||||
|
//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)
|
||||||
|
//TAGKEYS( XK_8, 7)
|
||||||
|
//TAGKEYS( XK_9, 8)
|
||||||
|
//{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||||
|
//};
|
||||||
|
|
||||||
|
/* button definitions */
|
||||||
|
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
||||||
static Button buttons[] = {
|
static Button buttons[] = {
|
||||||
// click event mask button function argument
|
/* click event mask button function argument */
|
||||||
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||||
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||||
{ ClkWinTitle, 0, Button2, zoom, {0} },
|
{ ClkWinTitle, 0, Button2, zoom, {0} },
|
||||||
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
||||||
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
||||||
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
|
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
|
||||||
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
||||||
{ ClkTagBar, 0, Button1, view, {0} },
|
{ ClkTagBar, 0, Button1, view, {0} },
|
||||||
{ ClkTagBar, 0, Button3, toggleview, {0} },
|
{ ClkTagBar, 0, Button3, toggleview, {0} },
|
||||||
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||||
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# dwm version
|
# dwm version
|
||||||
VERSION = 6.2
|
VERSION = 6.3
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
|
|
|
@ -30,14 +30,6 @@ top left corner. The tags which are applied to one or more windows are
|
||||||
indicated with an empty square in the top left corner.
|
indicated with an empty square in the top left corner.
|
||||||
.P
|
.P
|
||||||
dwm draws a small border around windows to indicate the focus state.
|
dwm draws a small border around windows to indicate the focus state.
|
||||||
.P
|
|
||||||
On start, dwm can start additional programs that may be specified in two special
|
|
||||||
shell scripts (see the FILES section below), autostart_blocking.sh and
|
|
||||||
autostart.sh. The former is executed first and dwm will wait for its
|
|
||||||
termination before starting. The latter is executed in the background before
|
|
||||||
dwm enters its handler loop.
|
|
||||||
.P
|
|
||||||
Either of these files may be omitted.
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
.B \-v
|
.B \-v
|
||||||
|
@ -166,9 +158,6 @@ Reset the gaps around windows to
|
||||||
.TP
|
.TP
|
||||||
.B Mod1\-Shift\-q
|
.B Mod1\-Shift\-q
|
||||||
Quit dwm.
|
Quit dwm.
|
||||||
.TP
|
|
||||||
.B Mod1\-Control\-Shift\-q
|
|
||||||
Restart dwm.
|
|
||||||
.SS Mouse commands
|
.SS Mouse commands
|
||||||
.TP
|
.TP
|
||||||
.B Mod1\-Button1
|
.B Mod1\-Button1
|
||||||
|
@ -179,31 +168,9 @@ Toggles focused window between floating and tiled state.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1\-Button3
|
.B Mod1\-Button3
|
||||||
Resize focused window while dragging. Tiled windows will be toggled to the floating state.
|
Resize focused window while dragging. Tiled windows will be toggled to the floating state.
|
||||||
.SH FILES
|
|
||||||
The files containing programs to be started along with dwm are searched for in
|
|
||||||
the following directories:
|
|
||||||
.IP "1. $XDG_DATA_HOME/dwm"
|
|
||||||
.IP "2. $HOME/.local/share/dwm"
|
|
||||||
.IP "3. $HOME/.dwm"
|
|
||||||
.P
|
|
||||||
The first existing directory is scanned for any of the autostart files below.
|
|
||||||
.TP 15
|
|
||||||
autostart.sh
|
|
||||||
This file is started as a shell background process before dwm enters its handler
|
|
||||||
loop.
|
|
||||||
.TP 15
|
|
||||||
autostart_blocking.sh
|
|
||||||
This file is started before any autostart.sh; dwm waits for its termination.
|
|
||||||
.SH CUSTOMIZATION
|
.SH CUSTOMIZATION
|
||||||
dwm is customized by creating a custom config.h and (re)compiling the source
|
dwm is customized by creating a custom config.h and (re)compiling the source
|
||||||
code. This keeps it fast, secure and simple.
|
code. This keeps it fast, secure and simple.
|
||||||
.SH SIGNALS
|
|
||||||
.TP
|
|
||||||
.B SIGHUP - 1
|
|
||||||
Restart the dwm process.
|
|
||||||
.TP
|
|
||||||
.B SIGTERM - 15
|
|
||||||
Cleanly terminate the dwm process.
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR dmenu (1),
|
.BR dmenu (1),
|
||||||
.BR st (1)
|
.BR st (1)
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <X11/cursorfont.h>
|
#include <X11/cursorfont.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
@ -50,8 +49,7 @@
|
||||||
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
|
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
|
||||||
#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \
|
#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \
|
||||||
* MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy)))
|
* MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy)))
|
||||||
#define ISVISIBLEONTAG(C, T) ((C->tags & T))
|
#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
|
||||||
#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags])
|
|
||||||
#define LENGTH(X) (sizeof X / sizeof X[0])
|
#define LENGTH(X) (sizeof X / sizeof X[0])
|
||||||
#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
|
#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
|
||||||
#define WIDTH(X) ((X)->w + 2 * (X)->bw)
|
#define WIDTH(X) ((X)->w + 2 * (X)->bw)
|
||||||
|
@ -60,23 +58,21 @@
|
||||||
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
||||||
|
|
||||||
#define SYSTEM_TRAY_REQUEST_DOCK 0
|
#define SYSTEM_TRAY_REQUEST_DOCK 0
|
||||||
|
|
||||||
/* XEMBED messages */
|
/* XEMBED messages */
|
||||||
#define XEMBED_EMBEDDED_NOTIFY 0
|
#define XEMBED_EMBEDDED_NOTIFY 0
|
||||||
#define XEMBED_WINDOW_ACTIVATE 1
|
#define XEMBED_WINDOW_ACTIVATE 1
|
||||||
#define XEMBED_FOCUS_IN 4
|
#define XEMBED_FOCUS_IN 4
|
||||||
#define XEMBED_MODALITY_ON 10
|
#define XEMBED_MODALITY_ON 10
|
||||||
|
|
||||||
#define XEMBED_MAPPED (1 << 0)
|
#define XEMBED_MAPPED (1 << 0)
|
||||||
#define XEMBED_WINDOW_ACTIVATE 1
|
#define XEMBED_WINDOW_ACTIVATE 1
|
||||||
#define XEMBED_WINDOW_DEACTIVATE 2
|
#define XEMBED_WINDOW_DEACTIVATE 2
|
||||||
|
|
||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR
|
#define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR
|
||||||
|
|
||||||
/* enums */
|
/* enums */
|
||||||
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||||
|
enum { SchemeNorm, SchemeSel }; /* color schemes */
|
||||||
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
||||||
NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz,
|
NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz,
|
||||||
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
|
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
|
||||||
|
@ -130,7 +126,6 @@ typedef struct {
|
||||||
void (*arrange)(Monitor *);
|
void (*arrange)(Monitor *);
|
||||||
} Layout;
|
} Layout;
|
||||||
|
|
||||||
typedef struct Pertag Pertag;
|
|
||||||
struct Monitor {
|
struct Monitor {
|
||||||
char ltsymbol[16];
|
char ltsymbol[16];
|
||||||
float mfact;
|
float mfact;
|
||||||
|
@ -151,7 +146,6 @@ struct Monitor {
|
||||||
Monitor *next;
|
Monitor *next;
|
||||||
Window barwin;
|
Window barwin;
|
||||||
const Layout *lt[2];
|
const Layout *lt[2];
|
||||||
Pertag *pertag;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -175,7 +169,6 @@ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interac
|
||||||
static void arrange(Monitor *m);
|
static void arrange(Monitor *m);
|
||||||
static void arrangemon(Monitor *m);
|
static void arrangemon(Monitor *m);
|
||||||
static void attach(Client *c);
|
static void attach(Client *c);
|
||||||
static void attachaside(Client *c);
|
|
||||||
static void attachstack(Client *c);
|
static void attachstack(Client *c);
|
||||||
static void buttonpress(XEvent *e);
|
static void buttonpress(XEvent *e);
|
||||||
static void checkotherwm(void);
|
static void checkotherwm(void);
|
||||||
|
@ -193,8 +186,6 @@ static void detachstack(Client *c);
|
||||||
static Monitor *dirtomon(int dir);
|
static Monitor *dirtomon(int dir);
|
||||||
static void drawbar(Monitor *m);
|
static void drawbar(Monitor *m);
|
||||||
static void drawbars(void);
|
static void drawbars(void);
|
||||||
static void enqueue(Client *c);
|
|
||||||
static void enqueuestack(Client *c);
|
|
||||||
static void enternotify(XEvent *e);
|
static void enternotify(XEvent *e);
|
||||||
static void expose(XEvent *e);
|
static void expose(XEvent *e);
|
||||||
static void focus(Client *c);
|
static void focus(Client *c);
|
||||||
|
@ -214,10 +205,9 @@ static void killclient(const Arg *arg);
|
||||||
static void manage(Window w, XWindowAttributes *wa);
|
static void manage(Window w, XWindowAttributes *wa);
|
||||||
static void mappingnotify(XEvent *e);
|
static void mappingnotify(XEvent *e);
|
||||||
static void maprequest(XEvent *e);
|
static void maprequest(XEvent *e);
|
||||||
//static void monocle(Monitor *m);
|
static void monocle(Monitor *m);
|
||||||
static void motionnotify(XEvent *e);
|
static void motionnotify(XEvent *e);
|
||||||
static void movemouse(const Arg *arg);
|
static void movemouse(const Arg *arg);
|
||||||
static Client *nexttagged(Client *c);
|
|
||||||
static Client *nexttiled(Client *c);
|
static Client *nexttiled(Client *c);
|
||||||
static void pop(Client *);
|
static void pop(Client *);
|
||||||
static void propertynotify(XEvent *e);
|
static void propertynotify(XEvent *e);
|
||||||
|
@ -230,12 +220,9 @@ static void resizeclient(Client *c, int x, int y, int w, int h);
|
||||||
static void resizemouse(const Arg *arg);
|
static void resizemouse(const Arg *arg);
|
||||||
static void resizerequest(XEvent *e);
|
static void resizerequest(XEvent *e);
|
||||||
static void restack(Monitor *m);
|
static void restack(Monitor *m);
|
||||||
static void rotatestack(const Arg *arg);
|
|
||||||
static void run(void);
|
static void run(void);
|
||||||
static void runautostart(void);
|
static void runAutostart(void);
|
||||||
static void scan(void);
|
static void scan(void);
|
||||||
static void schemeCycle(const Arg*);
|
|
||||||
static void schemeToggle(const Arg*);
|
|
||||||
static int sendevent(Window w, Atom proto, int m, long d0, long d1, long d2, long d3, long d4);
|
static int sendevent(Window w, Atom proto, int m, long d0, long d1, long d2, long d3, long d4);
|
||||||
static void sendmon(Client *c, Monitor *m);
|
static void sendmon(Client *c, Monitor *m);
|
||||||
static void setclientstate(Client *c, long state);
|
static void setclientstate(Client *c, long state);
|
||||||
|
@ -248,8 +235,6 @@ static void setup(void);
|
||||||
static void seturgent(Client *c, int urg);
|
static void seturgent(Client *c, int urg);
|
||||||
static void showhide(Client *c);
|
static void showhide(Client *c);
|
||||||
static void sigchld(int unused);
|
static void sigchld(int unused);
|
||||||
static void sighup(int unused);
|
|
||||||
static void sigterm(int unused);
|
|
||||||
static void spawn(const Arg *arg);
|
static void spawn(const Arg *arg);
|
||||||
static Monitor *systraytomon(Monitor *m);
|
static Monitor *systraytomon(Monitor *m);
|
||||||
static void tag(const Arg *arg);
|
static void tag(const Arg *arg);
|
||||||
|
@ -276,7 +261,6 @@ static void updatetitle(Client *c);
|
||||||
static void updatewindowtype(Client *c);
|
static void updatewindowtype(Client *c);
|
||||||
static void updatewmhints(Client *c);
|
static void updatewmhints(Client *c);
|
||||||
static void view(const Arg *arg);
|
static void view(const Arg *arg);
|
||||||
static void warp(const Client *c);
|
|
||||||
static Client *wintoclient(Window w);
|
static Client *wintoclient(Window w);
|
||||||
static Monitor *wintomon(Window w);
|
static Monitor *wintomon(Window w);
|
||||||
static Client *wintosystrayicon(Window w);
|
static Client *wintosystrayicon(Window w);
|
||||||
|
@ -286,12 +270,8 @@ static int xerrorstart(Display *dpy, XErrorEvent *ee);
|
||||||
static void zoom(const Arg *arg);
|
static void zoom(const Arg *arg);
|
||||||
|
|
||||||
/* variables */
|
/* variables */
|
||||||
static const char autostartblocksh[] = "autostart_blocking.sh";
|
static Systray *systray = NULL;
|
||||||
static const char autostartsh[] = "autostart.sh";
|
|
||||||
static Systray *systray = NULL;
|
|
||||||
static const char broken[] = "broken";
|
static const char broken[] = "broken";
|
||||||
static const char dwmdir[] = "dwm";
|
|
||||||
static const char localshare[] = ".local/share";
|
|
||||||
static char stext[256];
|
static char stext[256];
|
||||||
static int screen;
|
static int screen;
|
||||||
static int sw, sh; /* X display screen geometry width, height */
|
static int sw, sh; /* X display screen geometry width, height */
|
||||||
|
@ -317,12 +297,10 @@ static void (*handler[LASTEvent]) (XEvent *) = {
|
||||||
[UnmapNotify] = unmapnotify
|
[UnmapNotify] = unmapnotify
|
||||||
};
|
};
|
||||||
static Atom wmatom[WMLast], netatom[NetLast], xatom[XLast];
|
static Atom wmatom[WMLast], netatom[NetLast], xatom[XLast];
|
||||||
static int restart = 0;
|
|
||||||
static int running = 1;
|
static int running = 1;
|
||||||
static Cur *cursor[CurLast];
|
static Cur *cursor[CurLast];
|
||||||
static Clr **scheme;
|
static Clr **scheme;
|
||||||
static Display *dpy;
|
static Display *dpy;
|
||||||
static int SchemeNorm = 0, SchemeSel = 1;
|
|
||||||
static Drw *drw;
|
static Drw *drw;
|
||||||
static Monitor *mons, *selmon;
|
static Monitor *mons, *selmon;
|
||||||
static Window root, wmcheckwin;
|
static Window root, wmcheckwin;
|
||||||
|
@ -330,15 +308,6 @@ static Window root, wmcheckwin;
|
||||||
/* configuration, allows nested code to access above variables */
|
/* configuration, allows nested code to access above variables */
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
struct Pertag {
|
|
||||||
unsigned int curtag, prevtag; /* current and previous tag */
|
|
||||||
int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
|
|
||||||
float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
|
|
||||||
unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
|
|
||||||
const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
|
|
||||||
int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* compile-time check if all tags fit into an unsigned int bit array. */
|
/* compile-time check if all tags fit into an unsigned int bit array. */
|
||||||
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
|
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
|
||||||
|
|
||||||
|
@ -474,17 +443,6 @@ attach(Client *c)
|
||||||
c->mon->clients = c;
|
c->mon->clients = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
attachaside(Client *c) {
|
|
||||||
Client *at = nexttagged(c);
|
|
||||||
if(!at) {
|
|
||||||
attach(c);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
c->next = at->next;
|
|
||||||
at->next = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
attachstack(Client *c)
|
attachstack(Client *c)
|
||||||
{
|
{
|
||||||
|
@ -518,7 +476,7 @@ buttonpress(XEvent *e)
|
||||||
arg.ui = 1 << i;
|
arg.ui = 1 << i;
|
||||||
} else if (ev->x < x + blw)
|
} else if (ev->x < x + blw)
|
||||||
click = ClkLtSymbol;
|
click = ClkLtSymbol;
|
||||||
else if (ev->x > selmon->ww - TEXTW(stext) - getsystraywidth())
|
else if (ev->x > selmon->ww - (int)TEXTW(stext) - getsystraywidth())
|
||||||
click = ClkStatusText;
|
click = ClkStatusText;
|
||||||
else
|
else
|
||||||
click = ClkWinTitle;
|
click = ClkWinTitle;
|
||||||
|
@ -561,12 +519,14 @@ cleanup(void)
|
||||||
XUngrabKey(dpy, AnyKey, AnyModifier, root);
|
XUngrabKey(dpy, AnyKey, AnyModifier, root);
|
||||||
while (mons)
|
while (mons)
|
||||||
cleanupmon(mons);
|
cleanupmon(mons);
|
||||||
|
|
||||||
if (showsystray) {
|
if (showsystray) {
|
||||||
XUnmapWindow(dpy, systray->win);
|
XUnmapWindow(dpy, systray->win);
|
||||||
XDestroyWindow(dpy, systray->win);
|
XDestroyWindow(dpy, systray->win);
|
||||||
free(systray);
|
free(systray);
|
||||||
}
|
}
|
||||||
for (i = 0; i < CurLast; i++)
|
|
||||||
|
for (i = 0; i < CurLast; i++)
|
||||||
drw_cur_free(drw, cursor[i]);
|
drw_cur_free(drw, cursor[i]);
|
||||||
for (i = 0; i < LENGTH(colors); i++)
|
for (i = 0; i < LENGTH(colors); i++)
|
||||||
free(scheme[i]);
|
free(scheme[i]);
|
||||||
|
@ -600,7 +560,6 @@ clientmessage(XEvent *e)
|
||||||
XSetWindowAttributes swa;
|
XSetWindowAttributes swa;
|
||||||
XClientMessageEvent *cme = &e->xclient;
|
XClientMessageEvent *cme = &e->xclient;
|
||||||
Client *c = wintoclient(cme->window);
|
Client *c = wintoclient(cme->window);
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
if (showsystray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) {
|
if (showsystray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) {
|
||||||
/* add systray icons */
|
/* add systray icons */
|
||||||
|
@ -648,6 +607,7 @@ clientmessage(XEvent *e)
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!c)
|
if (!c)
|
||||||
return;
|
return;
|
||||||
if (cme->message_type == netatom[NetWMState]) {
|
if (cme->message_type == netatom[NetWMState]) {
|
||||||
|
@ -656,14 +616,8 @@ clientmessage(XEvent *e)
|
||||||
setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */
|
setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */
|
||||||
|| (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
|
|| (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
|
||||||
} else if (cme->message_type == netatom[NetActiveWindow]) {
|
} else if (cme->message_type == netatom[NetActiveWindow]) {
|
||||||
for (i = 0; i < LENGTH(tags) && !((1 << i) & c->tags); i++);
|
if (c != selmon->sel && !c->isurgent)
|
||||||
if (i < LENGTH(tags)) {
|
seturgent(c, 1);
|
||||||
const Arg a = {.ui = 1 << i};
|
|
||||||
selmon = c->mon;
|
|
||||||
view(&a);
|
|
||||||
focus(c);
|
|
||||||
restack(selmon);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -770,7 +724,6 @@ Monitor *
|
||||||
createmon(void)
|
createmon(void)
|
||||||
{
|
{
|
||||||
Monitor *m;
|
Monitor *m;
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
m = ecalloc(1, sizeof(Monitor));
|
m = ecalloc(1, sizeof(Monitor));
|
||||||
m->tagset[0] = m->tagset[1] = 1;
|
m->tagset[0] = m->tagset[1] = 1;
|
||||||
|
@ -782,20 +735,6 @@ createmon(void)
|
||||||
m->lt[0] = &layouts[0];
|
m->lt[0] = &layouts[0];
|
||||||
m->lt[1] = &layouts[1 % LENGTH(layouts)];
|
m->lt[1] = &layouts[1 % LENGTH(layouts)];
|
||||||
strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
|
strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
|
||||||
m->pertag = ecalloc(1, sizeof(Pertag));
|
|
||||||
m->pertag->curtag = m->pertag->prevtag = 1;
|
|
||||||
|
|
||||||
for (i = 0; i <= LENGTH(tags); i++) {
|
|
||||||
m->pertag->nmasters[i] = m->nmaster;
|
|
||||||
m->pertag->mfacts[i] = m->mfact;
|
|
||||||
|
|
||||||
m->pertag->ltidxs[i][0] = m->lt[0];
|
|
||||||
m->pertag->ltidxs[i][1] = m->lt[1];
|
|
||||||
m->pertag->sellts[i] = m->sellt;
|
|
||||||
|
|
||||||
m->pertag->showbars[i] = m->showbar;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -878,13 +817,16 @@ drawbar(Monitor *m)
|
||||||
unsigned int i, occ = 0, urg = 0;
|
unsigned int i, occ = 0, urg = 0;
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
if(showsystray && m == systraytomon(m))
|
if (!m->showbar)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(showsystray && m == systraytomon(m) && !systrayonleft)
|
||||||
stw = getsystraywidth();
|
stw = getsystraywidth();
|
||||||
|
|
||||||
/* draw status first so it can be overdrawn by tags later */
|
/* draw status first so it can be overdrawn by tags later */
|
||||||
if (m == selmon) { /* status is only drawn on selected monitor */
|
if (m == selmon) { /* status is only drawn on selected monitor */
|
||||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
tw = TEXTW(stext) - lrpad / 2 + 2; /* 2px right padding */
|
tw = TEXTW(stext) - lrpad / 2 + 2; /* 2px extra right padding */
|
||||||
drw_text(drw, m->ww - tw - stw, 0, tw, bh, lrpad / 2 - 2, stext, 0);
|
drw_text(drw, m->ww - tw - stw, 0, tw, bh, lrpad / 2 - 2, stext, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,28 +874,6 @@ drawbars(void)
|
||||||
drawbar(m);
|
drawbar(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
enqueue(Client *c)
|
|
||||||
{
|
|
||||||
Client *l;
|
|
||||||
for (l = c->mon->clients; l && l->next; l = l->next);
|
|
||||||
if (l) {
|
|
||||||
l->next = c;
|
|
||||||
c->next = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
enqueuestack(Client *c)
|
|
||||||
{
|
|
||||||
Client *l;
|
|
||||||
for (l = c->mon->stack; l && l->snext; l = l->snext);
|
|
||||||
if (l) {
|
|
||||||
l->snext = c;
|
|
||||||
c->snext = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
enternotify(XEvent *e)
|
enternotify(XEvent *e)
|
||||||
{
|
{
|
||||||
|
@ -1033,7 +953,6 @@ focusmon(const Arg *arg)
|
||||||
unfocus(selmon->sel, 0);
|
unfocus(selmon->sel, 0);
|
||||||
selmon = m;
|
selmon = m;
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
warp(selmon->sel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1041,7 +960,7 @@ focusstack(const Arg *arg)
|
||||||
{
|
{
|
||||||
Client *c = NULL, *i;
|
Client *c = NULL, *i;
|
||||||
|
|
||||||
if (!selmon->sel)
|
if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen))
|
||||||
return;
|
return;
|
||||||
if (arg->i > 0) {
|
if (arg->i > 0) {
|
||||||
for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
|
for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
|
||||||
|
@ -1069,6 +988,7 @@ getatomprop(Client *c, Atom prop)
|
||||||
unsigned long dl;
|
unsigned long dl;
|
||||||
unsigned char *p = NULL;
|
unsigned char *p = NULL;
|
||||||
Atom da, atom = None;
|
Atom da, atom = None;
|
||||||
|
|
||||||
/* FIXME getatomprop should return the number of items and a pointer to
|
/* FIXME getatomprop should return the number of items and a pointer to
|
||||||
* the stored data instead of this workaround */
|
* the stored data instead of this workaround */
|
||||||
Atom req = XA_ATOM;
|
Atom req = XA_ATOM;
|
||||||
|
@ -1190,7 +1110,7 @@ grabkeys(void)
|
||||||
void
|
void
|
||||||
incnmaster(const Arg *arg)
|
incnmaster(const Arg *arg)
|
||||||
{
|
{
|
||||||
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0);
|
selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1227,6 +1147,7 @@ killclient(const Arg *arg)
|
||||||
{
|
{
|
||||||
if (!selmon->sel)
|
if (!selmon->sel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0 , 0, 0)) {
|
if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0 , 0, 0)) {
|
||||||
XGrabServer(dpy);
|
XGrabServer(dpy);
|
||||||
XSetErrorHandler(xerrordummy);
|
XSetErrorHandler(xerrordummy);
|
||||||
|
@ -1286,7 +1207,7 @@ manage(Window w, XWindowAttributes *wa)
|
||||||
c->isfloating = c->oldstate = trans != None || c->isfixed;
|
c->isfloating = c->oldstate = trans != None || c->isfixed;
|
||||||
if (c->isfloating)
|
if (c->isfloating)
|
||||||
XRaiseWindow(dpy, c->win);
|
XRaiseWindow(dpy, c->win);
|
||||||
attachaside(c);
|
attach(c);
|
||||||
attachstack(c);
|
attachstack(c);
|
||||||
XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
|
XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
|
||||||
(unsigned char *) &(c->win), 1);
|
(unsigned char *) &(c->win), 1);
|
||||||
|
@ -1315,6 +1236,7 @@ maprequest(XEvent *e)
|
||||||
{
|
{
|
||||||
static XWindowAttributes wa;
|
static XWindowAttributes wa;
|
||||||
XMapRequestEvent *ev = &e->xmaprequest;
|
XMapRequestEvent *ev = &e->xmaprequest;
|
||||||
|
|
||||||
Client *i;
|
Client *i;
|
||||||
if ((i = wintosystrayicon(ev->window))) {
|
if ((i = wintosystrayicon(ev->window))) {
|
||||||
sendevent(i->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0, systray->win, XEMBED_EMBEDDED_VERSION);
|
sendevent(i->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0, systray->win, XEMBED_EMBEDDED_VERSION);
|
||||||
|
@ -1330,20 +1252,20 @@ maprequest(XEvent *e)
|
||||||
manage(ev->window, &wa);
|
manage(ev->window, &wa);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void
|
void
|
||||||
//monocle(Monitor *m)
|
monocle(Monitor *m)
|
||||||
//{
|
{
|
||||||
// unsigned int n = 0;
|
unsigned int n = 0;
|
||||||
// Client *c;
|
Client *c;
|
||||||
|
|
||||||
// for (c = m->clients; c; c = c->next)
|
for (c = m->clients; c; c = c->next)
|
||||||
// if (ISVISIBLE(c))
|
if (ISVISIBLE(c))
|
||||||
// n++;
|
n++;
|
||||||
// if (n > 0) /* override layout symbol */
|
if (n > 0) /* override layout symbol */
|
||||||
// snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
|
snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
|
||||||
// for (c = nexttiled(m->clients); c; c = nexttiled(c->next))
|
for (c = nexttiled(m->clients); c; c = nexttiled(c->next))
|
||||||
// resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
|
resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
|
||||||
//}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
motionnotify(XEvent *e)
|
motionnotify(XEvent *e)
|
||||||
|
@ -1422,16 +1344,6 @@ movemouse(const Arg *arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *
|
|
||||||
nexttagged(Client *c) {
|
|
||||||
Client *walked = c->mon->clients;
|
|
||||||
for(;
|
|
||||||
walked && (walked->isfloating || !ISVISIBLEONTAG(walked, c->tags));
|
|
||||||
walked = walked->next
|
|
||||||
);
|
|
||||||
return walked;
|
|
||||||
}
|
|
||||||
|
|
||||||
Client *
|
Client *
|
||||||
nexttiled(Client *c)
|
nexttiled(Client *c)
|
||||||
{
|
{
|
||||||
|
@ -1465,7 +1377,8 @@ propertynotify(XEvent *e)
|
||||||
resizebarwin(selmon);
|
resizebarwin(selmon);
|
||||||
updatesystray();
|
updatesystray();
|
||||||
}
|
}
|
||||||
if ((ev->window == root) && (ev->atom == XA_WM_NAME))
|
|
||||||
|
if ((ev->window == root) && (ev->atom == XA_WM_NAME))
|
||||||
updatestatus();
|
updatestatus();
|
||||||
else if (ev->state == PropertyDelete)
|
else if (ev->state == PropertyDelete)
|
||||||
return; /* ignore */
|
return; /* ignore */
|
||||||
|
@ -1498,7 +1411,6 @@ propertynotify(XEvent *e)
|
||||||
void
|
void
|
||||||
quit(const Arg *arg)
|
quit(const Arg *arg)
|
||||||
{
|
{
|
||||||
if(arg->i) restart = 1;
|
|
||||||
running = 0;
|
running = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1529,7 +1441,6 @@ removesystrayicon(Client *i)
|
||||||
free(i);
|
free(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
resize(Client *c, int x, int y, int w, int h, int interact)
|
resize(Client *c, int x, int y, int w, int h, int interact)
|
||||||
{
|
{
|
||||||
|
@ -1540,7 +1451,7 @@ resize(Client *c, int x, int y, int w, int h, int interact)
|
||||||
void
|
void
|
||||||
resizebarwin(Monitor *m) {
|
resizebarwin(Monitor *m) {
|
||||||
unsigned int w = m->ww;
|
unsigned int w = m->ww;
|
||||||
if (showsystray && m == systraytomon(m))
|
if (showsystray && m == systraytomon(m) && !systrayonleft)
|
||||||
w -= getsystraywidth();
|
w -= getsystraywidth();
|
||||||
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, w, bh);
|
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, w, bh);
|
||||||
}
|
}
|
||||||
|
@ -1653,40 +1564,6 @@ restack(Monitor *m)
|
||||||
}
|
}
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
||||||
if (m == selmon && (m->tagset[m->seltags] & m->sel->tags) && selmon->lt[selmon->sellt] != &layouts[2])
|
|
||||||
warp(m->sel);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
rotatestack(const Arg *arg)
|
|
||||||
{
|
|
||||||
Client *c = NULL, *f;
|
|
||||||
|
|
||||||
if (!selmon->sel)
|
|
||||||
return;
|
|
||||||
f = selmon->sel;
|
|
||||||
if (arg->i > 0) {
|
|
||||||
for (c = nexttiled(selmon->clients); c && nexttiled(c->next); c = nexttiled(c->next));
|
|
||||||
if (c){
|
|
||||||
detach(c);
|
|
||||||
attach(c);
|
|
||||||
detachstack(c);
|
|
||||||
attachstack(c);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ((c = nexttiled(selmon->clients))){
|
|
||||||
detach(c);
|
|
||||||
enqueue(c);
|
|
||||||
detachstack(c);
|
|
||||||
enqueuestack(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (c){
|
|
||||||
arrange(selmon);
|
|
||||||
//unfocus(f, 1);
|
|
||||||
focus(f);
|
|
||||||
restack(selmon);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1701,80 +1578,9 @@ run(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
runautostart(void)
|
runAutostart(void) {
|
||||||
{
|
system("cd ~/.dwm; ./autostart_blocking.sh");
|
||||||
char *pathpfx;
|
system("cd ~/.dwm; ./autostart.sh &");
|
||||||
char *path;
|
|
||||||
char *xdgdatahome;
|
|
||||||
char *home;
|
|
||||||
struct stat sb;
|
|
||||||
|
|
||||||
if ((home = getenv("HOME")) == NULL)
|
|
||||||
/* this is almost impossible */
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* if $XDG_DATA_HOME is set and not empty, use $XDG_DATA_HOME/dwm,
|
|
||||||
* otherwise use ~/.local/share/dwm as autostart script directory
|
|
||||||
*/
|
|
||||||
xdgdatahome = getenv("XDG_DATA_HOME");
|
|
||||||
if (xdgdatahome != NULL && *xdgdatahome != '\0') {
|
|
||||||
/* space for path segments, separators and nul */
|
|
||||||
pathpfx = ecalloc(1, strlen(xdgdatahome) + strlen(dwmdir) + 2);
|
|
||||||
|
|
||||||
if (sprintf(pathpfx, "%s/%s", xdgdatahome, dwmdir) <= 0) {
|
|
||||||
free(pathpfx);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* space for path segments, separators and nul */
|
|
||||||
pathpfx = ecalloc(1, strlen(home) + strlen(localshare)
|
|
||||||
+ strlen(dwmdir) + 3);
|
|
||||||
|
|
||||||
if (sprintf(pathpfx, "%s/%s/%s", home, localshare, dwmdir) < 0) {
|
|
||||||
free(pathpfx);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check if the autostart script directory exists */
|
|
||||||
if (! (stat(pathpfx, &sb) == 0 && S_ISDIR(sb.st_mode))) {
|
|
||||||
/* the XDG conformant path does not exist or is no directory
|
|
||||||
* so we try ~/.dwm instead
|
|
||||||
*/
|
|
||||||
char *pathpfx_new = realloc(pathpfx, strlen(home) + strlen(dwmdir) + 3);
|
|
||||||
if(pathpfx_new == NULL) {
|
|
||||||
free(pathpfx);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
pathpfx = pathpfx_new;
|
|
||||||
|
|
||||||
if (sprintf(pathpfx, "%s/.%s", home, dwmdir) <= 0) {
|
|
||||||
free(pathpfx);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* try the blocking script first */
|
|
||||||
path = ecalloc(1, strlen(pathpfx) + strlen(autostartblocksh) + 2);
|
|
||||||
if (sprintf(path, "%s/%s", pathpfx, autostartblocksh) <= 0) {
|
|
||||||
free(path);
|
|
||||||
free(pathpfx);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (access(path, X_OK) == 0)
|
|
||||||
system(path);
|
|
||||||
|
|
||||||
/* now the non-blocking script */
|
|
||||||
if (sprintf(path, "%s/%s", pathpfx, autostartsh) <= 0) {
|
|
||||||
free(path);
|
|
||||||
free(pathpfx);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (access(path, X_OK) == 0)
|
|
||||||
system(strcat(path, " &"));
|
|
||||||
|
|
||||||
free(pathpfx);
|
|
||||||
free(path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1804,42 +1610,6 @@ scan(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
schemeCycle(const Arg *arg) {
|
|
||||||
|
|
||||||
if ((SchemeSel + 2) < LENGTH(colors))
|
|
||||||
{
|
|
||||||
SchemeNorm += 2;
|
|
||||||
SchemeSel += 2;
|
|
||||||
} else {
|
|
||||||
SchemeNorm = 0;
|
|
||||||
SchemeSel = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
drawbars();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
schemeToggle(const Arg *arg) {
|
|
||||||
|
|
||||||
int numThemePairs = LENGTH(colors) / 4;
|
|
||||||
int sheme = SchemeNorm / 2;
|
|
||||||
|
|
||||||
if (sheme / 2 > numThemePairs-1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sheme % 2 == 0) {
|
|
||||||
SchemeNorm += 2;
|
|
||||||
SchemeSel += 2;
|
|
||||||
} else {
|
|
||||||
SchemeNorm -= 2;
|
|
||||||
SchemeSel -= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
drawbars();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
sendmon(Client *c, Monitor *m)
|
sendmon(Client *c, Monitor *m)
|
||||||
{
|
{
|
||||||
|
@ -1850,7 +1620,7 @@ sendmon(Client *c, Monitor *m)
|
||||||
detachstack(c);
|
detachstack(c);
|
||||||
c->mon = m;
|
c->mon = m;
|
||||||
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
|
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
|
||||||
attachaside(c);
|
attach(c);
|
||||||
attachstack(c);
|
attachstack(c);
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
arrange(NULL);
|
arrange(NULL);
|
||||||
|
@ -1884,7 +1654,8 @@ sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, lo
|
||||||
else {
|
else {
|
||||||
exists = True;
|
exists = True;
|
||||||
mt = proto;
|
mt = proto;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exists) {
|
if (exists) {
|
||||||
ev.type = ClientMessage;
|
ev.type = ClientMessage;
|
||||||
ev.xclient.window = w;
|
ev.xclient.window = w;
|
||||||
|
@ -1954,9 +1725,9 @@ void
|
||||||
setlayout(const Arg *arg)
|
setlayout(const Arg *arg)
|
||||||
{
|
{
|
||||||
if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
|
if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
|
||||||
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag] ^= 1;
|
selmon->sellt ^= 1;
|
||||||
if (arg && arg->v)
|
if (arg && arg->v)
|
||||||
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
|
selmon->lt[selmon->sellt] = (Layout *)arg->v;
|
||||||
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
|
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
|
||||||
if (selmon->sel)
|
if (selmon->sel)
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
|
@ -1975,7 +1746,7 @@ setmfact(const Arg *arg)
|
||||||
f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
|
f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
|
||||||
if (f < 0.05 || f > 0.95)
|
if (f < 0.05 || f > 0.95)
|
||||||
return;
|
return;
|
||||||
selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f;
|
selmon->mfact = f;
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1989,9 +1760,6 @@ setup(void)
|
||||||
/* clean up any zombies immediately */
|
/* clean up any zombies immediately */
|
||||||
sigchld(0);
|
sigchld(0);
|
||||||
|
|
||||||
signal(SIGHUP, sighup);
|
|
||||||
signal(SIGTERM, sigterm);
|
|
||||||
|
|
||||||
/* init screen */
|
/* init screen */
|
||||||
screen = DefaultScreen(dpy);
|
screen = DefaultScreen(dpy);
|
||||||
sw = DisplayWidth(dpy, screen);
|
sw = DisplayWidth(dpy, screen);
|
||||||
|
@ -2010,12 +1778,12 @@ setup(void)
|
||||||
wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
|
wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
|
||||||
wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False);
|
wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False);
|
||||||
netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
|
netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
|
||||||
netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
||||||
netatom[NetSystemTray] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_S0", False);
|
netatom[NetSystemTray] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_S0", False);
|
||||||
netatom[NetSystemTrayOP] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE", False);
|
netatom[NetSystemTrayOP] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE", False);
|
||||||
netatom[NetSystemTrayOrientation] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION", False);
|
netatom[NetSystemTrayOrientation] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION", False);
|
||||||
netatom[NetSystemTrayOrientationHorz] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION_HORZ", False);
|
netatom[NetSystemTrayOrientationHorz] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION_HORZ", False);
|
||||||
netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
||||||
netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
|
netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
|
||||||
netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
|
netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
|
||||||
netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
||||||
|
@ -2025,7 +1793,7 @@ setup(void)
|
||||||
xatom[Manager] = XInternAtom(dpy, "MANAGER", False);
|
xatom[Manager] = XInternAtom(dpy, "MANAGER", False);
|
||||||
xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False);
|
xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False);
|
||||||
xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False);
|
xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False);
|
||||||
/* init cursors */
|
/* init cursors */
|
||||||
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
|
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
|
||||||
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
|
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
|
||||||
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
|
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
|
||||||
|
@ -2101,20 +1869,6 @@ sigchld(int unused)
|
||||||
while (0 < waitpid(-1, NULL, WNOHANG));
|
while (0 < waitpid(-1, NULL, WNOHANG));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
sighup(int unused)
|
|
||||||
{
|
|
||||||
Arg a = {.i = 1};
|
|
||||||
quit(&a);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
sigterm(int unused)
|
|
||||||
{
|
|
||||||
Arg a = {.i = 0};
|
|
||||||
quit(&a);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
spawn(const Arg *arg)
|
spawn(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
@ -2180,7 +1934,7 @@ tile(Monitor *m)
|
||||||
void
|
void
|
||||||
togglebar(const Arg *arg)
|
togglebar(const Arg *arg)
|
||||||
{
|
{
|
||||||
selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar;
|
selmon->showbar = !selmon->showbar;
|
||||||
updatebarpos(selmon);
|
updatebarpos(selmon);
|
||||||
resizebarwin(selmon);
|
resizebarwin(selmon);
|
||||||
if (showsystray) {
|
if (showsystray) {
|
||||||
|
@ -2230,33 +1984,9 @@ void
|
||||||
toggleview(const Arg *arg)
|
toggleview(const Arg *arg)
|
||||||
{
|
{
|
||||||
unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
|
unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
|
||||||
int i;
|
|
||||||
|
|
||||||
if (newtagset) {
|
if (newtagset) {
|
||||||
selmon->tagset[selmon->seltags] = newtagset;
|
selmon->tagset[selmon->seltags] = newtagset;
|
||||||
|
|
||||||
if (newtagset == ~0) {
|
|
||||||
selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
||||||
selmon->pertag->curtag = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* test if the user did not select the same tag */
|
|
||||||
if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) {
|
|
||||||
selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
||||||
for (i = 0; !(newtagset & 1 << i); i++) ;
|
|
||||||
selmon->pertag->curtag = i + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* apply settings for this view */
|
|
||||||
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
||||||
selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
|
|
||||||
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
|
||||||
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
|
||||||
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
|
||||||
|
|
||||||
if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
|
|
||||||
togglebar(NULL);
|
|
||||||
|
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
@ -2337,9 +2067,10 @@ updatebars(void)
|
||||||
w = m->ww;
|
w = m->ww;
|
||||||
if (showsystray && m == systraytomon(m))
|
if (showsystray && m == systraytomon(m))
|
||||||
w -= getsystraywidth();
|
w -= getsystraywidth();
|
||||||
m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
|
m->barwin = XCreateWindow(dpy, root, m->wx, m->by, w, bh, 0, DefaultDepth(dpy, screen),
|
||||||
CopyFromParent, DefaultVisual(dpy, screen),
|
CopyFromParent, DefaultVisual(dpy, screen),
|
||||||
CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
|
CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
|
||||||
|
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
|
||||||
if (showsystray && m == systraytomon(m))
|
if (showsystray && m == systraytomon(m))
|
||||||
XMapRaised(dpy, systray->win);
|
XMapRaised(dpy, systray->win);
|
||||||
XMapRaised(dpy, m->barwin);
|
XMapRaised(dpy, m->barwin);
|
||||||
|
@ -2424,7 +2155,7 @@ updategeom(void)
|
||||||
m->clients = c->next;
|
m->clients = c->next;
|
||||||
detachstack(c);
|
detachstack(c);
|
||||||
c->mon = mons;
|
c->mon = mons;
|
||||||
attachaside(c);
|
attach(c);
|
||||||
attachstack(c);
|
attachstack(c);
|
||||||
}
|
}
|
||||||
if (m == selmon)
|
if (m == selmon)
|
||||||
|
@ -2515,11 +2246,13 @@ void
|
||||||
updatestatus(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);
|
strcpy(stext, " Linux 6.3 >");
|
||||||
|
//strcpy(stext, "dwm-"VERSION);
|
||||||
drawbar(selmon);
|
drawbar(selmon);
|
||||||
updatesystray();
|
updatesystray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
updatesystrayicongeom(Client *i, int w, int h)
|
updatesystrayicongeom(Client *i, int w, int h)
|
||||||
{
|
{
|
||||||
|
@ -2579,10 +2312,13 @@ updatesystray(void)
|
||||||
Client *i;
|
Client *i;
|
||||||
Monitor *m = systraytomon(NULL);
|
Monitor *m = systraytomon(NULL);
|
||||||
unsigned int x = m->mx + m->mw;
|
unsigned int x = m->mx + m->mw;
|
||||||
|
unsigned int sw = TEXTW(stext) - lrpad + systrayspacing;
|
||||||
unsigned int w = 1;
|
unsigned int w = 1;
|
||||||
|
|
||||||
if (!showsystray)
|
if (!showsystray)
|
||||||
return;
|
return;
|
||||||
|
if (systrayonleft)
|
||||||
|
x -= sw + lrpad / 2;
|
||||||
if (!systray) {
|
if (!systray) {
|
||||||
/* init systray */
|
/* init systray */
|
||||||
if (!(systray = (Systray *)calloc(1, sizeof(Systray))))
|
if (!(systray = (Systray *)calloc(1, sizeof(Systray))))
|
||||||
|
@ -2677,63 +2413,15 @@ updatewmhints(Client *c)
|
||||||
void
|
void
|
||||||
view(const Arg *arg)
|
view(const Arg *arg)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
unsigned int tmptag;
|
|
||||||
|
|
||||||
if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
|
if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
|
||||||
return;
|
return;
|
||||||
selmon->seltags ^= 1; /* toggle sel tagset */
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
||||||
if (arg->ui & TAGMASK) {
|
if (arg->ui & TAGMASK)
|
||||||
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
|
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
|
||||||
selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
||||||
|
|
||||||
if (arg->ui == ~0)
|
|
||||||
selmon->pertag->curtag = 0;
|
|
||||||
else {
|
|
||||||
for (i = 0; !(arg->ui & 1 << i); i++) ;
|
|
||||||
selmon->pertag->curtag = i + 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tmptag = selmon->pertag->prevtag;
|
|
||||||
selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
||||||
selmon->pertag->curtag = tmptag;
|
|
||||||
}
|
|
||||||
|
|
||||||
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
||||||
selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
|
|
||||||
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
|
||||||
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
|
||||||
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
|
||||||
|
|
||||||
if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
|
|
||||||
togglebar(NULL);
|
|
||||||
|
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
warp(const Client *c)
|
|
||||||
{
|
|
||||||
int x, y;
|
|
||||||
|
|
||||||
if (!c) {
|
|
||||||
XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->wx + selmon->ww/2, selmon->wy + selmon->wh/2);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getrootptr(&x, &y) ||
|
|
||||||
(x > c->x - c->bw &&
|
|
||||||
y > c->y - c->bw &&
|
|
||||||
x < c->x + c->w + c->bw*2 &&
|
|
||||||
y < c->y + c->h + c->bw*2) ||
|
|
||||||
(y > c->mon->by && y < c->mon->by + bh) ||
|
|
||||||
(c->mon->topbar && !y))
|
|
||||||
return;
|
|
||||||
|
|
||||||
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
Client *
|
Client *
|
||||||
wintoclient(Window w)
|
wintoclient(Window w)
|
||||||
{
|
{
|
||||||
|
@ -2844,7 +2532,8 @@ int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
if (argc == 2 && !strcmp("-v", argv[1]))
|
if (argc == 2 && !strcmp("-v", argv[1]))
|
||||||
die("dwm-"VERSION);
|
//die("dwm-"VERSION);
|
||||||
|
die(" Linux 6.3 >");
|
||||||
else if (argc != 1)
|
else if (argc != 1)
|
||||||
die("usage: dwm [-v]");
|
die("usage: dwm [-v]");
|
||||||
if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
|
if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
|
||||||
|
@ -2858,9 +2547,8 @@ main(int argc, char *argv[])
|
||||||
die("pledge");
|
die("pledge");
|
||||||
#endif /* __OpenBSD__ */
|
#endif /* __OpenBSD__ */
|
||||||
scan();
|
scan();
|
||||||
runautostart();
|
runAutostart();
|
||||||
run();
|
run();
|
||||||
if(restart) execvp(argv[0], argv);
|
|
||||||
cleanup();
|
cleanup();
|
||||||
XCloseDisplay(dpy);
|
XCloseDisplay(dpy);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
BIN
.config/dwm/dwm.png
Normal file
BIN
.config/dwm/dwm.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 373 B |
|
@ -1,102 +0,0 @@
|
||||||
void
|
|
||||||
grid(Monitor *m) {
|
|
||||||
unsigned int i, n, cx, cy, cw, ch, aw, ah, cols, rows;
|
|
||||||
Client *c;
|
|
||||||
|
|
||||||
for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next))
|
|
||||||
n++;
|
|
||||||
|
|
||||||
/* grid dimensions */
|
|
||||||
for(rows = 0; rows <= n/2; rows++)
|
|
||||||
if(rows*rows >= n)
|
|
||||||
break;
|
|
||||||
cols = (rows && (rows - 1) * rows >= n) ? rows - 1 : rows;
|
|
||||||
|
|
||||||
/* window geoms (cell height/width) */
|
|
||||||
ch = m->wh / (rows ? rows : 1);
|
|
||||||
cw = m->ww / (cols ? cols : 1);
|
|
||||||
for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
|
|
||||||
cx = m->wx + (i / rows) * cw;
|
|
||||||
cy = m->wy + (i % rows) * ch;
|
|
||||||
/* adjust height/width of last row/column's windows */
|
|
||||||
ah = ((i + 1) % rows == 0) ? m->wh - ch * rows : 0;
|
|
||||||
aw = (i >= rows * (cols - 1)) ? m->ww - cw * cols : 0;
|
|
||||||
resize(c, cx, cy, cw - 2 * c->bw + aw, ch - 2 * c->bw + ah, False);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
tcl(Monitor * m)
|
|
||||||
{
|
|
||||||
int x, y, h, w, mw, sw, bdw;
|
|
||||||
unsigned int i, n;
|
|
||||||
Client * c;
|
|
||||||
|
|
||||||
for (n = 0, c = nexttiled(m->clients); c;
|
|
||||||
c = nexttiled(c->next), n++);
|
|
||||||
|
|
||||||
if (n == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
c = nexttiled(m->clients);
|
|
||||||
|
|
||||||
mw = m->mfact * m->ww;
|
|
||||||
sw = (m->ww - mw) / 2;
|
|
||||||
bdw = (2 * c->bw);
|
|
||||||
resize(c,
|
|
||||||
n < 3 ? m->wx : m->wx + sw,
|
|
||||||
m->wy,
|
|
||||||
n == 1 ? m->ww - bdw : mw - bdw,
|
|
||||||
m->wh - bdw,
|
|
||||||
False);
|
|
||||||
|
|
||||||
if (--n == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
w = (m->ww - mw) / ((n > 1) + 1);
|
|
||||||
c = nexttiled(c->next);
|
|
||||||
|
|
||||||
if (n > 1)
|
|
||||||
{
|
|
||||||
x = m->wx + ((n > 1) ? mw + sw : mw);
|
|
||||||
y = m->wy;
|
|
||||||
h = m->wh / (n / 2);
|
|
||||||
|
|
||||||
if (h < bh)
|
|
||||||
h = m->wh;
|
|
||||||
|
|
||||||
for (i = 0; c && i < n / 2; c = nexttiled(c->next), i++)
|
|
||||||
{
|
|
||||||
resize(c,
|
|
||||||
x,
|
|
||||||
y,
|
|
||||||
w - bdw,
|
|
||||||
(i + 1 == n / 2) ? m->wy + m->wh - y - bdw : h - bdw,
|
|
||||||
False);
|
|
||||||
|
|
||||||
if (h != m->wh)
|
|
||||||
y = c->y + HEIGHT(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
x = (n + 1 / 2) == 1 ? mw : m->wx;
|
|
||||||
y = m->wy;
|
|
||||||
h = m->wh / ((n + 1) / 2);
|
|
||||||
|
|
||||||
if (h < bh)
|
|
||||||
h = m->wh;
|
|
||||||
|
|
||||||
for (i = 0; c; c = nexttiled(c->next), i++)
|
|
||||||
{
|
|
||||||
resize(c,
|
|
||||||
x,
|
|
||||||
y,
|
|
||||||
(i + 1 == (n + 1) / 2) ? w - bdw : w - bdw,
|
|
||||||
(i + 1 == (n + 1) / 2) ? m->wy + m->wh - y - bdw : h - bdw,
|
|
||||||
False);
|
|
||||||
|
|
||||||
if (h != m->wh)
|
|
||||||
y = c->y + HEIGHT(c);
|
|
||||||
}
|
|
||||||
}
|
|
BIN
.config/dwm/old/dwm-6.2-config.tar.gz
Normal file
BIN
.config/dwm/old/dwm-6.2-config.tar.gz
Normal file
Binary file not shown.
7
.config/dwm/patch.sh
Executable file
7
.config/dwm/patch.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#patch < patches/dwm-layoutmenu-6.2.diff
|
||||||
|
patch < patches/dwm-systray-6.3.diff
|
||||||
|
patch < patches/dwm-fullgaps-20200508-7b77734.diff
|
||||||
|
patch < patches/dwm-autostart-20161205-bb3bd6f.diff
|
||||||
|
patch < patches/dwm-cyclelayouts-20180524-6.2.diff
|
39
.config/dwm/patches/dwm-autostart-20161205-bb3bd6f.diff
Normal file
39
.config/dwm/patches/dwm-autostart-20161205-bb3bd6f.diff
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
commit 5918623c5bd7fda155bf9dc3d33890c4ae1722d0
|
||||||
|
Author: Simon Bremer <simon.bremer@tum.de>
|
||||||
|
Date: Thu Dec 22 17:31:07 2016 +0100
|
||||||
|
|
||||||
|
Applied and fixed autostart patch for previous version;
|
||||||
|
|
||||||
|
diff --git a/dwm.c b/dwm.c
|
||||||
|
index d27cb67..066ed71 100644
|
||||||
|
--- a/dwm.c
|
||||||
|
+++ b/dwm.c
|
||||||
|
@@ -194,6 +194,7 @@ static void resizeclient(Client *c, int x, int y, int w, int h);
|
||||||
|
static void resizemouse(const Arg *arg);
|
||||||
|
static void restack(Monitor *m);
|
||||||
|
static void run(void);
|
||||||
|
+static void runAutostart(void);
|
||||||
|
static void scan(void);
|
||||||
|
static int sendevent(Client *c, Atom proto);
|
||||||
|
static void sendmon(Client *c, Monitor *m);
|
||||||
|
@@ -1386,6 +1387,12 @@ run(void)
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
+runAutostart(void) {
|
||||||
|
+ system("cd ~/.dwm; ./autostart_blocking.sh");
|
||||||
|
+ system("cd ~/.dwm; ./autostart.sh &");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
scan(void)
|
||||||
|
{
|
||||||
|
unsigned int i, num;
|
||||||
|
@@ -2145,6 +2152,7 @@ main(int argc, char *argv[])
|
||||||
|
checkotherwm();
|
||||||
|
setup();
|
||||||
|
scan();
|
||||||
|
+ runAutostart();
|
||||||
|
run();
|
||||||
|
cleanup();
|
||||||
|
XCloseDisplay(dpy);
|
179
.config/dwm/patches/dwm-autostart-20210120-cb3f58a.diff
Normal file
179
.config/dwm/patches/dwm-autostart-20210120-cb3f58a.diff
Normal file
|
@ -0,0 +1,179 @@
|
||||||
|
From 37e970479dc5d40e57fc0cbfeaa5e39941483237 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Gan Ainm <gan.ainm.riomhphost@gmail.com>
|
||||||
|
Date: Wed, 10 Jun 2020 10:59:02 +0000
|
||||||
|
Subject: [PATCH] dwm-xdgautostart-6.2.diff
|
||||||
|
|
||||||
|
===================================================================
|
||||||
|
---
|
||||||
|
dwm.1 | 23 +++++++++++++++++
|
||||||
|
dwm.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
2 files changed, 105 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/dwm.1 b/dwm.1
|
||||||
|
index 13b3729..9533aa6 100644
|
||||||
|
--- a/dwm.1
|
||||||
|
+++ b/dwm.1
|
||||||
|
@@ -30,6 +30,14 @@ top left corner. The tags which are applied to one or more windows are
|
||||||
|
indicated with an empty square in the top left corner.
|
||||||
|
.P
|
||||||
|
dwm draws a small border around windows to indicate the focus state.
|
||||||
|
+.P
|
||||||
|
+On start, dwm can start additional programs that may be specified in two special
|
||||||
|
+shell scripts (see the FILES section below), autostart_blocking.sh and
|
||||||
|
+autostart.sh. The former is executed first and dwm will wait for its
|
||||||
|
+termination before starting. The latter is executed in the background before
|
||||||
|
+dwm enters its handler loop.
|
||||||
|
+.P
|
||||||
|
+Either of these files may be omitted.
|
||||||
|
.SH OPTIONS
|
||||||
|
.TP
|
||||||
|
.B \-v
|
||||||
|
@@ -152,6 +160,21 @@ Toggles focused window between floating and tiled state.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Button3
|
||||||
|
Resize focused window while dragging. Tiled windows will be toggled to the floating state.
|
||||||
|
+.SH FILES
|
||||||
|
+The files containing programs to be started along with dwm are searched for in
|
||||||
|
+the following directories:
|
||||||
|
+.IP "1. $XDG_DATA_HOME/dwm"
|
||||||
|
+.IP "2. $HOME/.local/share/dwm"
|
||||||
|
+.IP "3. $HOME/.dwm"
|
||||||
|
+.P
|
||||||
|
+The first existing directory is scanned for any of the autostart files below.
|
||||||
|
+.TP 15
|
||||||
|
+autostart.sh
|
||||||
|
+This file is started as a shell background process before dwm enters its handler
|
||||||
|
+loop.
|
||||||
|
+.TP 15
|
||||||
|
+autostart_blocking.sh
|
||||||
|
+This file is started before any autostart.sh; dwm waits for its termination.
|
||||||
|
.SH CUSTOMIZATION
|
||||||
|
dwm is customized by creating a custom config.h and (re)compiling the source
|
||||||
|
code. This keeps it fast, secure and simple.
|
||||||
|
diff --git a/dwm.c b/dwm.c
|
||||||
|
index 4465af1..2156b49 100644
|
||||||
|
--- a/dwm.c
|
||||||
|
+++ b/dwm.c
|
||||||
|
@@ -29,6 +29,7 @@
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
+#include <sys/stat.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <X11/cursorfont.h>
|
||||||
|
#include <X11/keysym.h>
|
||||||
|
@@ -193,6 +194,7 @@ static void resizeclient(Client *c, int x, int y, int w, int h);
|
||||||
|
static void resizemouse(const Arg *arg);
|
||||||
|
static void restack(Monitor *m);
|
||||||
|
static void run(void);
|
||||||
|
+static void runautostart(void);
|
||||||
|
static void scan(void);
|
||||||
|
static int sendevent(Client *c, Atom proto);
|
||||||
|
static void sendmon(Client *c, Monitor *m);
|
||||||
|
@@ -235,7 +237,11 @@ static int xerrorstart(Display *dpy, XErrorEvent *ee);
|
||||||
|
static void zoom(const Arg *arg);
|
||||||
|
|
||||||
|
/* variables */
|
||||||
|
+static const char autostartblocksh[] = "autostart_blocking.sh";
|
||||||
|
+static const char autostartsh[] = "autostart.sh";
|
||||||
|
static const char broken[] = "broken";
|
||||||
|
+static const char dwmdir[] = "dwm";
|
||||||
|
+static const char localshare[] = ".local/share";
|
||||||
|
static char stext[256];
|
||||||
|
static int screen;
|
||||||
|
static int sw, sh; /* X display screen geometry width, height */
|
||||||
|
@@ -1380,6 +1386,83 @@ run(void)
|
||||||
|
handler[ev.type](&ev); /* call handler */
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+runautostart(void)
|
||||||
|
+{
|
||||||
|
+ char *pathpfx;
|
||||||
|
+ char *path;
|
||||||
|
+ char *xdgdatahome;
|
||||||
|
+ char *home;
|
||||||
|
+ struct stat sb;
|
||||||
|
+
|
||||||
|
+ if ((home = getenv("HOME")) == NULL)
|
||||||
|
+ /* this is almost impossible */
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ /* if $XDG_DATA_HOME is set and not empty, use $XDG_DATA_HOME/dwm,
|
||||||
|
+ * otherwise use ~/.local/share/dwm as autostart script directory
|
||||||
|
+ */
|
||||||
|
+ xdgdatahome = getenv("XDG_DATA_HOME");
|
||||||
|
+ if (xdgdatahome != NULL && *xdgdatahome != '\0') {
|
||||||
|
+ /* space for path segments, separators and nul */
|
||||||
|
+ pathpfx = ecalloc(1, strlen(xdgdatahome) + strlen(dwmdir) + 2);
|
||||||
|
+
|
||||||
|
+ if (sprintf(pathpfx, "%s/%s", xdgdatahome, dwmdir) <= 0) {
|
||||||
|
+ free(pathpfx);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ /* space for path segments, separators and nul */
|
||||||
|
+ pathpfx = ecalloc(1, strlen(home) + strlen(localshare)
|
||||||
|
+ + strlen(dwmdir) + 3);
|
||||||
|
+
|
||||||
|
+ if (sprintf(pathpfx, "%s/%s/%s", home, localshare, dwmdir) < 0) {
|
||||||
|
+ free(pathpfx);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* check if the autostart script directory exists */
|
||||||
|
+ if (! (stat(pathpfx, &sb) == 0 && S_ISDIR(sb.st_mode))) {
|
||||||
|
+ /* the XDG conformant path does not exist or is no directory
|
||||||
|
+ * so we try ~/.dwm instead
|
||||||
|
+ */
|
||||||
|
+ char *pathpfx_new = realloc(pathpfx, strlen(home) + strlen(dwmdir) + 3);
|
||||||
|
+ if(pathpfx_new == NULL) {
|
||||||
|
+ free(pathpfx);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ pathpfx = pathpfx_new;
|
||||||
|
+
|
||||||
|
+ if (sprintf(pathpfx, "%s/.%s", home, dwmdir) <= 0) {
|
||||||
|
+ free(pathpfx);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* try the blocking script first */
|
||||||
|
+ path = ecalloc(1, strlen(pathpfx) + strlen(autostartblocksh) + 2);
|
||||||
|
+ if (sprintf(path, "%s/%s", pathpfx, autostartblocksh) <= 0) {
|
||||||
|
+ free(path);
|
||||||
|
+ free(pathpfx);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (access(path, X_OK) == 0)
|
||||||
|
+ system(path);
|
||||||
|
+
|
||||||
|
+ /* now the non-blocking script */
|
||||||
|
+ if (sprintf(path, "%s/%s", pathpfx, autostartsh) <= 0) {
|
||||||
|
+ free(path);
|
||||||
|
+ free(pathpfx);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (access(path, X_OK) == 0)
|
||||||
|
+ system(strcat(path, " &"));
|
||||||
|
+
|
||||||
|
+ free(pathpfx);
|
||||||
|
+ free(path);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
scan(void)
|
||||||
|
{
|
||||||
|
@@ -2142,6 +2223,7 @@ main(int argc, char *argv[])
|
||||||
|
die("pledge");
|
||||||
|
#endif /* __OpenBSD__ */
|
||||||
|
scan();
|
||||||
|
+ runautostart();
|
||||||
|
run();
|
||||||
|
cleanup();
|
||||||
|
XCloseDisplay(dpy);
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
68
.config/dwm/patches/dwm-colorbar-6.2.diff
Normal file
68
.config/dwm/patches/dwm-colorbar-6.2.diff
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 1c0b587..a516645 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -16,6 +16,11 @@ static const char *colors[][3] = {
|
||||||
|
/* fg bg border */
|
||||||
|
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||||
|
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||||
|
+ [SchemeStatus] = { col_gray3, col_gray1, "#000000" }, // Statusbar right {text,background,not used but cannot be empty}
|
||||||
|
+ [SchemeTagsSel] = { col_gray4, col_cyan, "#000000" }, // Tagbar left selected {text,background,not used but cannot be empty}
|
||||||
|
+ [SchemeTagsNorm] = { col_gray3, col_gray1, "#000000" }, // Tagbar left unselected {text,background,not used but cannot be empty}
|
||||||
|
+ [SchemeInfoSel] = { col_gray4, col_cyan, "#000000" }, // infobar middle selected {text,background,not used but cannot be empty}
|
||||||
|
+ [SchemeInfoNorm] = { col_gray3, col_gray1, "#000000" }, // infobar middle unselected {text,background,not used but cannot be empty}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* tagging */
|
||||||
|
diff --git a/dwm.c b/dwm.c
|
||||||
|
index 4465af1..0d1d2f7 100644
|
||||||
|
--- a/dwm.c
|
||||||
|
+++ b/dwm.c
|
||||||
|
@@ -59,7 +59,7 @@
|
||||||
|
|
||||||
|
/* enums */
|
||||||
|
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||||
|
-enum { SchemeNorm, SchemeSel }; /* color schemes */
|
||||||
|
+enum { SchemeNorm, SchemeSel, SchemeStatus, SchemeTagsSel, SchemeTagsNorm, SchemeInfoSel, SchemeInfoNorm }; /* color schemes */
|
||||||
|
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
||||||
|
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
|
||||||
|
NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
|
||||||
|
@@ -703,7 +703,7 @@ drawbar(Monitor *m)
|
||||||
|
|
||||||
|
/* draw status first so it can be overdrawn by tags later */
|
||||||
|
if (m == selmon) { /* status is only drawn on selected monitor */
|
||||||
|
- drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
|
+ drw_setscheme(drw, scheme[SchemeStatus]);
|
||||||
|
sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
|
||||||
|
drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0);
|
||||||
|
}
|
||||||
|
@@ -716,7 +716,7 @@ drawbar(Monitor *m)
|
||||||
|
x = 0;
|
||||||
|
for (i = 0; i < LENGTH(tags); i++) {
|
||||||
|
w = TEXTW(tags[i]);
|
||||||
|
- drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
|
||||||
|
+ drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsNorm]);
|
||||||
|
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
|
||||||
|
if (occ & 1 << i)
|
||||||
|
drw_rect(drw, x + boxs, boxs, boxw, boxw,
|
||||||
|
@@ -725,17 +725,17 @@ drawbar(Monitor *m)
|
||||||
|
x += w;
|
||||||
|
}
|
||||||
|
w = blw = TEXTW(m->ltsymbol);
|
||||||
|
- drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
|
+ drw_setscheme(drw, scheme[SchemeTagsNorm]);
|
||||||
|
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
||||||
|
|
||||||
|
if ((w = m->ww - sw - x) > bh) {
|
||||||
|
if (m->sel) {
|
||||||
|
- drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
||||||
|
+ drw_setscheme(drw, scheme[m == selmon ? SchemeInfoSel : SchemeInfoNorm]);
|
||||||
|
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
|
||||||
|
if (m->sel->isfloating)
|
||||||
|
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
|
||||||
|
} else {
|
||||||
|
- drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
|
+ drw_setscheme(drw, scheme[SchemeInfoNorm]);
|
||||||
|
drw_rect(drw, x, 0, w, bh, 1, 1);
|
||||||
|
}
|
||||||
|
}
|
93
.config/dwm/patches/dwm-cyclelayouts-20180524-6.2.diff
Normal file
93
.config/dwm/patches/dwm-cyclelayouts-20180524-6.2.diff
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
From a09e766a4342f580582082a92b2de65f33208eb4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Christopher Drelich <cd@cdrakka.com>
|
||||||
|
Date: Thu, 24 May 2018 00:56:56 -0400
|
||||||
|
Subject: [PATCH] Function to cycle through available layouts.
|
||||||
|
|
||||||
|
MOD-CTRL-, and MOD-CTRL-.
|
||||||
|
cycle backwards and forwards through available layouts.
|
||||||
|
Probably only useful if you have a lot of additional layouts.
|
||||||
|
The NULL, NULL layout should always be the last layout in your list,
|
||||||
|
in order to guarantee consistent behavior.
|
||||||
|
---
|
||||||
|
config.def.h | 3 +++
|
||||||
|
dwm.1 | 6 ++++++
|
||||||
|
dwm.c | 18 ++++++++++++++++++
|
||||||
|
3 files changed, 27 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index a9ac303..153b880 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -41,6 +41,7 @@ static const Layout layouts[] = {
|
||||||
|
{ "[]=", tile }, /* first entry is default */
|
||||||
|
{ "><>", NULL }, /* no layout function means floating behavior */
|
||||||
|
{ "[M]", monocle },
|
||||||
|
+ { NULL, NULL },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* key definitions */
|
||||||
|
@@ -76,6 +77,8 @@ static Key keys[] = {
|
||||||
|
{ 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, XK_0, view, {.ui = ~0 } },
|
||||||
|
diff --git a/dwm.1 b/dwm.1
|
||||||
|
index 13b3729..165891b 100644
|
||||||
|
--- a/dwm.1
|
||||||
|
+++ b/dwm.1
|
||||||
|
@@ -92,6 +92,12 @@ Sets monocle layout.
|
||||||
|
.B Mod1\-space
|
||||||
|
Toggles between current and previous layout.
|
||||||
|
.TP
|
||||||
|
+.B Mod1\-Control\-,
|
||||||
|
+Cycles backwards in layout list.
|
||||||
|
+.TP
|
||||||
|
+.B Mod1\-Control\-.
|
||||||
|
+Cycles forwards in layout list.
|
||||||
|
+.TP
|
||||||
|
.B Mod1\-j
|
||||||
|
Focus next window.
|
||||||
|
.TP
|
||||||
|
diff --git a/dwm.c b/dwm.c
|
||||||
|
index bb95e26..db73000 100644
|
||||||
|
--- a/dwm.c
|
||||||
|
+++ b/dwm.c
|
||||||
|
@@ -157,6 +157,7 @@ static void configure(Client *c);
|
||||||
|
static void configurenotify(XEvent *e);
|
||||||
|
static void configurerequest(XEvent *e);
|
||||||
|
static Monitor *createmon(void);
|
||||||
|
+static void cyclelayout(const Arg *arg);
|
||||||
|
static void destroynotify(XEvent *e);
|
||||||
|
static void detach(Client *c);
|
||||||
|
static void detachstack(Client *c);
|
||||||
|
@@ -645,6 +646,23 @@ createmon(void)
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
+cyclelayout(const Arg *arg) {
|
||||||
|
+ Layout *l;
|
||||||
|
+ for(l = (Layout *)layouts; l != selmon->lt[selmon->sellt]; l++);
|
||||||
|
+ if(arg->i > 0) {
|
||||||
|
+ if(l->symbol && (l + 1)->symbol)
|
||||||
|
+ setlayout(&((Arg) { .v = (l + 1) }));
|
||||||
|
+ else
|
||||||
|
+ setlayout(&((Arg) { .v = layouts }));
|
||||||
|
+ } else {
|
||||||
|
+ if(l != layouts && (l - 1)->symbol)
|
||||||
|
+ setlayout(&((Arg) { .v = (l - 1) }));
|
||||||
|
+ else
|
||||||
|
+ setlayout(&((Arg) { .v = &layouts[LENGTH(layouts) - 2] }));
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
destroynotify(XEvent *e)
|
||||||
|
{
|
||||||
|
Client *c;
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
138
.config/dwm/patches/dwm-fullgaps-20200508-7b77734.diff
Normal file
138
.config/dwm/patches/dwm-fullgaps-20200508-7b77734.diff
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
From 7b7773458c072e4b24d6ea32d0364a8e402e4a43 Mon Sep 17 00:00:00 2001
|
||||||
|
From: swy7ch <swy7ch@protonmail.com>
|
||||||
|
Date: Fri, 8 May 2020 19:07:24 +0200
|
||||||
|
Subject: [PATCH] [PATCH] update dwm-fullgaps patch to be used with tile layout
|
||||||
|
update
|
||||||
|
|
||||||
|
the recent tile layout changes in commit HEAD~1 (f09418b) broke the
|
||||||
|
patch
|
||||||
|
|
||||||
|
this patch adapt the new `if` statements to take gaps into account
|
||||||
|
|
||||||
|
this patch also provides manpage entries for the keybindings
|
||||||
|
---
|
||||||
|
config.def.h | 4 ++++
|
||||||
|
dwm.1 | 10 ++++++++++
|
||||||
|
dwm.c | 33 +++++++++++++++++++++++----------
|
||||||
|
3 files changed, 37 insertions(+), 10 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 1c0b587..38d2f6c 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -2,6 +2,7 @@
|
||||||
|
|
||||||
|
/* appearance */
|
||||||
|
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
|
+static const unsigned int gappx = 5; /* gaps between 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 */
|
||||||
|
@@ -84,6 +85,9 @@ static Key keys[] = {
|
||||||
|
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
||||||
|
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||||
|
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||||
|
+ { MODKEY, XK_minus, setgaps, {.i = -1 } },
|
||||||
|
+ { MODKEY, XK_equal, setgaps, {.i = +1 } },
|
||||||
|
+ { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
|
||||||
|
TAGKEYS( XK_1, 0)
|
||||||
|
TAGKEYS( XK_2, 1)
|
||||||
|
TAGKEYS( XK_3, 2)
|
||||||
|
diff --git a/dwm.1 b/dwm.1
|
||||||
|
index 13b3729..0202d96 100644
|
||||||
|
--- a/dwm.1
|
||||||
|
+++ b/dwm.1
|
||||||
|
@@ -140,6 +140,16 @@ View all windows with any tag.
|
||||||
|
.B Mod1\-Control\-[1..n]
|
||||||
|
Add/remove all windows with nth tag to/from the view.
|
||||||
|
.TP
|
||||||
|
+.B Mod1\--
|
||||||
|
+Decrease the gaps around windows.
|
||||||
|
+.TP
|
||||||
|
+.B Mod1\-=
|
||||||
|
+Increase the gaps around windows.
|
||||||
|
+.TP
|
||||||
|
+.B Mod1\-Shift-=
|
||||||
|
+Reset the gaps around windows to
|
||||||
|
+.BR 0 .
|
||||||
|
+.TP
|
||||||
|
.B Mod1\-Shift\-q
|
||||||
|
Quit dwm.
|
||||||
|
.SS Mouse commands
|
||||||
|
diff --git a/dwm.c b/dwm.c
|
||||||
|
index 9fd0286..45a58f3 100644
|
||||||
|
--- a/dwm.c
|
||||||
|
+++ b/dwm.c
|
||||||
|
@@ -119,6 +119,7 @@ struct Monitor {
|
||||||
|
int by; /* bar geometry */
|
||||||
|
int mx, my, mw, mh; /* screen size */
|
||||||
|
int wx, wy, ww, wh; /* window area */
|
||||||
|
+ int gappx; /* gaps between windows */
|
||||||
|
unsigned int seltags;
|
||||||
|
unsigned int sellt;
|
||||||
|
unsigned int tagset[2];
|
||||||
|
@@ -200,6 +201,7 @@ static void sendmon(Client *c, Monitor *m);
|
||||||
|
static void setclientstate(Client *c, long state);
|
||||||
|
static void setfocus(Client *c);
|
||||||
|
static void setfullscreen(Client *c, int fullscreen);
|
||||||
|
+static void setgaps(const Arg *arg);
|
||||||
|
static void setlayout(const Arg *arg);
|
||||||
|
static void setmfact(const Arg *arg);
|
||||||
|
static void setup(void);
|
||||||
|
@@ -639,6 +641,7 @@ createmon(void)
|
||||||
|
m->nmaster = nmaster;
|
||||||
|
m->showbar = showbar;
|
||||||
|
m->topbar = topbar;
|
||||||
|
+ m->gappx = gappx;
|
||||||
|
m->lt[0] = &layouts[0];
|
||||||
|
m->lt[1] = &layouts[1 % LENGTH(layouts)];
|
||||||
|
strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
|
||||||
|
@@ -1498,6 +1501,16 @@ setfullscreen(Client *c, int fullscreen)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+setgaps(const Arg *arg)
|
||||||
|
+{
|
||||||
|
+ if ((arg->i == 0) || (selmon->gappx + arg->i < 0))
|
||||||
|
+ selmon->gappx = 0;
|
||||||
|
+ else
|
||||||
|
+ selmon->gappx += arg->i;
|
||||||
|
+ arrange(selmon);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
setlayout(const Arg *arg)
|
||||||
|
{
|
||||||
|
@@ -1684,18 +1697,18 @@ tile(Monitor *m)
|
||||||
|
if (n > m->nmaster)
|
||||||
|
mw = m->nmaster ? m->ww * m->mfact : 0;
|
||||||
|
else
|
||||||
|
- mw = m->ww;
|
||||||
|
- for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
|
||||||
|
+ mw = m->ww - m->gappx;
|
||||||
|
+ for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
|
||||||
|
if (i < m->nmaster) {
|
||||||
|
- h = (m->wh - my) / (MIN(n, m->nmaster) - i);
|
||||||
|
- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0);
|
||||||
|
- if (my + HEIGHT(c) < m->wh)
|
||||||
|
- my += HEIGHT(c);
|
||||||
|
+ h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx;
|
||||||
|
+ resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) - m->gappx, h - (2*c->bw), 0);
|
||||||
|
+ if (my + HEIGHT(c) + m->gappx < m->wh)
|
||||||
|
+ my += HEIGHT(c) + m->gappx;
|
||||||
|
} else {
|
||||||
|
- h = (m->wh - ty) / (n - i);
|
||||||
|
- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0);
|
||||||
|
- if (ty + HEIGHT(c) < m->wh)
|
||||||
|
- ty += HEIGHT(c);
|
||||||
|
+ h = (m->wh - ty) / (n - i) - m->gappx;
|
||||||
|
+ resize(c, m->wx + mw + m->gappx, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gappx, h - (2*c->bw), 0);
|
||||||
|
+ if (ty + HEIGHT(c) + m->gappx < m->wh)
|
||||||
|
+ ty += HEIGHT(c) + m->gappx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
89
.config/dwm/patches/dwm-layoutmenu-6.2.diff
Normal file
89
.config/dwm/patches/dwm-layoutmenu-6.2.diff
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
From e45e286b3d639b90ef202996d87054cced1fd80e Mon Sep 17 00:00:00 2001
|
||||||
|
From: tdu <tdukv@protonmail.com>
|
||||||
|
Date: Mon, 31 Aug 2020 00:07:32 +0300
|
||||||
|
Subject: [PATCH] Right clicking the layout symbol opens an xmenu prompt to
|
||||||
|
select layout.
|
||||||
|
|
||||||
|
Xmenu need to be installed for this to work.
|
||||||
|
Edit layoutmenu.sh with the correct layout table, and place in PATH.
|
||||||
|
---
|
||||||
|
config.def.h | 3 ++-
|
||||||
|
dwm.c | 19 +++++++++++++++++++
|
||||||
|
layoutmenu.sh | 7 +++++++
|
||||||
|
3 files changed, 28 insertions(+), 1 deletion(-)
|
||||||
|
create mode 100755 layoutmenu.sh
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 1c0b587..c9e0833 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -58,6 +58,7 @@ static const Layout layouts[] = {
|
||||||
|
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 };
|
||||||
|
static const char *termcmd[] = { "st", NULL };
|
||||||
|
+static const char *layoutmenu_cmd = "layoutmenu.sh";
|
||||||
|
|
||||||
|
static Key keys[] = {
|
||||||
|
/* modifier key function argument */
|
||||||
|
@@ -101,7 +102,7 @@ static Key keys[] = {
|
||||||
|
static Button buttons[] = {
|
||||||
|
/* click event mask button function argument */
|
||||||
|
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
||||||
|
- { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
||||||
|
+ { ClkLtSymbol, 0, Button3, layoutmenu, {0} },
|
||||||
|
{ ClkWinTitle, 0, Button2, zoom, {0} },
|
||||||
|
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
||||||
|
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
||||||
|
diff --git a/dwm.c b/dwm.c
|
||||||
|
index 4465af1..2508a0a 100644
|
||||||
|
--- a/dwm.c
|
||||||
|
+++ b/dwm.c
|
||||||
|
@@ -177,6 +177,7 @@ static void grabkeys(void);
|
||||||
|
static void incnmaster(const Arg *arg);
|
||||||
|
static void keypress(XEvent *e);
|
||||||
|
static void killclient(const Arg *arg);
|
||||||
|
+static void layoutmenu(const Arg *arg);
|
||||||
|
static void manage(Window w, XWindowAttributes *wa);
|
||||||
|
static void mappingnotify(XEvent *e);
|
||||||
|
static void maprequest(XEvent *e);
|
||||||
|
@@ -1014,6 +1015,24 @@ killclient(const Arg *arg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+layoutmenu(const Arg *arg) {
|
||||||
|
+ FILE *p;
|
||||||
|
+ char c[3], *s;
|
||||||
|
+ int i;
|
||||||
|
+
|
||||||
|
+ if (!(p = popen(layoutmenu_cmd, "r")))
|
||||||
|
+ return;
|
||||||
|
+ s = fgets(c, sizeof(c), p);
|
||||||
|
+ pclose(p);
|
||||||
|
+
|
||||||
|
+ if (!s || *s == '\0' || c == '\0')
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ i = atoi(c);
|
||||||
|
+ setlayout(&((Arg) { .v = &layouts[i] }));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
manage(Window w, XWindowAttributes *wa)
|
||||||
|
{
|
||||||
|
diff --git a/layoutmenu.sh b/layoutmenu.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000..1bf95f2
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/layoutmenu.sh
|
||||||
|
@@ -0,0 +1,7 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+
|
||||||
|
+cat <<EOF | xmenu
|
||||||
|
+[]= Tiled Layout 0
|
||||||
|
+><> Floating Layout 1
|
||||||
|
+[M] Monocle Layout 2
|
||||||
|
+EOF
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
763
.config/dwm/patches/dwm-systray-6.3.diff
Normal file
763
.config/dwm/patches/dwm-systray-6.3.diff
Normal file
|
@ -0,0 +1,763 @@
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index a2ac963..4be4c06 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -2,9 +2,14 @@
|
||||||
|
|
||||||
|
/* appearance */
|
||||||
|
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 unsigned int snap = 32; /* snap pixel */
|
||||||
|
+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 int showsystray = 1; /* 0 means no systray */
|
||||||
|
+static const int showbar = 1; /* 0 means no bar */
|
||||||
|
+static const int topbar = 1; /* 0 means bottom bar */
|
||||||
|
static const char *fonts[] = { "monospace:size=10" };
|
||||||
|
static const char dmenufont[] = "monospace:size=10";
|
||||||
|
static const char col_gray1[] = "#222222";
|
||||||
|
@@ -101,8 +106,8 @@ static Key keys[] = {
|
||||||
|
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
||||||
|
static Button buttons[] = {
|
||||||
|
/* click event mask button function argument */
|
||||||
|
- { ClkLtSymbol, 0, Button1, setlayout, {0} },
|
||||||
|
- { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
||||||
|
+ { ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||||
|
+ { ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||||
|
{ ClkWinTitle, 0, Button2, zoom, {0} },
|
||||||
|
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
||||||
|
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
||||||
|
diff --git a/dwm.c b/dwm.c
|
||||||
|
index a96f33c..941c1c0 100644
|
||||||
|
--- a/dwm.c
|
||||||
|
+++ b/dwm.c
|
||||||
|
@@ -57,12 +57,27 @@
|
||||||
|
#define TAGMASK ((1 << LENGTH(tags)) - 1)
|
||||||
|
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
||||||
|
|
||||||
|
+#define SYSTEM_TRAY_REQUEST_DOCK 0
|
||||||
|
+/* XEMBED messages */
|
||||||
|
+#define XEMBED_EMBEDDED_NOTIFY 0
|
||||||
|
+#define XEMBED_WINDOW_ACTIVATE 1
|
||||||
|
+#define XEMBED_FOCUS_IN 4
|
||||||
|
+#define XEMBED_MODALITY_ON 10
|
||||||
|
+#define XEMBED_MAPPED (1 << 0)
|
||||||
|
+#define XEMBED_WINDOW_ACTIVATE 1
|
||||||
|
+#define XEMBED_WINDOW_DEACTIVATE 2
|
||||||
|
+#define VERSION_MAJOR 0
|
||||||
|
+#define VERSION_MINOR 0
|
||||||
|
+#define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR
|
||||||
|
+
|
||||||
|
/* enums */
|
||||||
|
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||||
|
enum { SchemeNorm, SchemeSel }; /* color schemes */
|
||||||
|
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
||||||
|
+ NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz,
|
||||||
|
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
|
||||||
|
NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
|
||||||
|
+enum { Manager, Xembed, XembedInfo, XLast }; /* Xembed atoms */
|
||||||
|
enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
|
||||||
|
enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
|
||||||
|
ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
|
||||||
|
@@ -141,6 +156,12 @@ typedef struct {
|
||||||
|
int monitor;
|
||||||
|
} Rule;
|
||||||
|
|
||||||
|
+typedef struct Systray Systray;
|
||||||
|
+struct Systray {
|
||||||
|
+ Window win;
|
||||||
|
+ Client *icons;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
/* function declarations */
|
||||||
|
static void applyrules(Client *c);
|
||||||
|
static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact);
|
||||||
|
@@ -172,6 +193,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 unsigned int getsystraywidth();
|
||||||
|
static int gettextprop(Window w, Atom atom, char *text, unsigned int size);
|
||||||
|
static void grabbuttons(Client *c, int focused);
|
||||||
|
static void grabkeys(void);
|
||||||
|
@@ -189,13 +211,16 @@ static void pop(Client *);
|
||||||
|
static void propertynotify(XEvent *e);
|
||||||
|
static void quit(const Arg *arg);
|
||||||
|
static Monitor *recttomon(int x, int y, int w, int h);
|
||||||
|
+static void removesystrayicon(Client *i);
|
||||||
|
static void resize(Client *c, int x, int y, int w, int h, int interact);
|
||||||
|
+static void resizebarwin(Monitor *m);
|
||||||
|
static void resizeclient(Client *c, int x, int y, int w, int h);
|
||||||
|
static void resizemouse(const Arg *arg);
|
||||||
|
+static void resizerequest(XEvent *e);
|
||||||
|
static void restack(Monitor *m);
|
||||||
|
static void run(void);
|
||||||
|
static void scan(void);
|
||||||
|
-static int sendevent(Client *c, Atom proto);
|
||||||
|
+static int sendevent(Window w, Atom proto, int m, long d0, long d1, long d2, long d3, long d4);
|
||||||
|
static void sendmon(Client *c, Monitor *m);
|
||||||
|
static void setclientstate(Client *c, long state);
|
||||||
|
static void setfocus(Client *c);
|
||||||
|
@@ -207,6 +232,7 @@ static void seturgent(Client *c, int urg);
|
||||||
|
static void showhide(Client *c);
|
||||||
|
static void sigchld(int unused);
|
||||||
|
static void spawn(const Arg *arg);
|
||||||
|
+static Monitor *systraytomon(Monitor *m);
|
||||||
|
static void tag(const Arg *arg);
|
||||||
|
static void tagmon(const Arg *arg);
|
||||||
|
static void tile(Monitor *);
|
||||||
|
@@ -224,18 +250,23 @@ static int updategeom(void);
|
||||||
|
static void updatenumlockmask(void);
|
||||||
|
static void updatesizehints(Client *c);
|
||||||
|
static void updatestatus(void);
|
||||||
|
+static void updatesystray(void);
|
||||||
|
+static void updatesystrayicongeom(Client *i, int w, int h);
|
||||||
|
+static void updatesystrayiconstate(Client *i, XPropertyEvent *ev);
|
||||||
|
static void updatetitle(Client *c);
|
||||||
|
static void updatewindowtype(Client *c);
|
||||||
|
static void updatewmhints(Client *c);
|
||||||
|
static void view(const Arg *arg);
|
||||||
|
static Client *wintoclient(Window w);
|
||||||
|
static Monitor *wintomon(Window w);
|
||||||
|
+static Client *wintosystrayicon(Window w);
|
||||||
|
static int xerror(Display *dpy, XErrorEvent *ee);
|
||||||
|
static int xerrordummy(Display *dpy, XErrorEvent *ee);
|
||||||
|
static int xerrorstart(Display *dpy, XErrorEvent *ee);
|
||||||
|
static void zoom(const Arg *arg);
|
||||||
|
|
||||||
|
/* variables */
|
||||||
|
+static Systray *systray = NULL;
|
||||||
|
static const char broken[] = "broken";
|
||||||
|
static char stext[256];
|
||||||
|
static int screen;
|
||||||
|
@@ -258,9 +289,10 @@ static void (*handler[LASTEvent]) (XEvent *) = {
|
||||||
|
[MapRequest] = maprequest,
|
||||||
|
[MotionNotify] = motionnotify,
|
||||||
|
[PropertyNotify] = propertynotify,
|
||||||
|
+ [ResizeRequest] = resizerequest,
|
||||||
|
[UnmapNotify] = unmapnotify
|
||||||
|
};
|
||||||
|
-static Atom wmatom[WMLast], netatom[NetLast];
|
||||||
|
+static Atom wmatom[WMLast], netatom[NetLast], xatom[XLast];
|
||||||
|
static int running = 1;
|
||||||
|
static Cur *cursor[CurLast];
|
||||||
|
static Clr **scheme;
|
||||||
|
@@ -440,7 +472,7 @@ 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 - (int)TEXTW(stext) - getsystraywidth())
|
||||||
|
click = ClkStatusText;
|
||||||
|
else
|
||||||
|
click = ClkWinTitle;
|
||||||
|
@@ -483,7 +515,14 @@ cleanup(void)
|
||||||
|
XUngrabKey(dpy, AnyKey, AnyModifier, root);
|
||||||
|
while (mons)
|
||||||
|
cleanupmon(mons);
|
||||||
|
- for (i = 0; i < CurLast; i++)
|
||||||
|
+
|
||||||
|
+ if (showsystray) {
|
||||||
|
+ XUnmapWindow(dpy, systray->win);
|
||||||
|
+ XDestroyWindow(dpy, systray->win);
|
||||||
|
+ free(systray);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < CurLast; i++)
|
||||||
|
drw_cur_free(drw, cursor[i]);
|
||||||
|
for (i = 0; i < LENGTH(colors); i++)
|
||||||
|
free(scheme[i]);
|
||||||
|
@@ -513,9 +552,58 @@ cleanupmon(Monitor *mon)
|
||||||
|
void
|
||||||
|
clientmessage(XEvent *e)
|
||||||
|
{
|
||||||
|
+ XWindowAttributes wa;
|
||||||
|
+ XSetWindowAttributes swa;
|
||||||
|
XClientMessageEvent *cme = &e->xclient;
|
||||||
|
Client *c = wintoclient(cme->window);
|
||||||
|
|
||||||
|
+ if (showsystray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) {
|
||||||
|
+ /* add systray icons */
|
||||||
|
+ if (cme->data.l[1] == SYSTEM_TRAY_REQUEST_DOCK) {
|
||||||
|
+ if (!(c = (Client *)calloc(1, sizeof(Client))))
|
||||||
|
+ die("fatal: could not malloc() %u bytes\n", sizeof(Client));
|
||||||
|
+ if (!(c->win = cme->data.l[2])) {
|
||||||
|
+ free(c);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ c->mon = selmon;
|
||||||
|
+ c->next = systray->icons;
|
||||||
|
+ systray->icons = c;
|
||||||
|
+ if (!XGetWindowAttributes(dpy, c->win, &wa)) {
|
||||||
|
+ /* use sane defaults */
|
||||||
|
+ wa.width = bh;
|
||||||
|
+ wa.height = bh;
|
||||||
|
+ wa.border_width = 0;
|
||||||
|
+ }
|
||||||
|
+ c->x = c->oldx = c->y = c->oldy = 0;
|
||||||
|
+ c->w = c->oldw = wa.width;
|
||||||
|
+ c->h = c->oldh = wa.height;
|
||||||
|
+ c->oldbw = wa.border_width;
|
||||||
|
+ c->bw = 0;
|
||||||
|
+ c->isfloating = True;
|
||||||
|
+ /* reuse tags field as mapped status */
|
||||||
|
+ c->tags = 1;
|
||||||
|
+ updatesizehints(c);
|
||||||
|
+ updatesystrayicongeom(c, wa.width, wa.height);
|
||||||
|
+ XAddToSaveSet(dpy, c->win);
|
||||||
|
+ XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask);
|
||||||
|
+ XReparentWindow(dpy, c->win, systray->win, 0, 0);
|
||||||
|
+ /* use parents background color */
|
||||||
|
+ swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
|
||||||
|
+ XChangeWindowAttributes(dpy, c->win, CWBackPixel, &swa);
|
||||||
|
+ sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_EMBEDDED_NOTIFY, 0 , systray->win, XEMBED_EMBEDDED_VERSION);
|
||||||
|
+ /* FIXME not sure if I have to send these events, too */
|
||||||
|
+ sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_FOCUS_IN, 0 , systray->win, XEMBED_EMBEDDED_VERSION);
|
||||||
|
+ sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0 , systray->win, XEMBED_EMBEDDED_VERSION);
|
||||||
|
+ sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_MODALITY_ON, 0 , systray->win, XEMBED_EMBEDDED_VERSION);
|
||||||
|
+ XSync(dpy, False);
|
||||||
|
+ resizebarwin(selmon);
|
||||||
|
+ updatesystray();
|
||||||
|
+ setclientstate(c, NormalState);
|
||||||
|
+ }
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (!c)
|
||||||
|
return;
|
||||||
|
if (cme->message_type == netatom[NetWMState]) {
|
||||||
|
@@ -568,7 +656,7 @@ configurenotify(XEvent *e)
|
||||||
|
for (c = m->clients; c; c = c->next)
|
||||||
|
if (c->isfullscreen)
|
||||||
|
resizeclient(c, m->mx, m->my, m->mw, m->mh);
|
||||||
|
- XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
|
||||||
|
+ resizebarwin(m);
|
||||||
|
}
|
||||||
|
focus(NULL);
|
||||||
|
arrange(NULL);
|
||||||
|
@@ -653,6 +741,11 @@ destroynotify(XEvent *e)
|
||||||
|
|
||||||
|
if ((c = wintoclient(ev->window)))
|
||||||
|
unmanage(c, 1);
|
||||||
|
+ else if ((c = wintosystrayicon(ev->window))) {
|
||||||
|
+ removesystrayicon(c);
|
||||||
|
+ resizebarwin(selmon);
|
||||||
|
+ updatesystray();
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
@@ -696,7 +789,7 @@ dirtomon(int dir)
|
||||||
|
void
|
||||||
|
drawbar(Monitor *m)
|
||||||
|
{
|
||||||
|
- int x, w, tw = 0;
|
||||||
|
+ int x, w, tw = 0, stw = 0;
|
||||||
|
int boxs = drw->fonts->h / 9;
|
||||||
|
int boxw = drw->fonts->h / 6 + 2;
|
||||||
|
unsigned int i, occ = 0, urg = 0;
|
||||||
|
@@ -705,13 +798,17 @@ drawbar(Monitor *m)
|
||||||
|
if (!m->showbar)
|
||||||
|
return;
|
||||||
|
|
||||||
|
+ if(showsystray && m == systraytomon(m) && !systrayonleft)
|
||||||
|
+ stw = getsystraywidth();
|
||||||
|
+
|
||||||
|
/* draw status first so it can be overdrawn by tags later */
|
||||||
|
if (m == selmon) { /* status is only drawn on selected monitor */
|
||||||
|
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);
|
||||||
|
+ tw = TEXTW(stext) - lrpad / 2 + 2; /* 2px extra right padding */
|
||||||
|
+ drw_text(drw, m->ww - tw - stw, 0, tw, bh, lrpad / 2 - 2, stext, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ resizebarwin(m);
|
||||||
|
for (c = m->clients; c; c = c->next) {
|
||||||
|
occ |= c->tags;
|
||||||
|
if (c->isurgent)
|
||||||
|
@@ -732,7 +829,7 @@ drawbar(Monitor *m)
|
||||||
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
|
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
||||||
|
|
||||||
|
- if ((w = m->ww - tw - x) > bh) {
|
||||||
|
+ if ((w = m->ww - tw - stw - x) > bh) {
|
||||||
|
if (m->sel) {
|
||||||
|
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
||||||
|
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
|
||||||
|
@@ -743,7 +840,7 @@ drawbar(Monitor *m)
|
||||||
|
drw_rect(drw, x, 0, w, bh, 1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- drw_map(drw, m->barwin, 0, 0, m->ww, bh);
|
||||||
|
+ drw_map(drw, m->barwin, 0, 0, m->ww - stw, bh);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
@@ -780,8 +877,11 @@ expose(XEvent *e)
|
||||||
|
Monitor *m;
|
||||||
|
XExposeEvent *ev = &e->xexpose;
|
||||||
|
|
||||||
|
- if (ev->count == 0 && (m = wintomon(ev->window)))
|
||||||
|
+ if (ev->count == 0 && (m = wintomon(ev->window))) {
|
||||||
|
drawbar(m);
|
||||||
|
+ if (m == selmon)
|
||||||
|
+ updatesystray();
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
@@ -867,9 +967,17 @@ getatomprop(Client *c, Atom prop)
|
||||||
|
unsigned char *p = NULL;
|
||||||
|
Atom da, atom = None;
|
||||||
|
|
||||||
|
- if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM,
|
||||||
|
+ /* FIXME getatomprop should return the number of items and a pointer to
|
||||||
|
+ * the stored data instead of this workaround */
|
||||||
|
+ Atom req = XA_ATOM;
|
||||||
|
+ if (prop == xatom[XembedInfo])
|
||||||
|
+ req = xatom[XembedInfo];
|
||||||
|
+
|
||||||
|
+ if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, req,
|
||||||
|
&da, &di, &dl, &dl, &p) == Success && p) {
|
||||||
|
atom = *(Atom *)p;
|
||||||
|
+ if (da == xatom[XembedInfo] && dl == 2)
|
||||||
|
+ atom = ((Atom *)p)[1];
|
||||||
|
XFree(p);
|
||||||
|
}
|
||||||
|
return atom;
|
||||||
|
@@ -903,6 +1011,16 @@ getstate(Window w)
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
+unsigned int
|
||||||
|
+getsystraywidth()
|
||||||
|
+{
|
||||||
|
+ unsigned int w = 0;
|
||||||
|
+ Client *i;
|
||||||
|
+ if(showsystray)
|
||||||
|
+ for(i = systray->icons; i; w += i->w + systrayspacing, i = i->next) ;
|
||||||
|
+ return w ? w + systrayspacing : 1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
int
|
||||||
|
gettextprop(Window w, Atom atom, char *text, unsigned int size)
|
||||||
|
{
|
||||||
|
@@ -1007,7 +1125,8 @@ killclient(const Arg *arg)
|
||||||
|
{
|
||||||
|
if (!selmon->sel)
|
||||||
|
return;
|
||||||
|
- if (!sendevent(selmon->sel, wmatom[WMDelete])) {
|
||||||
|
+
|
||||||
|
+ if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0 , 0, 0)) {
|
||||||
|
XGrabServer(dpy);
|
||||||
|
XSetErrorHandler(xerrordummy);
|
||||||
|
XSetCloseDownMode(dpy, DestroyAll);
|
||||||
|
@@ -1096,6 +1215,13 @@ maprequest(XEvent *e)
|
||||||
|
static XWindowAttributes wa;
|
||||||
|
XMapRequestEvent *ev = &e->xmaprequest;
|
||||||
|
|
||||||
|
+ Client *i;
|
||||||
|
+ if ((i = wintosystrayicon(ev->window))) {
|
||||||
|
+ sendevent(i->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0, systray->win, XEMBED_EMBEDDED_VERSION);
|
||||||
|
+ resizebarwin(selmon);
|
||||||
|
+ updatesystray();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (!XGetWindowAttributes(dpy, ev->window, &wa))
|
||||||
|
return;
|
||||||
|
if (wa.override_redirect)
|
||||||
|
@@ -1219,7 +1345,18 @@ propertynotify(XEvent *e)
|
||||||
|
Window trans;
|
||||||
|
XPropertyEvent *ev = &e->xproperty;
|
||||||
|
|
||||||
|
- if ((ev->window == root) && (ev->atom == XA_WM_NAME))
|
||||||
|
+ if ((c = wintosystrayicon(ev->window))) {
|
||||||
|
+ if (ev->atom == XA_WM_NORMAL_HINTS) {
|
||||||
|
+ updatesizehints(c);
|
||||||
|
+ updatesystrayicongeom(c, c->w, c->h);
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ updatesystrayiconstate(c, ev);
|
||||||
|
+ resizebarwin(selmon);
|
||||||
|
+ updatesystray();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if ((ev->window == root) && (ev->atom == XA_WM_NAME))
|
||||||
|
updatestatus();
|
||||||
|
else if (ev->state == PropertyDelete)
|
||||||
|
return; /* ignore */
|
||||||
|
@@ -1269,6 +1406,19 @@ recttomon(int x, int y, int w, int h)
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+removesystrayicon(Client *i)
|
||||||
|
+{
|
||||||
|
+ Client **ii;
|
||||||
|
+
|
||||||
|
+ if (!showsystray || !i)
|
||||||
|
+ return;
|
||||||
|
+ for (ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next);
|
||||||
|
+ if (ii)
|
||||||
|
+ *ii = i->next;
|
||||||
|
+ free(i);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
resize(Client *c, int x, int y, int w, int h, int interact)
|
||||||
|
{
|
||||||
|
@@ -1276,6 +1426,14 @@ resize(Client *c, int x, int y, int w, int h, int interact)
|
||||||
|
resizeclient(c, x, y, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+resizebarwin(Monitor *m) {
|
||||||
|
+ unsigned int w = m->ww;
|
||||||
|
+ if (showsystray && m == systraytomon(m) && !systrayonleft)
|
||||||
|
+ w -= getsystraywidth();
|
||||||
|
+ XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, w, bh);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
resizeclient(Client *c, int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
@@ -1348,6 +1506,19 @@ resizemouse(const Arg *arg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+resizerequest(XEvent *e)
|
||||||
|
+{
|
||||||
|
+ XResizeRequestEvent *ev = &e->xresizerequest;
|
||||||
|
+ Client *i;
|
||||||
|
+
|
||||||
|
+ if ((i = wintosystrayicon(ev->window))) {
|
||||||
|
+ updatesystrayicongeom(i, ev->width, ev->height);
|
||||||
|
+ resizebarwin(selmon);
|
||||||
|
+ updatesystray();
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
restack(Monitor *m)
|
||||||
|
{
|
||||||
|
@@ -1437,26 +1608,37 @@ setclientstate(Client *c, long state)
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
-sendevent(Client *c, Atom proto)
|
||||||
|
+sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, long d4)
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
- Atom *protocols;
|
||||||
|
+ Atom *protocols, mt;
|
||||||
|
int exists = 0;
|
||||||
|
XEvent ev;
|
||||||
|
|
||||||
|
- if (XGetWMProtocols(dpy, c->win, &protocols, &n)) {
|
||||||
|
- while (!exists && n--)
|
||||||
|
- exists = protocols[n] == proto;
|
||||||
|
- XFree(protocols);
|
||||||
|
+ if (proto == wmatom[WMTakeFocus] || proto == wmatom[WMDelete]) {
|
||||||
|
+ mt = wmatom[WMProtocols];
|
||||||
|
+ if (XGetWMProtocols(dpy, w, &protocols, &n)) {
|
||||||
|
+ while (!exists && n--)
|
||||||
|
+ exists = protocols[n] == proto;
|
||||||
|
+ XFree(protocols);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
+ else {
|
||||||
|
+ exists = True;
|
||||||
|
+ mt = proto;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (exists) {
|
||||||
|
ev.type = ClientMessage;
|
||||||
|
- ev.xclient.window = c->win;
|
||||||
|
- ev.xclient.message_type = wmatom[WMProtocols];
|
||||||
|
+ ev.xclient.window = w;
|
||||||
|
+ ev.xclient.message_type = mt;
|
||||||
|
ev.xclient.format = 32;
|
||||||
|
- ev.xclient.data.l[0] = proto;
|
||||||
|
- ev.xclient.data.l[1] = CurrentTime;
|
||||||
|
- XSendEvent(dpy, c->win, False, NoEventMask, &ev);
|
||||||
|
+ ev.xclient.data.l[0] = d0;
|
||||||
|
+ ev.xclient.data.l[1] = d1;
|
||||||
|
+ ev.xclient.data.l[2] = d2;
|
||||||
|
+ ev.xclient.data.l[3] = d3;
|
||||||
|
+ ev.xclient.data.l[4] = d4;
|
||||||
|
+ XSendEvent(dpy, w, False, mask, &ev);
|
||||||
|
}
|
||||||
|
return exists;
|
||||||
|
}
|
||||||
|
@@ -1470,7 +1652,7 @@ setfocus(Client *c)
|
||||||
|
XA_WINDOW, 32, PropModeReplace,
|
||||||
|
(unsigned char *) &(c->win), 1);
|
||||||
|
}
|
||||||
|
- sendevent(c, wmatom[WMTakeFocus]);
|
||||||
|
+ sendevent(c->win, wmatom[WMTakeFocus], NoEventMask, wmatom[WMTakeFocus], CurrentTime, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
@@ -1558,15 +1740,22 @@ setup(void)
|
||||||
|
wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
|
||||||
|
wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False);
|
||||||
|
netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
|
||||||
|
- netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
||||||
|
- netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
||||||
|
+ netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
||||||
|
+ netatom[NetSystemTray] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_S0", False);
|
||||||
|
+ netatom[NetSystemTrayOP] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE", False);
|
||||||
|
+ netatom[NetSystemTrayOrientation] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION", False);
|
||||||
|
+ netatom[NetSystemTrayOrientationHorz] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION_HORZ", False);
|
||||||
|
+ netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
||||||
|
netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
|
||||||
|
netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
|
||||||
|
netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
||||||
|
netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
|
||||||
|
netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
|
||||||
|
netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
|
||||||
|
- /* init cursors */
|
||||||
|
+ xatom[Manager] = XInternAtom(dpy, "MANAGER", False);
|
||||||
|
+ xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False);
|
||||||
|
+ xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False);
|
||||||
|
+ /* init cursors */
|
||||||
|
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
|
||||||
|
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
|
||||||
|
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
|
||||||
|
@@ -1574,6 +1763,8 @@ setup(void)
|
||||||
|
scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
|
||||||
|
for (i = 0; i < LENGTH(colors); i++)
|
||||||
|
scheme[i] = drw_scm_create(drw, colors[i], 3);
|
||||||
|
+ /* init system tray */
|
||||||
|
+ updatesystray();
|
||||||
|
/* init bars */
|
||||||
|
updatebars();
|
||||||
|
updatestatus();
|
||||||
|
@@ -1707,7 +1898,18 @@ togglebar(const Arg *arg)
|
||||||
|
{
|
||||||
|
selmon->showbar = !selmon->showbar;
|
||||||
|
updatebarpos(selmon);
|
||||||
|
- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
|
||||||
|
+ resizebarwin(selmon);
|
||||||
|
+ if (showsystray) {
|
||||||
|
+ XWindowChanges wc;
|
||||||
|
+ if (!selmon->showbar)
|
||||||
|
+ wc.y = -bh;
|
||||||
|
+ else if (selmon->showbar) {
|
||||||
|
+ wc.y = 0;
|
||||||
|
+ if (!selmon->topbar)
|
||||||
|
+ wc.y = selmon->mh - bh;
|
||||||
|
+ }
|
||||||
|
+ XConfigureWindow(dpy, systray->win, CWY, &wc);
|
||||||
|
+ }
|
||||||
|
arrange(selmon);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1802,11 +2004,18 @@ unmapnotify(XEvent *e)
|
||||||
|
else
|
||||||
|
unmanage(c, 0);
|
||||||
|
}
|
||||||
|
+ else if ((c = wintosystrayicon(ev->window))) {
|
||||||
|
+ /* KLUDGE! sometimes icons occasionally unmap their windows, but do
|
||||||
|
+ * _not_ destroy them. We map those windows back */
|
||||||
|
+ XMapRaised(dpy, c->win);
|
||||||
|
+ updatesystray();
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
updatebars(void)
|
||||||
|
{
|
||||||
|
+ unsigned int w;
|
||||||
|
Monitor *m;
|
||||||
|
XSetWindowAttributes wa = {
|
||||||
|
.override_redirect = True,
|
||||||
|
@@ -1817,10 +2026,15 @@ updatebars(void)
|
||||||
|
for (m = mons; m; m = m->next) {
|
||||||
|
if (m->barwin)
|
||||||
|
continue;
|
||||||
|
- m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
|
||||||
|
+ w = m->ww;
|
||||||
|
+ if (showsystray && m == systraytomon(m))
|
||||||
|
+ w -= getsystraywidth();
|
||||||
|
+ m->barwin = XCreateWindow(dpy, root, m->wx, m->by, w, bh, 0, DefaultDepth(dpy, screen),
|
||||||
|
CopyFromParent, DefaultVisual(dpy, screen),
|
||||||
|
CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
|
||||||
|
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
|
||||||
|
+ if (showsystray && m == systraytomon(m))
|
||||||
|
+ XMapRaised(dpy, systray->win);
|
||||||
|
XMapRaised(dpy, m->barwin);
|
||||||
|
XSetClassHint(dpy, m->barwin, &ch);
|
||||||
|
}
|
||||||
|
@@ -1996,6 +2210,125 @@ updatestatus(void)
|
||||||
|
if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
|
||||||
|
strcpy(stext, "dwm-"VERSION);
|
||||||
|
drawbar(selmon);
|
||||||
|
+ updatesystray();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+updatesystrayicongeom(Client *i, int w, int h)
|
||||||
|
+{
|
||||||
|
+ if (i) {
|
||||||
|
+ i->h = bh;
|
||||||
|
+ if (w == h)
|
||||||
|
+ i->w = bh;
|
||||||
|
+ else if (h == bh)
|
||||||
|
+ i->w = w;
|
||||||
|
+ else
|
||||||
|
+ i->w = (int) ((float)bh * ((float)w / (float)h));
|
||||||
|
+ applysizehints(i, &(i->x), &(i->y), &(i->w), &(i->h), False);
|
||||||
|
+ /* force icons into the systray dimensions if they don't want to */
|
||||||
|
+ if (i->h > bh) {
|
||||||
|
+ if (i->w == i->h)
|
||||||
|
+ i->w = bh;
|
||||||
|
+ else
|
||||||
|
+ i->w = (int) ((float)bh * ((float)i->w / (float)i->h));
|
||||||
|
+ i->h = bh;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+updatesystrayiconstate(Client *i, XPropertyEvent *ev)
|
||||||
|
+{
|
||||||
|
+ long flags;
|
||||||
|
+ int code = 0;
|
||||||
|
+
|
||||||
|
+ if (!showsystray || !i || ev->atom != xatom[XembedInfo] ||
|
||||||
|
+ !(flags = getatomprop(i, xatom[XembedInfo])))
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ if (flags & XEMBED_MAPPED && !i->tags) {
|
||||||
|
+ i->tags = 1;
|
||||||
|
+ code = XEMBED_WINDOW_ACTIVATE;
|
||||||
|
+ XMapRaised(dpy, i->win);
|
||||||
|
+ setclientstate(i, NormalState);
|
||||||
|
+ }
|
||||||
|
+ else if (!(flags & XEMBED_MAPPED) && i->tags) {
|
||||||
|
+ i->tags = 0;
|
||||||
|
+ code = XEMBED_WINDOW_DEACTIVATE;
|
||||||
|
+ XUnmapWindow(dpy, i->win);
|
||||||
|
+ setclientstate(i, WithdrawnState);
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ return;
|
||||||
|
+ sendevent(i->win, xatom[Xembed], StructureNotifyMask, CurrentTime, code, 0,
|
||||||
|
+ systray->win, XEMBED_EMBEDDED_VERSION);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+updatesystray(void)
|
||||||
|
+{
|
||||||
|
+ XSetWindowAttributes wa;
|
||||||
|
+ XWindowChanges wc;
|
||||||
|
+ Client *i;
|
||||||
|
+ Monitor *m = systraytomon(NULL);
|
||||||
|
+ unsigned int x = m->mx + m->mw;
|
||||||
|
+ unsigned int sw = TEXTW(stext) - lrpad + systrayspacing;
|
||||||
|
+ unsigned int w = 1;
|
||||||
|
+
|
||||||
|
+ if (!showsystray)
|
||||||
|
+ return;
|
||||||
|
+ if (systrayonleft)
|
||||||
|
+ x -= sw + lrpad / 2;
|
||||||
|
+ if (!systray) {
|
||||||
|
+ /* init systray */
|
||||||
|
+ if (!(systray = (Systray *)calloc(1, sizeof(Systray))))
|
||||||
|
+ die("fatal: could not malloc() %u bytes\n", sizeof(Systray));
|
||||||
|
+ systray->win = XCreateSimpleWindow(dpy, root, x, m->by, w, bh, 0, 0, scheme[SchemeSel][ColBg].pixel);
|
||||||
|
+ wa.event_mask = ButtonPressMask | ExposureMask;
|
||||||
|
+ wa.override_redirect = True;
|
||||||
|
+ wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
|
||||||
|
+ XSelectInput(dpy, systray->win, SubstructureNotifyMask);
|
||||||
|
+ XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32,
|
||||||
|
+ PropModeReplace, (unsigned char *)&netatom[NetSystemTrayOrientationHorz], 1);
|
||||||
|
+ XChangeWindowAttributes(dpy, systray->win, CWEventMask|CWOverrideRedirect|CWBackPixel, &wa);
|
||||||
|
+ XMapRaised(dpy, systray->win);
|
||||||
|
+ XSetSelectionOwner(dpy, netatom[NetSystemTray], systray->win, CurrentTime);
|
||||||
|
+ if (XGetSelectionOwner(dpy, netatom[NetSystemTray]) == systray->win) {
|
||||||
|
+ sendevent(root, xatom[Manager], StructureNotifyMask, CurrentTime, netatom[NetSystemTray], systray->win, 0, 0);
|
||||||
|
+ XSync(dpy, False);
|
||||||
|
+ }
|
||||||
|
+ else {
|
||||||
|
+ fprintf(stderr, "dwm: unable to obtain system tray.\n");
|
||||||
|
+ free(systray);
|
||||||
|
+ systray = NULL;
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ for (w = 0, i = systray->icons; i; i = i->next) {
|
||||||
|
+ /* make sure the background color stays the same */
|
||||||
|
+ wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
|
||||||
|
+ XChangeWindowAttributes(dpy, i->win, CWBackPixel, &wa);
|
||||||
|
+ XMapRaised(dpy, i->win);
|
||||||
|
+ w += systrayspacing;
|
||||||
|
+ i->x = w;
|
||||||
|
+ XMoveResizeWindow(dpy, i->win, i->x, 0, i->w, i->h);
|
||||||
|
+ w += i->w;
|
||||||
|
+ if (i->mon != m)
|
||||||
|
+ i->mon = m;
|
||||||
|
+ }
|
||||||
|
+ w = w ? w + systrayspacing : 1;
|
||||||
|
+ x -= w;
|
||||||
|
+ XMoveResizeWindow(dpy, systray->win, x, m->by, w, bh);
|
||||||
|
+ wc.x = x; wc.y = m->by; wc.width = w; wc.height = bh;
|
||||||
|
+ wc.stack_mode = Above; wc.sibling = m->barwin;
|
||||||
|
+ XConfigureWindow(dpy, systray->win, CWX|CWY|CWWidth|CWHeight|CWSibling|CWStackMode, &wc);
|
||||||
|
+ XMapWindow(dpy, systray->win);
|
||||||
|
+ XMapSubwindows(dpy, systray->win);
|
||||||
|
+ /* redraw background */
|
||||||
|
+ XSetForeground(dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel);
|
||||||
|
+ XFillRectangle(dpy, systray->win, drw->gc, 0, 0, w, bh);
|
||||||
|
+ XSync(dpy, False);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
@@ -2063,6 +2396,16 @@ wintoclient(Window w)
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
+Client *
|
||||||
|
+wintosystrayicon(Window w) {
|
||||||
|
+ Client *i = NULL;
|
||||||
|
+
|
||||||
|
+ if (!showsystray || !w)
|
||||||
|
+ return i;
|
||||||
|
+ for (i = systray->icons; i && i->win != w; i = i->next) ;
|
||||||
|
+ return i;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
Monitor *
|
||||||
|
wintomon(Window w)
|
||||||
|
{
|
||||||
|
@@ -2116,6 +2459,22 @@ xerrorstart(Display *dpy, XErrorEvent *ee)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
+Monitor *
|
||||||
|
+systraytomon(Monitor *m) {
|
||||||
|
+ Monitor *t;
|
||||||
|
+ int i, n;
|
||||||
|
+ if(!systraypinning) {
|
||||||
|
+ if(!m)
|
||||||
|
+ return selmon;
|
||||||
|
+ return m == selmon ? m : NULL;
|
||||||
|
+ }
|
||||||
|
+ for(n = 1, t = mons; t && t->next; n++, t = t->next) ;
|
||||||
|
+ for(i = 1, t = mons; t && t->next && i < systraypinning; i++, t = t->next) ;
|
||||||
|
+ if(systraypinningfailfirst && n < systraypinning)
|
||||||
|
+ return mons;
|
||||||
|
+ return t;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
zoom(const Arg *arg)
|
||||||
|
{
|
|
@ -80,12 +80,6 @@ dotfiles - My tiling Dwm configuration (for Arch/Devuan/Debian)
|
||||||
$ make
|
$ make
|
||||||
$ sudo make install
|
$ sudo make install
|
||||||
$ make clean
|
$ make clean
|
||||||
$ cd ~/.config/dwm/dwmblocks
|
|
||||||
$ make
|
|
||||||
$ sudo make install
|
|
||||||
$ make clean
|
|
||||||
$ cd ..
|
|
||||||
$ sudo cp -rfv dwm.desktop /usr/share/xsessions/
|
|
||||||
````
|
````
|
||||||
|
|
||||||
### Keys configuration:
|
### Keys configuration:
|
||||||
|
@ -112,6 +106,8 @@ My list of extra combinations:
|
||||||
- Volume-Down = Volume -5
|
- Volume-Down = Volume -5
|
||||||
- VolumeMute = Mute Volume
|
- VolumeMute = Mute Volume
|
||||||
- Super + Shift + q = Kill
|
- Super + Shift + q = Kill
|
||||||
|
- Super + Ctrl + r = Restart Dwm
|
||||||
|
- Super + Ctrl + q = Close session
|
||||||
|
|
||||||
### External links:
|
### External links:
|
||||||
|
|
||||||
|
|
BIN
examples/dwm.png
BIN
examples/dwm.png
Binary file not shown.
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 178 KiB |
|
@ -11,9 +11,9 @@ cp -rf .conky* ${HOME}/
|
||||||
cp -rf .config* ${HOME}/
|
cp -rf .config* ${HOME}/
|
||||||
cp -rf .vim* ${HOME}/
|
cp -rf .vim* ${HOME}/
|
||||||
cp -rf .Xresources ${HOME}/
|
cp -rf .Xresources ${HOME}/
|
||||||
rm -rfv ~/.local/share/dwm/autostart.sh 2> /dev/null
|
rm -rfv ~/.dwm/autostart.sh 2> /dev/null
|
||||||
mkdir -p ~/.local/share/dwm
|
mkdir -p ~/.dwm
|
||||||
ln -s ~/.config/dwm/autostart.sh ~/.local/share/dwm
|
ln -s ~/.config/dwm/autostart.sh ~/.dwm/autostart.sh
|
||||||
echo "# Removing unnecesary files"
|
echo "# Removing unnecesary files"
|
||||||
sleep 2
|
sleep 2
|
||||||
rm -rf ${HOME}/README.md
|
rm -rf ${HOME}/README.md
|
||||||
|
|
Loading…
Reference in New Issue
Block a user