feat: updated patches to latest versions

This commit is contained in:
Ryan Kes 2020-12-01 10:52:26 +01:00
parent eed6a6bc19
commit bde1fc1e63
16 changed files with 391 additions and 718 deletions

View file

@ -1,5 +1,5 @@
# $Id$
# Maintainer: Ryan Kes <alrayyes@gmail.com>
# Maintainer: Ryan Kes <ryan@ryankes.eu>
pkgname=higherlearning-dwm
pkgver=6.2
@ -9,23 +9,21 @@ url="http://dwm.suckless.org"
arch=('i686' 'x86_64')
license=('MIT')
options=(zipman)
depends=('libx11' 'libxinerama' 'libxft' 'freetype2' 'dmenu' 'otf-nerd-fonts-fira-code')
depends=('libx11' 'libxinerama' 'libxft' 'freetype2' 'dmenu')
optdepends=('gllock-git' 'higherlearning-st')
conflicts=('dwm')
install=dwm.install
_patches=(
"dwm-systray-20190208-cb3f58a.diff"
"dwm-noborder-20170207-bb3bd6f.diff"
"dwm-autostart-20161205-bb3bd6f.diff"
"dwm-systray-6.2.diff"
"dwm-noborder-6.2.diff"
"local-autostart-20200610-cb3f58a.diff"
"dwm-cyclelayouts-20180524-6.2.diff"
"dwm-gridmode-20170909-ceac8c9.diff"
"dwm-r1615-selfrestart.diff"
"local-hide_vacant_tags-git-20160626-7af4d43.diff"
"local-statuscolors-20181008-b69c870.diff"
"local-fancybar-2019018-b69c870.diff"
"local-scratchpad-20170207-bb3bd6f.diff"
"local-alpha-20180613-b69c870.diff"
"local-gridmode-20170909-ceac8c9.diff"
"local-r1615-selfrestart.diff"
"dwm-hide_vacant_tags-6.2.diff"
"local-scratchpad-6.2.diff"
"local-alpha-20201019-61bb8b2.diff"
)
source=(http://dl.suckless.org/dwm/dwm-$pkgver.tar.gz
@ -34,23 +32,21 @@ source=(http://dl.suckless.org/dwm/dwm-$pkgver.tar.gz
"${_patches[@]}")
md5sums=('9929845ccdec4d2cc191f16210dd7f3d'
'598fcb5275d7f036807765370b5a226d'
'071eefef57eb3362989a4e3501d2de7b'
'939f403a71b6e85261d09fc3412269ee'
'31a7569d7f3d43846f59e854ec5d1da0'
'fbb786263f2d714b18368ff64779d669'
'46ff022e2a2c6139e71399eb19d1aebb'
'1dfc635c0f4c4c670beb20cbb7234c0f'
'453062a348098b240e55f40623f14ed0'
'6f1cd0869b315c9ec03d182af6c31ce2'
'5baffd8c124095d06b133e9b31a854b2'
'6055775113fd4dc06200bc6aaafb72fb'
'aa3d5f3c45057a2a6ee73aede3fc218a'
'd2781ac29048fc50e42e0f11e6cf7bce'
'c5469c1457955a8447e05ec5118b3ce6'
'77e3bfab2270dde73caf4e1b14566386'
'7381051e12596394791092f0d39a2dd2'
'60a545c6661638af619913e2a093ebf8')
'ed77898009dea962f66a9dd607729549'
'8c3ad89cb98dd2b9152075b6e29cb579'
'c446b71a8b8cce25db86a47805500dfa'
'8e7bef8198d212f8c33efbf160b44b87'
'3f50d21e606afd5c8b3c67dbbbb9ea32')
prepare() {
cd $srcdir/dwm-$pkgver
sed -i "25 a \ \t{ NULL, NULL }," "$srcdir/$(basename ${_patches[4]})"
#sed -i "25 a \ \t{ NULL, NULL }," "$srcdir/$(basename ${_patches[4]})"
for patch in "${_patches[@]}"; do
echo "Applying patch $(basename $patch)..."

View file

@ -12,34 +12,20 @@
- [[https://dwm.suckless.org/patches/gridmode/][gridmode]]
- [[https://dwm.suckless.org/patches/selfrestart/][selfrestart]]
- [[https://dwm.suckless.org/patches/hide_vacant_tags/][hide_vacant_tags]]
- [[https://dwm.suckless.org/patches/statuscolors/][statuscolors]]
- [[https://dwm.suckless.org/patches/fancybar/][fancybar]]
- [[https://dwm.suckless.org/patches/scratchpad/][scratchpad]]
- [[https://dwm.suckless.org/patches/alpha/][alpha]]
** Installation
:PROPERTIES:
:CUSTOM_ID: installation
:END:
#+BEGIN_EXAMPLE shell
makepkg -si
#+END_EXAMPLE
** Further Notes
:PROPERTIES:
:CUSTOM_ID: further-notes
:END:
- Default font is
[[https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/FiraCode][Fira Code Nerd Font Mono]]
- When modifying [[https://github.com/alrayyes/dwm/blob/master/config.h][config.h]] be sure to run =updpkgsums= to update checksums before
running =makepkg -si=
** License
:PROPERTIES:
:CUSTOM_ID: license
:END:
This theme is released under the MIT License. For more information read
the [[file:LICENSE.org][license]].

111
config.h
View file

@ -1,15 +1,16 @@
/* See LICENSE file for copyright and license details. */
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int borderpx = 2; /* border pixel of windows */
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 = 1; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
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[] = { "FuraCode Nerd Font:style=Regular:pixelsize=18:antialias=true:autohint=true" };
static const char *fonts[] = { "Hack Nerd Font Mono:size=10" };
static const char dmenufont[] = "Hack Nerd Font Mono:size=10";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
@ -19,81 +20,19 @@ static const char col_black[] = "#000000";
static const char col_red[] = "#ff0000";
static const char col_yellow[] = "#ffff00";
static const char col_white[] = "#ffffff";
static const char status_white[] = "#dddddd";
static const char status_black[] = "#000";
static const unsigned int baralpha = 0xd0;
static const unsigned int borderalpha = OPAQUE;
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
[SchemeWarn] = { col_black, col_yellow, col_red },
[SchemeUrgent]= { col_white, col_red, col_red },
{ "#404040", col_gray1, col_gray1 }, /* bar 1 seperator */
{ status_black, "#404040", "#404040" }, /* bar 1 */
{ "#E84F4F", "#404040", "#404040" }, /* bar 2 seperator */
{ status_black, "#E84F4F", "#E84F4F" }, /* bar 2 */
{ "#B8D68C", "#E84F4F", "#E84F4F" }, /* bar 3 seperator */
{ status_black, "#B8D68C", "#B8D68C" }, /* bar 3 */
{ "#E1AA5D", "#B8D68C", "#B8D68C" }, /* bar 4 seperator */
{ status_black, "#E1AA5D", "#E1AA5D" }, /* bar 4 */
{ "#7DC1CF", "#E1AA5D", "#E1AA5D" }, /* bar 5 seperator */
{ status_black, "#7DC1CF", "#7DC1CF" }, /* bar 5 */
{ "#9B64FB", "#7DC1CF", "#7DC1CF" }, /* bar 6 seperator */
{ status_black, "#9B64FB", "#9B64FB" }, /* bar 6 */
{ "#6D878D", "#9B64FB", "#9B64FB" }, /* bar 7 seperator */
{ status_black, "#6D878D", "#6D878D" }, /* bar 7 */
{ "#dddddd", "#6D878D", "#6D878D" }, /* bar 8 seperator */
{ status_black, "#dddddd", "#dddddd" }, /* bar 8 */
{ "#404040", "#dddddd", "#dddddd" }, /* bar 9 seperator */
{ status_black, "#404040", "#404040" }, /* bar 9 */
{ "#D23D3D", "#404040", "#404040" }, /* bar 10 seperator */
{ status_black, "#D23D3D", "#D23D3D" }, /* bar 10 */
{ "#A0CF5D", "#D23D3D", "#D23D3D" }, /* bar 11 seperator */
{ status_black, "#A0CF5D", "#A0CF5D" }, /* bar 11 */
{ "#F39D21", "#A0CF5D", "#A0CF5D" }, /* bar 12 seperator */
{ status_black, "#F39D21", "#F39D21" }, /* bar 12 */
{ "#4E9FB1", "#F39D21", "#F39D21" }, /* bar 13 seperator */
{ status_black, "#4E9FB1", "#4E9FB1" }, /* bar 13 */
//{ "#8542FF", "#4E9FB1", "#4E9FB1" }, /* bar 14 seperator */
//{ status_black, "#8542FF", "#8542FF" }, /* bar 14 */
//{ "#42717B", "#8542FF", "#8542FF" }, /* bar 15 seperator */
//{ status_black, "#42717B", "#42717B" }, /* bar 15 */
//{ "#dddddd", "#42717B", "#42717B" }, /* bar 16 seperator */
//{ status_black, "#dddddd", "#dddddd" }, /* bar 16 */
//[SchemeWarn] = { col_black, col_yellow, col_red },
//[SchemeUrgent]= { col_white, col_red, col_red },
};
static const unsigned int alphas[][3] = {
/* fg bg border */
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
[SchemeWarn] = { OPAQUE, baralpha, borderalpha },
[SchemeUrgent] = { OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha }, /* bar 1 seperator */
{ OPAQUE, baralpha, borderalpha }, /* bar 1 */
{ OPAQUE, baralpha, borderalpha }, /* bar 2 seperator */
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
};
/* tagging */
@ -104,17 +43,25 @@ static const Rule rules[] = {
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating monitor */
{ "Syncthing GTK", NULL, NULL, 0, 1, -1 },
{ "Toggl Desktop", NULL, NULL, 0, 1, -1 },
{ "Gimp", NULL, NULL, 0, 1, -1 },
{ "firefox", NULL, NULL, 1 << 8, 0, -1 },
{ "Gpodder", NULL, NULL, 1 << 3, 0, -1 },
{ "Spotify", NULL, NULL, 1 << 3, 0, -1 },
{ "ncmpcpp", NULL, NULL, 1 << 3, 0, -1 },
{ "mutt", NULL, NULL, 1 << 5, 0, -1 },
{ "weechat", NULL, NULL, 1 << 6, 0, -1 },
{ "Slack", NULL, NULL, 1 << 6, 0, -1 },
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, 1, -1 },
{ "Syncthing GTK", NULL, NULL, 0, 1, -1 },
{ "Brave-browser", NULL, NULL, 0, 0, 1 },
{ "Firefox", NULL, NULL, 0, 0, 1 },
{ "iceweasel", NULL, NULL, 0, 0, 1 },
{ "Element", NULL, NULL, 1 << 2, 0, -1 },
{ "Element-Nightly", NULL, NULL, 1 << 2, 0, -1 },
{ "Slack", NULL, NULL, 1 << 2, 0, -1 },
{ "castero", NULL, NULL, 1 << 3, 0, -1 },
{ "Spt", NULL, NULL, 1 << 3, 0, -1 },
{ "Spotify", NULL, NULL, 1 << 3, 0, -1 },
{ "jetbrains-webstorm", NULL, NULL, 1 << 7, 0, -1 },
{ "Emacs", NULL, NULL, 1 << 8, 0, -1 },
};
/* layout(s) */
@ -145,7 +92,7 @@ static const Layout layouts[] = {
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "/home/alrayyes/.scripts/dmenu-frequency" };
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 scratchpadname[] = "scratchpad";
static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL };
@ -154,7 +101,8 @@ static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34
static Key keys[] = {
/* modifier key function argument */
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
//{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
//{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_grave, togglescratch, {.v = scratchpadcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
@ -189,7 +137,7 @@ static Key keys[] = {
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_r, self_restart, {0} },
{ MODKEY|ShiftMask, XK_r, self_restart, {0} },
{ MODKEY|ShiftMask, XK_q, quit, {0} },
};
@ -209,4 +157,3 @@ static Button buttons[] = {
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};

View file

@ -1,7 +1,7 @@
/* See LICENSE file for copyright and license details. */
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const unsigned int systraypinning = 1; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
static const unsigned int systrayspacing = 2; /* systray spacing */
@ -9,7 +9,8 @@ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display
static const int showsystray = 1; /* 0 means no systray */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "FuraCode Nerd Font:style=Regular:pixelsize=14:antialias=true:autohint=true" };
static const char *fonts[] = { "Hack Nerd Font Mono:size=10" };
static const char dmenufont[] = "Hack Nerd Font Mono:size=10";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
@ -19,81 +20,19 @@ static const char col_black[] = "#000000";
static const char col_red[] = "#ff0000";
static const char col_yellow[] = "#ffff00";
static const char col_white[] = "#ffffff";
static const char status_white[] = "#dddddd";
static const char status_black[] = "#000";
static const unsigned int baralpha = 0xd0;
static const unsigned int borderalpha = OPAQUE;
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
[SchemeWarn] = { col_black, col_yellow, col_red },
[SchemeUrgent]= { col_white, col_red, col_red },
{ "#404040", col_gray1, col_gray1 }, /* bar 1 seperator */
{ status_black, "#404040", "#404040" }, /* bar 1 */
{ "#E84F4F", "#404040", "#404040" }, /* bar 2 seperator */
{ status_black, "#E84F4F", "#E84F4F" }, /* bar 2 */
{ "#B8D68C", "#E84F4F", "#E84F4F" }, /* bar 3 seperator */
{ status_black, "#B8D68C", "#B8D68C" }, /* bar 3 */
{ "#E1AA5D", "#B8D68C", "#B8D68C" }, /* bar 4 seperator */
{ status_black, "#E1AA5D", "#E1AA5D" }, /* bar 4 */
{ "#7DC1CF", "#E1AA5D", "#E1AA5D" }, /* bar 5 seperator */
{ status_black, "#7DC1CF", "#7DC1CF" }, /* bar 5 */
{ "#9B64FB", "#7DC1CF", "#7DC1CF" }, /* bar 6 seperator */
{ status_black, "#9B64FB", "#9B64FB" }, /* bar 6 */
{ "#6D878D", "#9B64FB", "#9B64FB" }, /* bar 7 seperator */
{ status_black, "#6D878D", "#6D878D" }, /* bar 7 */
{ "#dddddd", "#6D878D", "#6D878D" }, /* bar 8 seperator */
{ status_black, "#dddddd", "#dddddd" }, /* bar 8 */
{ "#404040", "#dddddd", "#dddddd" }, /* bar 9 seperator */
{ status_black, "#404040", "#404040" }, /* bar 9 */
{ "#D23D3D", "#404040", "#404040" }, /* bar 10 seperator */
{ status_black, "#D23D3D", "#D23D3D" }, /* bar 10 */
{ "#A0CF5D", "#D23D3D", "#D23D3D" }, /* bar 11 seperator */
{ status_black, "#A0CF5D", "#A0CF5D" }, /* bar 11 */
{ "#F39D21", "#A0CF5D", "#A0CF5D" }, /* bar 12 seperator */
{ status_black, "#F39D21", "#F39D21" }, /* bar 12 */
{ "#4E9FB1", "#F39D21", "#F39D21" }, /* bar 13 seperator */
{ status_black, "#4E9FB1", "#4E9FB1" }, /* bar 13 */
//{ "#8542FF", "#4E9FB1", "#4E9FB1" }, /* bar 14 seperator */
//{ status_black, "#8542FF", "#8542FF" }, /* bar 14 */
//{ "#42717B", "#8542FF", "#8542FF" }, /* bar 15 seperator */
//{ status_black, "#42717B", "#42717B" }, /* bar 15 */
//{ "#dddddd", "#42717B", "#42717B" }, /* bar 16 seperator */
//{ status_black, "#dddddd", "#dddddd" }, /* bar 16 */
//[SchemeWarn] = { col_black, col_yellow, col_red },
//[SchemeUrgent]= { col_white, col_red, col_red },
};
static const unsigned int alphas[][3] = {
/* fg bg border */
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
[SchemeWarn] = { OPAQUE, baralpha, borderalpha },
[SchemeUrgent] = { OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha }, /* bar 1 seperator */
{ OPAQUE, baralpha, borderalpha }, /* bar 1 */
{ OPAQUE, baralpha, borderalpha }, /* bar 2 seperator */
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
{ OPAQUE, baralpha, borderalpha },
};
/* tagging */
@ -104,17 +43,25 @@ static const Rule rules[] = {
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating monitor */
{ "Syncthing GTK", NULL, NULL, 0, 1, -1 },
{ "Toggl Desktop", NULL, NULL, 0, 1, -1 },
{ "Gimp", NULL, NULL, 0, 1, -1 },
{ "iceweasel", NULL, NULL, 1 << 8, 0, -1 },
{ "Gpodder", NULL, NULL, 1 << 3, 0, -1 },
{ "Spotify", NULL, NULL, 1 << 3, 0, -1 },
{ "ncmpcpp", NULL, NULL, 1 << 3, 0, -1 },
{ "mutt", NULL, NULL, 1 << 5, 0, -1 },
{ "weechat", NULL, NULL, 1 << 6, 0, -1 },
{ "Slack", NULL, NULL, 1 << 6, 0, -1 },
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, 1, -1 },
{ "Syncthing GTK", NULL, NULL, 0, 1, -1 },
{ "Brave-browser", NULL, NULL, 0, 0, 1 },
{ "Firefox", NULL, NULL, 0, 0, 1 },
{ "iceweasel", NULL, NULL, 0, 0, 1 },
{ "Element", NULL, NULL, 1 << 2, 0, -1 },
{ "Element-Nightly", NULL, NULL, 1 << 2, 0, -1 },
{ "Slack", NULL, NULL, 1 << 2, 0, -1 },
{ "castero", NULL, NULL, 1 << 3, 0, -1 },
{ "Spt", NULL, NULL, 1 << 3, 0, -1 },
{ "Spotify", NULL, NULL, 1 << 3, 0, -1 },
{ "jetbrains-webstorm", NULL, NULL, 1 << 7, 0, -1 },
{ "Emacs", NULL, NULL, 1 << 8, 0, -1 },
};
/* layout(s) */
@ -145,7 +92,7 @@ static const Layout layouts[] = {
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "/home/alrayyes/.scripts/dmenu-frequency" };
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 scratchpadname[] = "scratchpad";
static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL };
@ -154,7 +101,8 @@ static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34
static Key keys[] = {
/* modifier key function argument */
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
//{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
//{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_grave, togglescratch, {.v = scratchpadcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
@ -189,7 +137,7 @@ static Key keys[] = {
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_r, self_restart, {0} },
{ MODKEY|ShiftMask, XK_r, self_restart, {0} },
{ MODKEY|ShiftMask, XK_q, quit, {0} },
};
@ -209,4 +157,3 @@ static Button buttons[] = {
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};

View file

@ -1,39 +0,0 @@
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);

View file

@ -1,8 +1,8 @@
diff --git a/dwm.c b/dwm.c
index b2bc9bd..d9a333a 100644
index 4465af1..c4aa3de 100644
--- a/dwm.c
+++ b/dwm.c
@@ -469,7 +469,7 @@ attachstack(Client *c)
@@ -416,7 +416,7 @@ attachstack(Client *c)
void
buttonpress(XEvent *e)
{
@ -11,7 +11,7 @@ index b2bc9bd..d9a333a 100644
Arg arg = {0};
Client *c;
Monitor *m;
@@ -484,9 +484,13 @@ buttonpress(XEvent *e)
@@ -431,9 +431,14 @@ buttonpress(XEvent *e)
}
if (ev->window == selmon->barwin) {
i = x = 0;
@ -19,6 +19,7 @@ index b2bc9bd..d9a333a 100644
+ for (c = m->clients; c; c = c->next)
+ occ |= c->tags == 255 ? 0 : c->tags;
+ do {
+ /* do not reserve space for vacant tags */
+ if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
+ continue;
x += TEXTW(tags[i]);
@ -27,9 +28,9 @@ index b2bc9bd..d9a333a 100644
if (i < LENGTH(tags)) {
click = ClkTagBar;
arg.ui = 1 << i;
@@ -836,19 +840,17 @@ drawbar(Monitor *m)
@@ -709,19 +714,19 @@ drawbar(Monitor *m)
}
resizebarwin(m);
for (c = m->clients; c; c = c->next) {
- occ |= c->tags;
+ occ |= c->tags == 255 ? 0 : c->tags;
@ -38,8 +39,10 @@ index b2bc9bd..d9a333a 100644
}
x = 0;
for (i = 0; i < LENGTH(tags); i++) {
+ /* do not draw vacant tags */
+ if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
+ continue;
+ continue;
+
w = TEXTW(tags[i]);
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);

View file

@ -1,14 +1,23 @@
From 9102fdb9c670218373bbe83c891c8e8138d6a6f4 Mon Sep 17 00:00:00 2001
From: redacted <redacted@example.com>
Date: Tue, 23 Apr 2019 00:39:27 +0100
Subject: [PATCH] added noborder patch
---
dwm.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dwm.c b/dwm.c
index d27cb67..ad6b4df 100644
index 4465af1..685eca1 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1287,6 +1287,13 @@ resizeclient(Client *c, int x, int y, int w, int h)
@@ -1282,6 +1282,13 @@ resizeclient(Client *c, int x, int y, int w, int h)
c->oldw = c->w; c->w = wc.width = w;
c->oldh = c->h; c->h = wc.height = h;
wc.border_width = c->bw;
+ if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next))
+ || &monocle == c->mon->lt[c->mon->sellt]->arrange)
+ && !c->isfullscreen) {
+ && !c->isfullscreen && !c->isfloating) {
+ c->w = wc.width += c->bw * 2;
+ c->h = wc.height += c->bw * 2;
+ wc.border_width = 0;
@ -16,3 +25,6 @@ index d27cb67..ad6b4df 100644
XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
configure(c);
XSync(dpy, False);
--
2.21.0

View file

@ -1,3 +1,16 @@
From 4001ccae7b1a41bdcb247b0cf095a51af7b68c28 Mon Sep 17 00:00:00 2001
From: Igor Gevka <igor.gevka@gmail.com>
Date: Sun, 16 Feb 2020 15:03:10 -0800
Subject: [PATCH] [PATCH] Implements a system tray for dwm.
Original author: Jan Christoph Ebersbach <jceb@e-jc.de>, inspired by http://code.google.com/p/dwm-plus
URL: http://dwm.suckless.org/patches/systray
dwm 6.2 port by Igor Gevka <igor.gevka@gmail.com>
---
config.def.h | 4 +
dwm.c | 404 +++++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 382 insertions(+), 26 deletions(-)
diff --git a/config.def.h b/config.def.h
index 1c0b587..2d824d1 100644
--- a/config.def.h
@ -14,7 +27,7 @@ index 1c0b587..2d824d1 100644
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "monospace:size=10" };
diff --git a/dwm.c b/dwm.c
index 4465af1..4bccb41 100644
index 4465af1..3e361fa 100644
--- a/dwm.c
+++ b/dwm.c
@@ -57,12 +57,30 @@
@ -155,7 +168,7 @@ index 4465af1..4bccb41 100644
for (i = 0; i < CurLast; i++)
drw_cur_free(drw, cursor[i]);
for (i = 0; i < LENGTH(colors); i++)
@@ -512,9 +553,52 @@ cleanupmon(Monitor *mon)
@@ -512,9 +553,57 @@ cleanupmon(Monitor *mon)
void
clientmessage(XEvent *e)
{
@ -176,7 +189,12 @@ index 4465af1..4bccb41 100644
+ c->mon = selmon;
+ c->next = systray->icons;
+ systray->icons = c;
+ XGetWindowAttributes(dpy, c->win, &wa);
+ 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;
@ -208,7 +226,7 @@ index 4465af1..4bccb41 100644
if (!c)
return;
if (cme->message_type == netatom[NetWMState]) {
@@ -567,7 +651,7 @@ configurenotify(XEvent *e)
@@ -567,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);
@ -217,7 +235,7 @@ index 4465af1..4bccb41 100644
}
focus(NULL);
arrange(NULL);
@@ -652,6 +736,11 @@ destroynotify(XEvent *e)
@@ -652,6 +741,11 @@ destroynotify(XEvent *e)
if ((c = wintoclient(ev->window)))
unmanage(c, 1);
@ -229,7 +247,7 @@ index 4465af1..4bccb41 100644
}
void
@@ -695,19 +784,23 @@ dirtomon(int dir)
@@ -695,19 +789,23 @@ dirtomon(int dir)
void
drawbar(Monitor *m)
{
@ -256,7 +274,7 @@ index 4465af1..4bccb41 100644
for (c = m->clients; c; c = c->next) {
occ |= c->tags;
if (c->isurgent)
@@ -728,7 +821,7 @@ drawbar(Monitor *m)
@@ -728,7 +826,7 @@ drawbar(Monitor *m)
drw_setscheme(drw, scheme[SchemeNorm]);
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
@ -265,7 +283,7 @@ index 4465af1..4bccb41 100644
if (m->sel) {
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
@@ -739,7 +832,7 @@ drawbar(Monitor *m)
@@ -739,7 +837,7 @@ drawbar(Monitor *m)
drw_rect(drw, x, 0, w, bh, 1, 1);
}
}
@ -274,7 +292,7 @@ index 4465af1..4bccb41 100644
}
void
@@ -776,8 +869,11 @@ expose(XEvent *e)
@@ -776,8 +874,11 @@ expose(XEvent *e)
Monitor *m;
XExposeEvent *ev = &e->xexpose;
@ -287,7 +305,7 @@ index 4465af1..4bccb41 100644
}
void
@@ -862,10 +958,17 @@ getatomprop(Client *c, Atom prop)
@@ -862,10 +963,17 @@ getatomprop(Client *c, Atom prop)
unsigned long dl;
unsigned char *p = NULL;
Atom da, atom = None;
@ -306,7 +324,7 @@ index 4465af1..4bccb41 100644
XFree(p);
}
return atom;
@@ -899,6 +1002,16 @@ getstate(Window w)
@@ -899,6 +1007,16 @@ getstate(Window w)
return result;
}
@ -323,7 +341,7 @@ index 4465af1..4bccb41 100644
int
gettextprop(Window w, Atom atom, char *text, unsigned int size)
{
@@ -1003,7 +1116,7 @@ killclient(const Arg *arg)
@@ -1003,7 +1121,7 @@ killclient(const Arg *arg)
{
if (!selmon->sel)
return;
@ -332,7 +350,7 @@ index 4465af1..4bccb41 100644
XGrabServer(dpy);
XSetErrorHandler(xerrordummy);
XSetCloseDownMode(dpy, DestroyAll);
@@ -1091,6 +1204,12 @@ maprequest(XEvent *e)
@@ -1091,6 +1209,12 @@ maprequest(XEvent *e)
{
static XWindowAttributes wa;
XMapRequestEvent *ev = &e->xmaprequest;
@ -345,7 +363,7 @@ index 4465af1..4bccb41 100644
if (!XGetWindowAttributes(dpy, ev->window, &wa))
return;
@@ -1215,6 +1334,16 @@ propertynotify(XEvent *e)
@@ -1215,6 +1339,16 @@ propertynotify(XEvent *e)
Window trans;
XPropertyEvent *ev = &e->xproperty;
@ -362,7 +380,7 @@ index 4465af1..4bccb41 100644
if ((ev->window == root) && (ev->atom == XA_WM_NAME))
updatestatus();
else if (ev->state == PropertyDelete)
@@ -1265,6 +1394,20 @@ recttomon(int x, int y, int w, int h)
@@ -1265,6 +1399,20 @@ recttomon(int x, int y, int w, int h)
return r;
}
@ -383,7 +401,7 @@ index 4465af1..4bccb41 100644
void
resize(Client *c, int x, int y, int w, int h, int interact)
{
@@ -1272,6 +1415,14 @@ resize(Client *c, int x, int y, int w, int h, int interact)
@@ -1272,6 +1420,14 @@ resize(Client *c, int x, int y, int w, int h, int interact)
resizeclient(c, x, y, w, h);
}
@ -398,7 +416,7 @@ index 4465af1..4bccb41 100644
void
resizeclient(Client *c, int x, int y, int w, int h)
{
@@ -1344,6 +1495,19 @@ resizemouse(const Arg *arg)
@@ -1344,6 +1500,19 @@ resizemouse(const Arg *arg)
}
}
@ -418,7 +436,7 @@ index 4465af1..4bccb41 100644
void
restack(Monitor *m)
{
@@ -1433,26 +1597,36 @@ setclientstate(Client *c, long state)
@@ -1433,26 +1602,36 @@ setclientstate(Client *c, long state)
}
int
@ -466,7 +484,7 @@ index 4465af1..4bccb41 100644
}
return exists;
}
@@ -1466,7 +1640,7 @@ setfocus(Client *c)
@@ -1466,7 +1645,7 @@ setfocus(Client *c)
XA_WINDOW, 32, PropModeReplace,
(unsigned char *) &(c->win), 1);
}
@ -475,7 +493,7 @@ index 4465af1..4bccb41 100644
}
void
@@ -1555,6 +1729,10 @@ setup(void)
@@ -1555,6 +1734,10 @@ setup(void)
wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False);
netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
@ -486,7 +504,7 @@ index 4465af1..4bccb41 100644
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);
@@ -1562,6 +1740,9 @@ setup(void)
@@ -1562,6 +1745,9 @@ setup(void)
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);
@ -496,7 +514,7 @@ index 4465af1..4bccb41 100644
/* init cursors */
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
@@ -1570,6 +1751,8 @@ setup(void)
@@ -1570,6 +1756,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);
@ -505,7 +523,7 @@ index 4465af1..4bccb41 100644
/* init bars */
updatebars();
updatestatus();
@@ -1701,7 +1884,18 @@ togglebar(const Arg *arg)
@@ -1701,7 +1889,18 @@ togglebar(const Arg *arg)
{
selmon->showbar = !selmon->showbar;
updatebarpos(selmon);
@ -525,7 +543,7 @@ index 4465af1..4bccb41 100644
arrange(selmon);
}
@@ -1796,11 +1990,18 @@ unmapnotify(XEvent *e)
@@ -1796,11 +1995,18 @@ unmapnotify(XEvent *e)
else
unmanage(c, 0);
}
@ -544,7 +562,7 @@ index 4465af1..4bccb41 100644
Monitor *m;
XSetWindowAttributes wa = {
.override_redirect = True,
@@ -1811,10 +2012,15 @@ updatebars(void)
@@ -1811,10 +2017,15 @@ updatebars(void)
for (m = mons; m; m = m->next) {
if (m->barwin)
continue;
@ -561,7 +579,7 @@ index 4465af1..4bccb41 100644
XMapRaised(dpy, m->barwin);
XSetClassHint(dpy, m->barwin, &ch);
}
@@ -1990,6 +2196,121 @@ updatestatus(void)
@@ -1990,6 +2201,121 @@ updatestatus(void)
if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
strcpy(stext, "dwm-"VERSION);
drawbar(selmon);
@ -580,7 +598,7 @@ index 4465af1..4bccb41 100644
+ 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 dimenons if they don't want to */
+ /* force icons into the systray dimensions if they don't want to */
+ if (i->h > bh) {
+ if (i->w == i->h)
+ i->w = bh;
@ -683,7 +701,7 @@ index 4465af1..4bccb41 100644
}
void
@@ -2057,6 +2378,16 @@ wintoclient(Window w)
@@ -2057,6 +2383,16 @@ wintoclient(Window w)
return NULL;
}
@ -700,7 +718,7 @@ index 4465af1..4bccb41 100644
Monitor *
wintomon(Window w)
{
@@ -2110,6 +2441,22 @@ xerrorstart(Display *dpy, XErrorEvent *ee)
@@ -2110,6 +2446,22 @@ xerrorstart(Display *dpy, XErrorEvent *ee)
return -1;
}
@ -723,3 +741,6 @@ index 4465af1..4bccb41 100644
void
zoom(const Arg *arg)
{
--
2.17.1

View file

@ -1,19 +1,16 @@
diff -up a/config.def.h b/config.def.h
--- a/config.def.h
+++ b/config.def.h
@@ -20,7 +20,8 @@ static const char col_black[] = "#
static const char col_red[] = "#ff0000";
static const char col_yellow[] = "#ffff00";
static const char col_white[] = "#ffffff";
-
diff -up -N a/config.def.h b/config.def.h
--- a/config.def.h 2020-12-01 10:32:18.704229651 +0100
+++ b/config.def.h 2020-12-01 10:33:45.017561313 +0100
@@ -16,11 +16,18 @@ static const char col_gray2[] = "#
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
+static const unsigned int baralpha = 0xd0;
+static const unsigned int borderalpha = OPAQUE;
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
@@ -28,6 +29,11 @@ static const char *colors[][3] = {
[SchemeWarn] = { col_black, col_yellow, col_red },
[SchemeUrgent]= { col_white, col_red, col_red },
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
};
+static const unsigned int alphas[][3] = {
+ /* fg bg border */
@ -23,9 +20,9 @@ diff -up a/config.def.h b/config.def.h
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
diff -up a/config.mk b/config.mk
--- a/config.mk 2019-02-02 13:55:28.000000000 +0100
+++ b/config.mk 2019-03-12 18:34:52.780703276 +0100
diff -up -N a/config.mk b/config.mk
--- a/config.mk 2020-12-01 10:32:18.704229651 +0100
+++ b/config.mk 2020-12-01 10:34:10.574227241 +0100
@@ -22,7 +22,7 @@ FREETYPEINC = /usr/include/freetype2
# includes and libs
@ -35,9 +32,9 @@ diff -up a/config.mk b/config.mk
# flags
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
diff -up a/drw.c b/drw.c
--- a/drw.c 2019-02-02 13:55:28.000000000 +0100
+++ b/drw.c 2019-03-12 18:34:52.780703276 +0100
diff -up -N a/drw.c b/drw.c
--- a/drw.c 2020-12-01 10:32:18.704229651 +0100
+++ b/drw.c 2020-12-01 10:38:15.630881362 +0100
@@ -61,7 +61,7 @@ utf8decode(const char *c, long *u, size_
}
@ -47,7 +44,7 @@ diff -up a/drw.c b/drw.c
{
Drw *drw = ecalloc(1, sizeof(Drw));
@@ -70,8 +70,14 @@ drw_create(Display *dpy, int screen, Win
@@ -70,8 +70,11 @@ drw_create(Display *dpy, int screen, Win
drw->root = root;
drw->w = w;
drw->h = h;
@ -56,15 +53,12 @@ diff -up a/drw.c b/drw.c
+ drw->visual = visual;
+ drw->depth = depth;
+ drw->cmap = cmap;
+ drw->visual = visual;
+ drw->depth = depth;
+ drw->cmap = cmap;
+ drw->drawable = XCreatePixmap(dpy, root, w, h, depth);
+ drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL);
XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
return drw;
@@ -87,7 +93,7 @@ drw_resize(Drw *drw, unsigned int w, uns
@@ -87,7 +90,7 @@ drw_resize(Drw *drw, unsigned int w, uns
drw->h = h;
if (drw->drawable)
XFreePixmap(drw->dpy, drw->drawable);
@ -73,7 +67,7 @@ diff -up a/drw.c b/drw.c
}
void
@@ -193,21 +199,22 @@ drw_fontset_free(Fnt *font)
@@ -193,21 +196,22 @@ drw_fontset_free(Fnt *font)
}
void
@ -100,7 +94,7 @@ diff -up a/drw.c b/drw.c
{
size_t i;
Clr *ret;
@@ -217,7 +224,7 @@ drw_scm_create(Drw *drw, const char *clr
@@ -217,7 +221,7 @@ drw_scm_create(Drw *drw, const char *clr
return NULL;
for (i = 0; i < clrcount; i++)
@ -109,7 +103,7 @@ diff -up a/drw.c b/drw.c
return ret;
}
@@ -273,9 +280,7 @@ drw_text(Drw *drw, int x, int y, unsigne
@@ -273,9 +277,7 @@ drw_text(Drw *drw, int x, int y, unsigne
} else {
XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
@ -120,9 +114,9 @@ diff -up a/drw.c b/drw.c
x += lpad;
w -= lpad;
}
diff -up a/drw.h b/drw.h
--- a/drw.h 2019-02-02 13:55:28.000000000 +0100
+++ b/drw.h 2019-03-12 18:34:52.780703276 +0100
diff -up -N a/drw.h b/drw.h
--- a/drw.h 2020-12-01 10:32:18.704229651 +0100
+++ b/drw.h 2020-12-01 10:39:11.374210543 +0100
@@ -20,6 +20,9 @@ typedef struct {
Display *dpy;
int screen;
@ -153,9 +147,9 @@ diff -up a/drw.h b/drw.h
/* Cursor abstraction */
Cur *drw_cur_create(Drw *drw, int shape);
diff -up a/dwm.c b/dwm.c
--- a/dwm.c 2019-03-13 09:31:38.313322535 +0100
+++ b/dwm.c 2019-03-12 18:34:52.780703276 +0100
diff -up -N a/dwm.c b/dwm.c
--- a/dwm.c 2020-12-01 10:32:18.704229651 +0100
+++ b/dwm.c 2020-12-01 10:42:35.324191552 +0100
@@ -58,6 +58,8 @@
#define TAGMASK ((1 << LENGTH(tags)) - 1)
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
@ -165,16 +159,7 @@ diff -up a/dwm.c b/dwm.c
#define SYSTEM_TRAY_REQUEST_DOCK 0
/* XEMBED messages */
@@ -74,6 +76,8 @@
#define VERSION_MINOR 0
#define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR
+#define OPAQUE 0xffU
+
/* enums */
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
enum { SchemeNorm, SchemeSel, SchemeWarn, SchemeUrgent }; /* color schemes */
@@ -272,6 +276,7 @@ static Client *wintosystrayicon(Window w
@@ -270,6 +272,7 @@ 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);
@ -182,7 +167,7 @@ diff -up a/dwm.c b/dwm.c
static void zoom(const Arg *arg);
/* variables */
@@ -310,6 +315,11 @@ static Drw *drw;
@@ -312,6 +315,11 @@ static Drw *drw;
static Monitor *mons, *selmon;
static Window root, wmcheckwin;
@ -194,7 +179,7 @@ diff -up a/dwm.c b/dwm.c
/* configuration, allows nested code to access above variables */
#include "config.h"
@@ -1786,7 +1796,8 @@ setup(void)
@@ -1844,7 +1852,8 @@ setup(void)
sw = DisplayWidth(dpy, screen);
sh = DisplayHeight(dpy, screen);
root = RootWindow(dpy, screen);
@ -204,7 +189,7 @@ diff -up a/dwm.c b/dwm.c
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
die("no fonts could be loaded.");
lrpad = drw->fonts->h;
@@ -1821,7 +1832,7 @@ setup(void)
@@ -1879,7 +1888,7 @@ setup(void)
/* init appearance */
scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
for (i = 0; i < LENGTH(colors); i++)
@ -213,7 +198,7 @@ diff -up a/dwm.c b/dwm.c
/* init system tray */
updatesystray();
/* init bars */
@@ -2098,7 +2109,9 @@ updatebars(void)
@@ -2157,7 +2166,9 @@ updatebars(void)
Monitor *m;
XSetWindowAttributes wa = {
.override_redirect = True,
@ -224,7 +209,7 @@ diff -up a/dwm.c b/dwm.c
.event_mask = ButtonPressMask|ExposureMask
};
XClassHint ch = {"dwm", "dwm"};
@@ -2108,9 +2121,9 @@ updatebars(void)
@@ -2167,9 +2178,9 @@ updatebars(void)
w = m->ww;
if (showsystray && m == systraytomon(m))
w -= getsystraywidth();
@ -237,17 +222,7 @@ diff -up a/dwm.c b/dwm.c
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
if (showsystray && m == systraytomon(m))
XMapRaised(dpy, systray->win);
@@ -2403,7 +2416,8 @@ updatesystray(void)
XMapSubwindows(dpy, systray->win);
/* redraw background */
XSetForeground(dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel);
- XFillRectangle(dpy, systray->win, drw->gc, 0, 0, w, bh);
+// XFillRectangle(dpy, systray->win, drw->gc, 0, 0, w, bh);
+ XFillRectangle(dpy, systray->win, XCreateGC(dpy, root, 0, NULL), 0, 0, w, bh);
XSync(dpy, False);
}
@@ -2552,6 +2566,43 @@ systraytomon(Monitor *m) {
@@ -2610,6 +2621,43 @@ systraytomon(Monitor *m) {
}
void

View file

@ -0,0 +1,164 @@
diff -up a/dwm.1 b/dwm.1
--- a/dwm.1 2020-12-01 10:01:44.217062949 +0100
+++ b/dwm.1 2020-12-01 10:04:30.247194027 +0100
@@ -30,6 +30,14 @@ top left corner. The tags which are app
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
.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 -up a/dwm.c b/dwm.c
--- a/dwm.c 2020-12-01 10:01:44.217062949 +0100
+++ b/dwm.c 2020-12-01 10:07:15.937309505 +0100
@@ -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>
@@ -222,6 +223,7 @@ static void resizemouse(const Arg *arg);
static void resizerequest(XEvent *e);
static void restack(Monitor *m);
static void run(void);
+static void runautostart(void);
static void scan(void);
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);
@@ -269,8 +271,12 @@ static int xerrorstart(Display *dpy, XEr
static void zoom(const Arg *arg);
/* variables */
+static const char autostartblocksh[] = "autostart_blocking.sh";
+static const char autostartsh[] = "autostart.sh";
static Systray *systray = NULL;
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 */
@@ -1557,6 +1563,83 @@ run(void)
}
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)
{
unsigned int i, num;
@@ -2501,6 +2584,7 @@ main(int argc, char *argv[])
die("pledge");
#endif /* __OpenBSD__ */
scan();
+ runautostart();
run();
cleanup();
XCloseDisplay(dpy);

View file

@ -1,148 +0,0 @@
diff -up a/dwm.c b/dwm.c
--- a/dwm.c
+++ b/dwm.c
@@ -56,6 +56,7 @@
#define WIDTH(X) ((X)->w + 2 * (X)->bw)
#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
#define TAGMASK ((1 << LENGTH(tags)) - 1)
+#define TAGSLENGTH (LENGTH(tags))
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
#define SYSTEM_TRAY_REQUEST_DOCK 0
@@ -80,7 +81,7 @@ enum { SchemeNorm, SchemeSel }; /* color
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz,
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
- NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
+ NetWMWindowTypeDialog, NetClientList, NetDesktopNames, NetDesktopViewport, NetNumberOfDesktops, NetCurrentDesktop, NetLast }; /* EWMH atoms */
enum { Manager, Xembed, XembedInfo, XLast }; /* Xembed atoms */
enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
@@ -231,11 +232,15 @@ static void scan(void);
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 setcurrentdesktop(void);
+static void setdesktopnames(void);
static void setfocus(Client *c);
static void setfullscreen(Client *c, int fullscreen);
static void setlayout(const Arg *arg);
static void setmfact(const Arg *arg);
+static void setnumdesktops(void);
static void setup(void);
+static void setviewport(void);
static void seturgent(Client *c, int urg);
static void showhide(Client *c);
static void sigchld(int unused);
@@ -251,6 +256,7 @@ static void toggleview(const Arg *arg);
static void unfocus(Client *c, int setfocus);
static void unmanage(Client *c, int destroyed);
static void unmapnotify(XEvent *e);
+static void updatecurrentdesktop(void);
static void updatebarpos(Monitor *m);
static void updatebars(void);
static void updateclientlist(void);
@@ -1652,6 +1658,16 @@ setclientstate(Client *c, long state)
XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32,
PropModeReplace, (unsigned char *)data, 2);
}
+void
+setcurrentdesktop(void){
+ long data[] = { 0 };
+ XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1);
+}
+void setdesktopnames(void){
+ XTextProperty text;
+ Xutf8TextListToTextProperty(dpy, tags, TAGSLENGTH, XUTF8StringStyle, &text);
+ XSetTextProperty(dpy, root, &text, netatom[NetDesktopNames]);
+}
int
sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, long d4)
@@ -1689,6 +1705,12 @@ sendevent(Window w, Atom proto, int mask
}
void
+setnumdesktops(void){
+ long data[] = { TAGSLENGTH };
+ XChangeProperty(dpy, root, netatom[NetNumberOfDesktops], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1);
+}
+
+void
setfocus(Client *c)
{
if (!c->neverfocus) {
@@ -1797,6 +1819,10 @@ setup(void)
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);
+ netatom[NetDesktopViewport] = XInternAtom(dpy, "_NET_DESKTOP_VIEWPORT", False);
+ netatom[NetNumberOfDesktops] = XInternAtom(dpy, "_NET_NUMBER_OF_DESKTOPS", False);
+ netatom[NetCurrentDesktop] = XInternAtom(dpy, "_NET_CURRENT_DESKTOP", False);
+ netatom[NetDesktopNames] = XInternAtom(dpy, "_NET_DESKTOP_NAMES", False);
xatom[Manager] = XInternAtom(dpy, "MANAGER", False);
xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False);
xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False);
@@ -1824,6 +1850,10 @@ setup(void)
/* EWMH support per view */
XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
PropModeReplace, (unsigned char *) netatom, NetLast);
+ setnumdesktops();
+ setcurrentdesktop();
+ setdesktopnames();
+ setviewport();
XDeleteProperty(dpy, root, netatom[NetClientList]);
/* select events */
wa.cursor = cursor[CurNormal]->cursor;
@@ -1835,6 +1865,11 @@ setup(void)
grabkeys();
focus(NULL);
}
+void
+setviewport(void){
+ long data[] = { 0, 0 };
+ XChangeProperty(dpy, root, netatom[NetDesktopViewport], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 2);
+}
void
@@ -1983,6 +2018,7 @@ toggletag(const Arg *arg)
focus(NULL);
arrange(selmon);
}
+ updatecurrentdesktop();
}
void
@@ -1994,6 +2030,7 @@ toggleview(const Arg *arg)
selmon->tagset[selmon->seltags] = newtagset;
focus(NULL);
arrange(selmon);
+ updatecurrentdesktop();
}
}
@@ -2109,6 +2146,15 @@ updateclientlist()
XA_WINDOW, 32, PropModeAppend,
(unsigned char *) &(c->win), 1);
}
+void updatecurrentdesktop(void){
+ long rawdata[] = { selmon->tagset[selmon->seltags] };
+ int i=0;
+ while(*rawdata >> i+1){
+ i++;
+ }
+ long data[] = { i };
+ XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1);
+}
int
updategeom(void)
@@ -2421,6 +2467,7 @@ view(const Arg *arg)
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
focus(NULL);
arrange(selmon);
+ updatecurrentdesktop();
}
Client *

