t* dwm + patches URI git clone git://git.codevoid.de/dwm-sdk DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit 3ff447e3f9a6832071cc6fda363932ed203a76a5 DIR parent f436e545cf64dc3001d54524862d95b5445ea310 URI Author: Stefan Hagen <sh+git[at]codevoid[dot]de> Date: Wed, 14 Nov 2018 18:15:09 +0100 Downgrade to DWM 6.0 Diffstat: M LICENSE | 17 ++++++----------- M Makefile | 4 ++-- M README | 3 +++ M config.def.h | 62 ++++++++++--------------------- M config.h | 230 ++++++++++++------------------- M config.mk | 25 ++++++++++--------------- D drw.c | 421 ------------------------------- D drw.h | 57 ------------------------------- M dwm.1 | 31 +++++++++++++++---------------- M dwm.c | 2183 ++++++++++++++----------------- D dwm.png | 0 D layouts.c | 57 ------------------------------- A maximize.c | 45 +++++++++++++++++++++++++++++++ D patches/dwm-bottomstack-6.1.diff | 101 ------------------------------- D patches/dwm-r1615-selfrestart.diff | 101 ------------------------------- D patches/dwm-scratchpad-20170207-bb… | 83 ------------------------------- D patches/dwm-systray-20180314-3bd84… | 716 ------------------------------- M scripts/browser | 13 ++++--------- D scripts/browserpaste | 2 -- D scripts/mixer | 2 -- M scripts/sshot | 24 ++++++++++++++---------- D transient.c | 42 ------------------------------- D util.c | 35 ------------------------------- D util.h | 8 -------- 24 files changed, 1173 insertions(+), 3089 deletions(-) --- DIR diff --git a/LICENSE b/LICENSE t@@ -1,22 +1,17 @@ MIT/X Consortium License -© 2006-2017 Anselm R Garbe <anselm@garbe.us> -© 2006-2009 Jukka Salmi <jukka at salmi dot ch> -© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com> +© 2006-2011 Anselm R Garbe <anselm@garbe.us> © 2007-2011 Peter Hartlich <sgkkr at hartlich dot com> +© 2010-2011 Connor Lane Smith <cls@lubutu.com> +© 2006-2009 Jukka Salmi <jukka at salmi dot ch> +© 2007-2009 Premysl Hruby <dfenze at gmail 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> +© 2009 Mate Nagy <mnagy at port70 dot net> © 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> +© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), DIR diff --git a/Makefile b/Makefile t@@ -3,7 +3,7 @@ include config.mk -SRC = drw.c dwm.c util.c +SRC = dwm.c OBJ = ${SRC:.c=.o} all: options dwm t@@ -36,7 +36,7 @@ dist: clean @echo creating dist tarball @mkdir -p dwm-${VERSION} @cp -R LICENSE Makefile README config.def.h config.mk \ - dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION} + dwm.1 ${SRC} dwm-${VERSION} @tar -cf dwm-${VERSION}.tar dwm-${VERSION} @gzip dwm-${VERSION}.tar @rm -rf dwm-${VERSION} DIR diff --git a/README b/README t@@ -18,6 +18,9 @@ necessary as root): make clean install +If you are going to use the default bluegray color scheme it is highly +recommended to also install the bluegray files shipped in the dextra package. + Running dwm ----------- DIR diff --git a/config.def.h b/config.def.h t@@ -1,53 +1,39 @@ /* See LICENSE file for copyright and license details. */ /* appearance */ +static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*"; +static const char normbordercolor[] = "#444444"; +static const char normbgcolor[] = "#222222"; +static const char normfgcolor[] = "#bbbbbb"; +static const char selbordercolor[] = "#005577"; +static const char selbgcolor[] = "#005577"; +static const char selfgcolor[] = "#eeeeee"; static const unsigned int borderpx = 1; /* border pixel of windows */ +static const unsigned int gappx = 18; /* gap pixel between 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 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"; -static const char col_gray2[] = "#444444"; -static const char col_gray3[] = "#bbbbbb"; -static const char col_gray4[] = "#eeeeee"; -static const char col_cyan[] = "#005577"; -static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, -}; +static const Bool showbar = True; /* False means no bar */ +static const Bool topbar = True; /* False means bottom bar */ +static const Bool extrabar = True; /* False means no extra bar */ /* tagging */ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, 1, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, + { "Gimp", NULL, NULL, 0, True, -1 }, + { "Firefox", NULL, NULL, 1 << 8, False, -1 }, }; /* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ +static const 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 Bool resizehints = True; /* True means respect size hints in tiled resizals */ static const Layout layouts[] = { /* symbol arrange function */ { "[]=", tile }, /* first entry is default */ { "><>", NULL }, /* no layout function means floating behavior */ { "[M]", monocle }, - { "TTT", bstack }, - { "===", bstackhoriz }, - { "H[]", deck }, }; /* key definitions */ t@@ -62,20 +48,15 @@ static const Layout layouts[] = { #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } /* commands */ -static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; -static const char *termcmd[] = { "st", NULL }; -static const char scratchpadname[] = "scratchpad"; -static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL }; - -#include "selfrestart.c" +static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; +static const char *termcmd[] = { "uxterm", NULL }; 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_b, toggleextrabar, {0} }, { MODKEY, XK_j, focusstack, {.i = +1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } }, { MODKEY, XK_i, incnmaster, {.i = +1 } }, t@@ -88,9 +69,6 @@ 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_u, setlayout, {.v = &layouts[3]} }, - { MODKEY, XK_o, setlayout, {.v = &layouts[4]} }, - { MODKEY, XK_c, setlayout, {.v = &layouts[5]} }, { MODKEY, XK_space, setlayout, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { MODKEY, XK_0, view, {.ui = ~0 } }, t@@ -108,7 +86,6 @@ 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_q, quit, {0} }, }; t@@ -128,3 +105,4 @@ static Button buttons[] = { { ClkTagBar, MODKEY, Button1, tag, {0} }, { ClkTagBar, MODKEY, Button3, toggletag, {0} }, }; + DIR diff --git a/config.h b/config.h t@@ -1,18 +1,20 @@ /* See LICENSE file for copyright and license details. */ /* appearance */ -static const unsigned int borderpx = 1; /* border pixel of windows */ -static const unsigned int snap = 8; /* snap pixel */ -static const unsigned int systraypinning = 0; /* 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 font_normal[] = "-misc-tamzenforpowerline-medium-r-normal--20-145-100-100-c-100-iso8859-1"; -static const char *fonts[] = { font_normal }; +//static const char font[] = "-misc-tamzenforpowerline-medium-r-normal--20-145-100-100-c-100-iso8859-1"; +static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*"; +static const char normbordercolor[] = "#333333"; +static const char normbgcolor[] = "#181818"; +static const char normfgcolor[] = "#999999"; +static const char selbordercolor[] = "#FF0000"; // window border color +static const char selbgcolor[] = "#181818"; // top bar background +static const char selfgcolor[] = "#eeeeee"; // top bar selected +static const unsigned int borderpx = 1; /* border pixel of windows */ +static const unsigned int gappx = 8; /* gap pixel between windows */ +static const unsigned int snap = 8; /* snap pixel */ +static const Bool showbar = True; /* False means no bar */ +static const Bool topbar = True; /* False means bottom bar */ +static const Bool extrabar = True; /* False means no extra bar */ static const char col_vdark[] = "#111111"; static const char col_dark[] = "#333333"; t@@ -25,165 +27,111 @@ static const char col_gray3[] = "#bbbbbb"; static const char col_gray4[] = "#eeeeee"; static const char col_cyan[] = "#005577"; -static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_norm, col_vdark, col_dark }, - [SchemeSel] = { col_full, col_vdark, col_norm }, -}; - -#define DMENUOPTS "-m", dmenumon, "-fn", font_normal, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4 - - /* tagging */ -static const char *tags[] = { "Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ", "Ⅵ", "Ⅶ", "Ⅷ", "Ⅸ" }; -//static const char *tags[] = { "One", "Two", "Three", "Four", "Five" }; +static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ - /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, 1, -1 }, - { "Pidgin", NULL, NULL, 0, 1, -1 }, - { "Steam", NULL, NULL, 0, 1, -1 }, - { "Wine", NULL, NULL, 0, 1, -1 }, - { "wine.exe", NULL, NULL, 0, 1, -1 }, + /* class instance title tags mask isfloating monitor */ + { "Gimp", NULL, NULL, 0, True, -1 }, + { "Firefox", NULL, NULL, 1 << 8, False, -1 }, }; +#define DMENUOPTS "-fn", "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*" , "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4 + /* layout(s) */ -static const float mfact = 0.50; /* 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 resizehints = 0; /* 1 means respect size hints in tiled resizals */ +static const Bool resizehints = False; /* True means respect size hints in tiled resizals */ -#include "layouts.c" static const Layout layouts[] = { - /* symbol arrange function */ - //{ "🇸", bstack }, - //{ "H[]", deck }, - { "HHH", grid }, - { "🇲", monocle }, + /* symbol arrange function */ + { "TILE", tile }, /* first entry is default */ + //{ "NULL", NULL }, /* no layout function means floating behavior */ + //{ "MONO", monocle }, }; /* key definitions */ #define MODKEY Mod1Mask #define TAGKEYS(KEY,TAG) \ -{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \ -{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ -{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ -{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ + { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, /* helper for spawning shell commands in the pre dwm-5.0 fashion */ #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } /* commands */ -static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char scratchpadname[] = "scratchpad"; - -static const char *termcmd[] = { "st", "-f", font_normal, "-e", "mksh", NULL }; -static const char *mailcmd[] = { "st", "-f", font_normal, "-e", "mutt", NULL }; +static const char *dmenucmd[] = { "dmenu_run", DMENUOPTS, NULL }; +static const char *termcmd[] = { "st", "-e", "mksh", NULL }; +static const char *notescmd[] = { "st", "-e", "vim", "Seafile/NotesSync/notes.otl", NULL }; +static const char *browsercmd[] = { ".dwm/browser", DMENUOPTS, NULL }; +static const char *passmenucmd[] = { ".dwm/passmenu", DMENUOPTS, NULL }; +static const char *sshot[] = { ".dwm/sshot", NULL }; + +#include "maximize.c" +static Key keys[] = { + /* modifier key function argument */ -static const char *notescmd[] = { "st", "-f", font_normal, "-e", "vim", "Seafile/NotesSync/notes.otl", NULL }; -static const char *scratchpadcmd[] = { "st", "-f", font_normal, "-e", "mksh", "-t", scratchpadname, "-g", "100x25", NULL }; -static const char *dmenucmd[] = { "dmenu_run", DMENUOPTS, NULL }; -static const char *browsercmd[] = { ".dwm/browser", DMENUOPTS, NULL }; -static const char *passmenucmd[] = { ".dwm/passmenu", DMENUOPTS, NULL }; -static const char *sshot[] = { ".dwm/sshot", NULL }; + { MODKEY, XK_d, spawn, {.v = dmenucmd } }, + { MODKEY, XK_Return, spawn, {.v = termcmd } }, -static Key keys[] = { - /* modifier key function argument */ - // application launcher - { MODKEY, XK_d, spawn, {.v = dmenucmd } }, - { MODKEY, XK_Return, spawn, {.v = termcmd } }, { MODKEY|ShiftMask, XK_f, spawn, {.v = browsercmd } }, { MODKEY|ShiftMask, XK_p, spawn, {.v = passmenucmd } }, - { MODKEY|ShiftMask, XK_m, spawn, {.v = mailcmd } }, - { MODKEY, XK_minus, togglescratch, {.v = scratchpadcmd } }, { MODKEY, XK_Print, spawn, {.v = sshot } }, { MODKEY|ShiftMask, XK_o, spawn, {.v = notescmd } }, - // show/hide statusbar - { MODKEY, XK_b, togglebar, {0} }, - - // cycle frame focus - { MODKEY, XK_Down, focusstack, {.i = +1 } }, - { MODKEY, XK_Up, focusstack, {.i = -1 } }, - - // increase frames in master area - { MODKEY|ShiftMask, XK_Left, incnmaster, {.i = +1 } }, - { MODKEY|ShiftMask, XK_Right, incnmaster, {.i = -1 } }, - - // change frame size - { MODKEY, XK_Left, setmfact, {.f = -0.05} }, - { MODKEY, XK_Right, setmfact, {.f = +0.05} }, - - // bring focused frame to master area - { MODKEY, XK_m, zoom, {0} }, - - // switch to last workspace - { MODKEY, XK_Tab, view, {0} }, - - // destroy focused frame - { MODKEY|ShiftMask, XK_q, killclient, {0} }, - - // toggle last layout - { MODKEY, XK_f, setlayout, {0} }, - - // set frame to floating - { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, - - // show all frames from all workspaces - { MODKEY, XK_0, view, {.ui = ~0 } }, - - // move window to all screens - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, - - // switch focus to monitor - { MODKEY, XK_comma, focusmon, {.i = -1 } }, - { MODKEY, XK_period, focusmon, {.i = +1 } }, - - // swich frame to monitor - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, - - { MODKEY|ShiftMask, XK_End, quit, {0} }, - - // /* Media keys */ - // { 0, XF86XK_AudioRaiseVolume, spawn, {.v = volumeupcmd } }, - // { 0, XF86XK_AudioLowerVolume, spawn, {.v = volumedowncmd } }, - // { 0, XF86XK_AudioMute, spawn, {.v = volmute } }, - // { 0, XF86XK_AudioPlay, spawn, {.v = audioplay } }, - // { 0, XF86XK_AudioPrev, spawn, {.v = audioback } }, - // { 0, XF86XK_AudioNext, spawn, {.v = audionext } }, - // { 0, XF86XK_MonBrightnessUp, spawn, {.v = backlightup } }, - // { 0, XF86XK_MonBrightnessDown, spawn, {.v = backlightdown } }, - - // workspace keys - 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, XK_b, togglebar, {0} }, + { MODKEY, XK_b, toggleextrabar, {0} }, + + { MODKEY, XK_Down, focusstack, {.i = +1 } }, + { MODKEY, XK_Up, focusstack, {.i = -1 } }, + { MODKEY|ShiftMask, XK_Left, incnmaster, {.i = +1 } }, + { MODKEY|ShiftMask, XK_Right, incnmaster, {.i = -1 } }, + + { MODKEY, XK_m, zoom, {0} }, + { MODKEY, XK_h, setmfact, {.f = -0.05} }, + { MODKEY, XK_l, setmfact, {.f = +0.05} }, + { MODKEY, XK_Tab, view, {0} }, + { MODKEY|ShiftMask, XK_q, killclient, {0} }, + { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, + { MODKEY, XK_space, setlayout, {.v = &layouts[1]} }, + //{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, + { MODKEY, XK_f, togglemaximize, {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 } }, + 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_End, quit, {0} }, }; /* button definitions */ /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ static Button buttons[] = { - /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, + /* click event mask button function argument */ + { ClkLtSymbol, 0, Button1, setlayout, {0} }, + { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, + { ClkWinTitle, 0, Button2, zoom, {0} }, + { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, + { ClkClientWin, MODKEY, Button1, movemouse, {0} }, + { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, + { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, + { ClkTagBar, 0, Button1, view, {0} }, + { ClkTagBar, 0, Button3, toggleview, {0} }, + { ClkTagBar, MODKEY, Button1, tag, {0} }, + { ClkTagBar, MODKEY, Button3, toggletag, {0} }, }; + DIR diff --git a/config.mk b/config.mk t@@ -1,5 +1,5 @@ # dwm version -VERSION = 6.1 +VERSION = 6.0 # Customize below to fit your system t@@ -10,25 +10,20 @@ MANPREFIX = ${PREFIX}/share/man X11INC = /usr/X11R6/include X11LIB = /usr/X11R6/lib -# Xinerama, comment if you don't want it -XINERAMALIBS = -lXinerama +# Xinerama +XINERAMALIBS = -L${X11LIB} -lXinerama XINERAMAFLAGS = -DXINERAMA -# freetype -FREETYPELIBS = -lfontconfig -lXft -FREETYPEINC = /usr/include/freetype2 -# OpenBSD (uncomment) -# FREETYPEINC = ${X11INC}/freetype2 - # includes and libs -INCS = -I${X11INC} -I${FREETYPEINC} -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} +INCS = -I. -I/usr/include -I${X11INC} +LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${XINERAMALIBS} # flags -CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} -#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} -LDFLAGS = -s ${LIBS} +CPPFLAGS = -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} +#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} +CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} +#LDFLAGS = -g ${LIBS} +LDFLAGS = -s ${LIBS} # Solaris #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" DIR diff --git a/drw.c b/drw.c t@@ -1,421 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <X11/Xlib.h> -#include <X11/Xft/Xft.h> - -#include "drw.h" -#include "util.h" - -#define UTF_INVALID 0xFFFD -#define UTF_SIZ 4 - -static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; -static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; -static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; -static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; - -static long -utf8decodebyte(const char c, size_t *i) -{ - for (*i = 0; *i < (UTF_SIZ + 1); ++(*i)) - if (((unsigned char)c & utfmask[*i]) == utfbyte[*i]) - return (unsigned char)c & ~utfmask[*i]; - return 0; -} - -static size_t -utf8validate(long *u, size_t i) -{ - if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) - *u = UTF_INVALID; - for (i = 1; *u > utfmax[i]; ++i) - ; - return i; -} - -static size_t -utf8decode(const char *c, long *u, size_t clen) -{ - size_t i, j, len, type; - long udecoded; - - *u = UTF_INVALID; - if (!clen) - return 0; - udecoded = utf8decodebyte(c[0], &len); - if (!BETWEEN(len, 1, UTF_SIZ)) - return 1; - for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { - udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); - if (type) - return j; - } - if (j < len) - return 0; - *u = udecoded; - utf8validate(u, len); - - return len; -} - -Drw * -drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) -{ - Drw *drw = ecalloc(1, sizeof(Drw)); - - drw->dpy = dpy; - drw->screen = screen; - drw->root = root; - drw->w = w; - drw->h = h; - drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen)); - drw->gc = XCreateGC(dpy, root, 0, NULL); - XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); - - return drw; -} - -void -drw_resize(Drw *drw, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - drw->w = w; - drw->h = h; - if (drw->drawable) - XFreePixmap(drw->dpy, drw->drawable); - drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen)); -} - -void -drw_free(Drw *drw) -{ - XFreePixmap(drw->dpy, drw->drawable); - XFreeGC(drw->dpy, drw->gc); - free(drw); -} - -/* This function is an implementation detail. Library users should use - * drw_fontset_create instead. - */ -static Fnt * -xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) -{ - Fnt *font; - XftFont *xfont = NULL; - FcPattern *pattern = NULL; - - if (fontname) { - /* Using the pattern found at font->xfont->pattern does not yield the - * same substitution results as using the pattern returned by - * FcNameParse; using the latter results in the desired fallback -