View file

@ -1,73 +0,0 @@
diff -up a/dwm.c b/dwm.c
--- a/dwm.c
+++ b/dwm.c
@@ -822,10 +822,10 @@ dirtomon(int dir)
void
drawbar(Monitor *m)
{
- int x, w, sw = 0, stw = 0;
+ int x, w, sw = 0, stw = 0, tw, mw, ew = 0;
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
- unsigned int i, occ = 0, urg = 0;
+ unsigned int i, occ = 0, urg = 0, n = 0;
char *ts = stext;
char *tp = stext;
int tx = 0;
@@ -854,6 +854,8 @@ drawbar(Monitor *m)
resizebarwin(m);
for (c = m->clients; c; c = c->next) {
+ if (ISVISIBLE(c))
+ n++;
occ |= c->tags == 255 ? 0 : c->tags;
if (c->isurgent)
urg |= c->tags;
@@ -872,15 +874,39 @@ drawbar(Monitor *m)
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
if ((w = m->ww - sw - 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);
- if (m->sel->isfloating)
- drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
- } else {
- drw_setscheme(drw, scheme[SchemeNorm]);
- drw_rect(drw, x, 0, w, bh, 1, 1);
+ if (n > 0) {
+ tw = TEXTW(m->sel->name) + lrpad;
+ mw = (tw >= w || n == 1) ? 0 : (w - tw) / (n - 1);
+
+ i = 0;
+ for (c = m->clients; c; c = c->next) {
+ if (!ISVISIBLE(c) || c == m->sel)
+ continue;
+ tw = TEXTW(c->name);
+ if(tw < mw)
+ ew += (mw - tw);
+ else
+ i++;
+ }
+ if (i > 0)
+ mw += ew / i;
+
+ for (c = m->clients; c; c = c->next) {
+ if (!ISVISIBLE(c))
+ continue;
+ tw = MIN(m->sel == c ? w : mw, TEXTW(c->name));
+
+ drw_setscheme(drw, scheme[m->sel == c ? SchemeSel : SchemeNorm]);
+ if (tw > 0) /* trap special handling of 0 in drw_text */
+ drw_text(drw, x, 0, tw, bh, lrpad / 2, c->name, 0);
+ if (c->isfloating)
+ drw_rect(drw, x + boxs, boxs, boxw, boxw, c->isfixed, 0);
+ x += tw;
+ w -= tw;
+ }
}
+ drw_setscheme(drw, scheme[SchemeNorm]);
+ drw_rect(drw, x, 0, w, bh, 1, 1);
}
drw_map(drw, m->barwin, 0, 0, m->ww - stw, bh);
}

View file

@ -1,19 +1,7 @@
From b04bb473cf9818277d33a591f7fe2dfae96afaaf Mon Sep 17 00:00:00 2001
From: Joshua Haase <hahj87@gmail.com>
Date: Mon, 15 Aug 2016 17:06:18 -0500
Subject: [PATCH] Apply modified gridmode patch.
---
config.def.h | 3 +++
layouts.c | 27 +++++++++++++++++++++++++++
2 files changed, 30 insertions(+)
create mode 100644 layouts.c
diff --git a/config.def.h b/config.def.h
index a9ac303..30b7c4a 100644
--- a/config.def.h
+++ b/config.def.h
@@ -36,11 +36,13 @@ static const float mfact = 0.55; /* factor of master area size [0.05..0.95]
diff -up -N a/config.def.h b/config.def.h
--- a/config.def.h 2020-12-01 10:10:57.007393876 +0100
+++ b/config.def.h 2020-12-01 10:13:17.190767226 +0100
@@ -40,11 +40,13 @@ static const float mfact = 0.55; /*
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
@ -24,22 +12,25 @@ index a9ac303..30b7c4a 100644
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
+ { "HHH", grid },
{ NULL, NULL },
};
/* key definitions */
@@ -76,6 +78,7 @@ static Key keys[] = {
@@ -81,6 +83,7 @@ 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, XK_g, setlayout, {.v = &layouts[3]} },
{ 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/layouts.c b/layouts.c
new file mode 100644
index 0000000..d26acf3
--- /dev/null
+++ b/layouts.c
@@ -119,4 +122,3 @@ static Button buttons[] = {
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};
-
diff -up -N a/layouts.c b/layouts.c
--- a/layouts.c 1970-01-01 01:00:00.000000000 +0100
+++ b/layouts.c 2020-12-01 10:14:11.740781107 +0100
@@ -0,0 +1,27 @@
+void
+grid(Monitor *m) {
@ -68,6 +59,3 @@ index 0000000..d26acf3
+ i++;
+ }
+}
--
2.14.1

View file

@ -1,23 +1,16 @@
# HG changeset patch
# User Barbu Paul - Gheorghe <barbu.paul.gheorghe@gmail.com>
# Date 1354650884 -7200
# Node ID 6c472a21a5887c5295a331c48c4da188ec2c8413
# Parent aaab44133a6830c9a00263731d098c01cc1d6fb5
selfrestart now magically locates the current dwm (no need to hardcode a path)
diff -r aaab44133a68 -r 6c472a21a588 config.def.h
--- a/config.def.h Tue Dec 04 21:54:44 2012 +0200
+++ b/config.def.h Tue Dec 04 21:54:44 2012 +0200
@@ -54,6 +54,8 @@
static const char *termcmd[] = { "urxvtc", NULL };
static const char *filemancmd[] = { "thunar", NULL };
diff -up -N a/config.def.h b/config.def.h
--- a/config.def.h 2020-12-01 10:21:09.920859006 +0100
+++ b/config.def.h 2020-12-01 10:22:27.167535028 +0100
@@ -66,6 +66,8 @@ static char dmenumon[2] = "0"; /* compon
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 };
+#include "selfrestart.c"
+
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_r, spawn, {.v = dmenucmd } },
@@ -89,6 +91,7 @@
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
@@ -103,6 +105,7 @@ static Key keys[] = {
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
@ -25,14 +18,9 @@ diff -r aaab44133a68 -r 6c472a21a588 config.def.h
{ MODKEY|ShiftMask, XK_q, quit, {0} },
};
@@ -108,4 +111,3 @@
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};
-
diff -r aaab44133a68 -r 6c472a21a588 selfrestart.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/selfrestart.c Tue Dec 04 21:54:44 2012 +0200
diff -up -N a/selfrestart.c b/selfrestart.c
--- a/selfrestart.c 1970-01-01 01:00:00.000000000 +0100
+++ b/selfrestart.c 2020-12-01 10:24:06.714211651 +0100
@@ -0,0 +1,65 @@
+#include <unistd.h>
+#include <sys/types.h>

View file

@ -1,27 +1,7 @@
diff -up a/config.def.h b/config.def.h
--- a/config.def.h
+++ b/config.def.h
@@ -72,6 +72,8 @@ 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 scratchpadname[] = "scratchpad";
+static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL };
#include "selfrestart.c"
@@ -79,6 +81,7 @@ static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
+ { MODKEY, XK_grave, togglescratch, {.v = scratchpadcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
diff -up a/dwm.c b/dwm.c
--- a/dwm.c
+++ b/dwm.c
@@ -246,6 +246,7 @@ static void tagmon(const Arg *arg);
--- a/dwm.c 2019-06-06 21:23:27.023328450 +0200
+++ b/dwm.c 2019-06-20 15:07:01.089767947 +0200
@@ -213,6 +213,7 @@ static void tagmon(const Arg *arg);
static void tile(Monitor *);
static void togglebar(const Arg *arg);
static void togglefloating(const Arg *arg);
@ -29,7 +9,7 @@ diff -up a/dwm.c b/dwm.c
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unfocus(Client *c, int setfocus);
@@ -312,6 +313,8 @@ static Window root, wmcheckwin;
@@ -273,6 +274,8 @@ static Window root, wmcheckwin;
/* configuration, allows nested code to access above variables */
#include "config.h"
@ -38,10 +18,11 @@ diff -up a/dwm.c b/dwm.c
/* compile-time check if all tags fit into an unsigned int bit array. */
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
@@ -1238,6 +1241,13 @@ manage(Window w, XWindowAttributes *wa)
@@ -1052,6 +1055,14 @@ manage(Window w, XWindowAttributes *wa)
&& (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
c->bw = borderpx;
+ selmon->tagset[selmon->seltags] &= ~scratchtag;
+ if (!strcmp(c->name, scratchpadname)) {
+ c->mon->tagset[c->mon->seltags] |= c->tags = scratchtag;
+ c->isfloating = True;
@ -52,7 +33,15 @@ diff -up a/dwm.c b/dwm.c
wc.border_width = c->bw;
XConfigureWindow(dpy, w, CWBorderWidth, &wc);
XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel);
@@ -2013,6 +2023,28 @@ togglefloating(const Arg *arg)
@@ -1661,6 +1672,7 @@ spawn(const Arg *arg)
{
if (arg->v == dmenucmd)
dmenumon[0] = '0' + selmon->num;
+ selmon->tagset[selmon->seltags] &= ~scratchtag;
if (fork() == 0) {
if (dpy)
close(ConnectionNumber(dpy));
@@ -1748,6 +1760,28 @@ togglefloating(const Arg *arg)
}
void

View file

@ -1,83 +0,0 @@
From 35418d156fccb922710f6ca80a1f3972ba88b42f Mon Sep 17 00:00:00 2001
From: Danny O'Brien <danny@spesh.com>
Date: Mon, 8 Oct 2018 19:21:29 -0700
Subject: [PATCH] Add colors to status message in bar.
This patch matches the format used by
https://dwm.suckless.org/patches/statuscolors/ -- An \x01 character
switches to the normal foreground/color combo, \x02 switches to the
color combo used for selected tags, \03 is set by default to black on
yellow, \04 is white on red.
These color settings are defined in the colors array in config.def.h.
More can be added, but don't have more than 32, or you'll start hitting
real ASCII.
This applies cleanly on mainline dwm from commit 022d076 (Sat Jan 7
17:21:29 2017 +0100) until at least b69c870 (Sat Jun 2 17:15:42 2018
+020).
---
diff --git a/config.def.h b/config.def.h
@@ -16,10 +16,17 @@ static const char col_gray2[] = "#
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
+static const char col_black[] = "#000000";
+static const char col_red[] = "#ff0000";
+static const char col_yellow[] = "#ffff00";
+static const char col_white[] = "#ffffff";
+
static const char *colors[][3] = {
- /* fg bg border */
- [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
- [SchemeSel] = { col_gray4, col_cyan, col_cyan },
+ /* fg bg border */
+ [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
+ [SchemeSel] = { col_gray4, col_cyan, col_cyan },
+ [SchemeWarn] = { col_black, col_yellow, col_red },
+ [SchemeUrgent]= { col_white, col_red, col_red },
};
/* tagging */
diff --git a/dwm.c b/dwm.c
@@ -76,7 +76,7 @@
/* enums */
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
-enum { SchemeNorm, SchemeSel }; /* color schemes */
+enum { SchemeNorm, SchemeSel, SchemeWarn, SchemeUrgent }; /* color schemes */
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz,
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
@@ -826,6 +826,10 @@ drawbar(Monitor *m)
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
unsigned int i, occ = 0, urg = 0;
+ char *ts = stext;
+ char *tp = stext;
+ int tx = 0;
+ char ctmp;
Client *c;
if(showsystray && m == systraytomon(m))
@@ -835,7 +839,17 @@ drawbar(Monitor *m)
if (m == selmon) { /* status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]);
sw = TEXTW(stext) - lrpad / 2 + 2; /* 2px right padding */
- drw_text(drw, m->ww - sw - stw, 0, sw, bh, lrpad / 2 - 2, stext, 0);
+ while (1) {
+ if ((unsigned int)*ts > LENGTH(colors)) { ts++; continue ; }
+ ctmp = *ts;
+ *ts = '\0';
+ drw_text(drw, m->ww - sw + tx, 0, sw - tx, bh, 0, tp, 0);
+ tx += TEXTW(tp) -lrpad;
+ if (ctmp == '\0') { break; }
+ drw_setscheme(drw, scheme[(unsigned int)(ctmp-1)]);
+ *ts = ctmp;
+ tp = ++ts;
+ }
}
resizebarwin(m);