Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f622d0987 | ||
|
|
9d43e8c856 | ||
|
|
919619109c | ||
|
|
61b5d9251c | ||
|
|
22fb46f457 | ||
|
|
6234484ad8 | ||
|
|
7a5a2fde14 | ||
|
|
85822e7ff4 | ||
|
|
0dc85103d6 | ||
|
|
47c132db4e | ||
|
|
72dbded0e1 | ||
|
|
fa6ff46c1c | ||
|
|
479cf61077 | ||
|
|
1b402fe688 | ||
|
|
66c42c2531 |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
dwm
|
||||||
|
dwm.o
|
||||||
|
*.o
|
||||||
149
config.h
Normal file
149
config.h
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
/* See LICENSE file for copyright and license details. */
|
||||||
|
|
||||||
|
// patch config - uselessgap
|
||||||
|
static const unsigned int gappx = 6; /* gap pixel between windows */
|
||||||
|
|
||||||
|
/* appearance */
|
||||||
|
static const unsigned int borderpx = 1; /* 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 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";
|
||||||
|
/* my colors */
|
||||||
|
static const char col_norm_fg[] = "#bbbbbb";
|
||||||
|
static const char col_norm_bg[] = "#222222";
|
||||||
|
static const char col_sel_fg[] = "#eeeeee";
|
||||||
|
static const char col_sel_bg[] = "#222222";
|
||||||
|
static const char col_norm_bdr[] = "#555555";
|
||||||
|
static const char col_sel_bdr[] = "#444444";
|
||||||
|
/* end my colors */
|
||||||
|
static const char *colors[][3] = {
|
||||||
|
/* fg bg border */
|
||||||
|
//[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||||
|
//[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||||
|
[SchemeNorm] = { col_norm_fg, col_norm_bg, col_norm_bdr },
|
||||||
|
[SchemeSel] = { col_sel_fg, col_sel_bg, col_sel_bdr },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 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, 2, 0, -1 },
|
||||||
|
{ "URxvt", "cal", NULL, 0, 1, -1 },
|
||||||
|
{ "urxvt-f", NULL, NULL, 0, 1, -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 = 0; /* 1 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 },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* key definitions */
|
||||||
|
#define MODKEY Mod4Mask
|
||||||
|
#define TAGKEYS(KEY,TAG) \
|
||||||
|
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||||
|
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||||
|
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
||||||
|
|
||||||
|
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||||
|
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||||
|
|
||||||
|
/* commands */
|
||||||
|
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||||
|
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_norm_bg, "-nf", col_norm_fg, "-sb", col_sel_bg, "-sf", col_sel_fg, NULL };
|
||||||
|
static const char *termcmd[] = { "urxvt256c", NULL };
|
||||||
|
static const char *floattermcmd[] = { "urxvt256c", "-name", "urxvt-f", NULL };
|
||||||
|
static const char *lockcmd[] = { "slock", NULL };
|
||||||
|
static const char *prtscrcmd[] = { "flameshot", "gui", NULL};
|
||||||
|
static const char *vol_up[] = { "volume_up.sh", NULL};
|
||||||
|
static const char *vol_down[] = { "volume_down.sh", NULL};
|
||||||
|
|
||||||
|
static Key keys[] = {
|
||||||
|
/* modifier key function argument */
|
||||||
|
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||||
|
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||||
|
{ MODKEY|ControlMask, XK_Return, spawn, {.v = floattermcmd } },
|
||||||
|
{ 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, 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_Left, viewtoleft, {0} },
|
||||||
|
{ MODKEY, XK_Right, viewtoright, {0} },
|
||||||
|
{ MODKEY|ShiftMask, XK_Left, tagtoleft, {0} },
|
||||||
|
{ MODKEY|ShiftMask, XK_Right, tagtoright, {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} },
|
||||||
|
{ MODKEY|ControlMask, XK_q, quit, {0} },
|
||||||
|
{ 0, XK_Print, spawn, {.v = prtscrcmd } },
|
||||||
|
{ MODKEY, XK_F11, spawn, {.v = vol_down } },
|
||||||
|
{ MODKEY, XK_F12, spawn, {.v = vol_up } },
|
||||||
|
{ MODKEY|ControlMask, XK_l, spawn, {.v = lockcmd } },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* button definitions */
|
||||||
|
/* 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]} },
|
||||||
|
{ 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} },
|
||||||
|
};
|
||||||
|
|
||||||
142
config.h.orig
Normal file
142
config.h.orig
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
/* See LICENSE file for copyright and license details. */
|
||||||
|
|
||||||
|
// patch config - uselessgap
|
||||||
|
static const unsigned int gappx = 6; /* gap pixel between windows */
|
||||||
|
|
||||||
|
/* appearance */
|
||||||
|
static const unsigned int borderpx = 1; /* 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 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";
|
||||||
|
/* my colors */
|
||||||
|
static const char col_norm_fg[] = "#bbbbbb";
|
||||||
|
static const char col_norm_bg[] = "#222222";
|
||||||
|
static const char col_sel_fg[] = "#eeeeee";
|
||||||
|
static const char col_sel_bg[] = "#222222";
|
||||||
|
static const char col_norm_bdr[] = "#555555";
|
||||||
|
static const char col_sel_bdr[] = "#444444";
|
||||||
|
/* end my colors */
|
||||||
|
static const char *colors[][3] = {
|
||||||
|
/* fg bg border */
|
||||||
|
//[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||||
|
//[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||||
|
[SchemeNorm] = { col_norm_fg, col_norm_bg, col_norm_bdr },
|
||||||
|
[SchemeSel] = { col_sel_fg, col_sel_bg, col_sel_bdr },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 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, 2, 0, -1 },
|
||||||
|
{ "URxvt", "cal", NULL, 0, 1, -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 = 0; /* 1 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 },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* key definitions */
|
||||||
|
#define MODKEY Mod4Mask
|
||||||
|
#define TAGKEYS(KEY,TAG) \
|
||||||
|
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||||
|
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||||
|
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
||||||
|
|
||||||
|
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||||
|
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||||
|
|
||||||
|
/* commands */
|
||||||
|
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||||
|
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_norm_bg, "-nf", col_norm_fg, "-sb", col_sel_bg, "-sf", col_sel_fg, NULL };
|
||||||
|
static const char *termcmd[] = { "urxvt256c", NULL };
|
||||||
|
static const char *lockcmd[] = { "slock", NULL };
|
||||||
|
static const char *prtscrcmd[] = { "flameshot", "gui", NULL};
|
||||||
|
static const char *vol_up[] = { "volume_up.sh", NULL};
|
||||||
|
static const char *vol_down[] = { "volume_down.sh", NULL};
|
||||||
|
|
||||||
|
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, 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 } },
|
||||||
|
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} },
|
||||||
|
{ MODKEY|ControlMask, XK_q, quit, {0} },
|
||||||
|
{ 0, XK_Print, spawn, {.v = prtscrcmd } },
|
||||||
|
{ MODKEY, XK_F11, spawn, {.v = vol_down } },
|
||||||
|
{ MODKEY, XK_F12, spawn, {.v = vol_up } },
|
||||||
|
{ MODKEY|ControlMask, XK_l, spawn, {.v = lockcmd } },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* button definitions */
|
||||||
|
/* 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]} },
|
||||||
|
{ 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} },
|
||||||
|
};
|
||||||
|
|
||||||
12
dwm.1
12
dwm.1
@@ -77,6 +77,18 @@ Send focused window to previous screen, if any.
|
|||||||
.B Mod1\-Shift\-.
|
.B Mod1\-Shift\-.
|
||||||
Send focused window to next screen, if any.
|
Send focused window to next screen, if any.
|
||||||
.TP
|
.TP
|
||||||
|
.B Mod1\-Right
|
||||||
|
Focus tag on the right, if any.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Left
|
||||||
|
Focus tag on the left, if any.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Shift\-Right
|
||||||
|
Send focused window to tag on the right, if any.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Shift\-Left
|
||||||
|
Send focused window to tag on the left, if any.
|
||||||
|
.TP
|
||||||
.B Mod1\-b
|
.B Mod1\-b
|
||||||
Toggles bar on and off.
|
Toggles bar on and off.
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
176
dwm.1.orig
Normal file
176
dwm.1.orig
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
.TH DWM 1 dwm\-VERSION
|
||||||
|
.SH NAME
|
||||||
|
dwm \- dynamic window manager
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B dwm
|
||||||
|
.RB [ \-v ]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
dwm is a dynamic window manager for X. It manages windows in tiled, monocle
|
||||||
|
and floating layouts. Either layout can be applied dynamically, optimising the
|
||||||
|
environment for the application in use and the task performed.
|
||||||
|
.P
|
||||||
|
In tiled layouts windows are managed in a master and stacking area. The master
|
||||||
|
area on the left contains one window by default, and the stacking area on the
|
||||||
|
right contains all other windows. The number of master area windows can be
|
||||||
|
adjusted from zero to an arbitrary number. In monocle layout all windows are
|
||||||
|
maximised to the screen size. In floating layout windows can be resized and
|
||||||
|
moved freely. Dialog windows are always managed floating, regardless of the
|
||||||
|
layout applied.
|
||||||
|
.P
|
||||||
|
Windows are grouped by tags. Each window can be tagged with one or multiple
|
||||||
|
tags. Selecting certain tags displays all windows with these tags.
|
||||||
|
.P
|
||||||
|
Each screen contains a small status bar which displays all available tags, the
|
||||||
|
layout, the title of the focused window, and the text read from the root window
|
||||||
|
name property, if the screen is focused. A floating window is indicated with an
|
||||||
|
empty square and a maximised floating window is indicated with a filled square
|
||||||
|
before the windows title. The selected tags are indicated with a different
|
||||||
|
color. The tags of the focused window are indicated with a filled square in the
|
||||||
|
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.
|
||||||
|
.SH OPTIONS
|
||||||
|
.TP
|
||||||
|
.B \-v
|
||||||
|
prints version information to standard output, then exits.
|
||||||
|
.SH USAGE
|
||||||
|
.SS Status bar
|
||||||
|
.TP
|
||||||
|
.B X root window name
|
||||||
|
is read and displayed in the status text area. It can be set with the
|
||||||
|
.BR xsetroot (1)
|
||||||
|
command.
|
||||||
|
.TP
|
||||||
|
.B Button1
|
||||||
|
click on a tag label to display all windows with that tag, click on the layout
|
||||||
|
label toggles between tiled and floating layout.
|
||||||
|
.TP
|
||||||
|
.B Button3
|
||||||
|
click on a tag label adds/removes all windows with that tag to/from the view.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Button1
|
||||||
|
click on a tag label applies that tag to the focused window.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Button3
|
||||||
|
click on a tag label adds/removes that tag to/from the focused window.
|
||||||
|
.SS Keyboard commands
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Shift\-Return
|
||||||
|
Start
|
||||||
|
.BR st(1).
|
||||||
|
.TP
|
||||||
|
.B Mod1\-p
|
||||||
|
Spawn
|
||||||
|
.BR dmenu(1)
|
||||||
|
for launching other programs.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-,
|
||||||
|
Focus previous screen, if any.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-.
|
||||||
|
Focus next screen, if any.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Shift\-,
|
||||||
|
Send focused window to previous screen, if any.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Shift\-.
|
||||||
|
Send focused window to next screen, if any.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-b
|
||||||
|
Toggles bar on and off.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-t
|
||||||
|
Sets tiled layout.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-f
|
||||||
|
Sets floating layout.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-m
|
||||||
|
Sets monocle layout.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-space
|
||||||
|
Toggles between current and previous layout.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-j
|
||||||
|
Focus next window.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-k
|
||||||
|
Focus previous window.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-i
|
||||||
|
Increase number of windows in master area.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-d
|
||||||
|
Decrease number of windows in master area.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-l
|
||||||
|
Increase master area size.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-h
|
||||||
|
Decrease master area size.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Return
|
||||||
|
Zooms/cycles focused window to/from master area (tiled layouts only).
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Shift\-c
|
||||||
|
Close focused window.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Shift\-space
|
||||||
|
Toggle focused window between tiled and floating state.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Tab
|
||||||
|
Toggles to the previously selected tags.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Shift\-[1..n]
|
||||||
|
Apply nth tag to focused window.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Shift\-0
|
||||||
|
Apply all tags to focused window.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Control\-Shift\-[1..n]
|
||||||
|
Add/remove nth tag to/from focused window.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-[1..n]
|
||||||
|
View all windows with nth tag.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-0
|
||||||
|
View all windows with any tag.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Control\-[1..n]
|
||||||
|
Add/remove all windows with nth tag to/from the view.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Shift\-q
|
||||||
|
Quit dwm.
|
||||||
|
.SS Mouse commands
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Button1
|
||||||
|
Move focused window while dragging. Tiled windows will be toggled to the floating state.
|
||||||
|
.TP
|
||||||
|
.B Mod1\-Button2
|
||||||
|
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 CUSTOMIZATION
|
||||||
|
dwm is customized by creating a custom config.h and (re)compiling the source
|
||||||
|
code. This keeps it fast, secure and simple.
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR dmenu (1),
|
||||||
|
.BR st (1)
|
||||||
|
.SH ISSUES
|
||||||
|
Java applications which use the XToolkit/XAWT backend may draw grey windows
|
||||||
|
only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early
|
||||||
|
JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds
|
||||||
|
are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the
|
||||||
|
environment variable
|
||||||
|
.BR AWT_TOOLKIT=MToolkit
|
||||||
|
(to use the older Motif backend instead) or running
|
||||||
|
.B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D
|
||||||
|
or
|
||||||
|
.B wmname LG3D
|
||||||
|
(to pretend that a non-reparenting window manager is running that the
|
||||||
|
XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable
|
||||||
|
.BR _JAVA_AWT_WM_NONREPARENTING=1 .
|
||||||
|
.SH BUGS
|
||||||
|
Send all bug reports with a patch to hackers@suckless.org.
|
||||||
48
dwm.c
48
dwm.c
@@ -240,6 +240,8 @@ 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);
|
||||||
static void tagmon(const Arg *arg);
|
static void tagmon(const Arg *arg);
|
||||||
|
static void tagtoleft(const Arg *arg);
|
||||||
|
static void tagtoright(const Arg *arg);
|
||||||
static void tile(Monitor *);
|
static void tile(Monitor *);
|
||||||
static void togglebar(const Arg *arg);
|
static void togglebar(const Arg *arg);
|
||||||
static void togglefloating(const Arg *arg);
|
static void togglefloating(const Arg *arg);
|
||||||
@@ -262,6 +264,8 @@ 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 viewtoleft(const Arg *arg);
|
||||||
|
static void viewtoright(const Arg *arg);
|
||||||
static void warp(const Client *c);
|
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);
|
||||||
@@ -1655,6 +1659,28 @@ setclientstate(Client *c, long state)
|
|||||||
PropModeReplace, (unsigned char *)data, 2);
|
PropModeReplace, (unsigned char *)data, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
tagtoleft(const Arg *arg) {
|
||||||
|
if(selmon->sel != NULL
|
||||||
|
&& __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
||||||
|
&& selmon->tagset[selmon->seltags] > 1) {
|
||||||
|
selmon->sel->tags >>= 1;
|
||||||
|
focus(NULL);
|
||||||
|
arrange(selmon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
tagtoright(const Arg *arg) {
|
||||||
|
if(selmon->sel != NULL
|
||||||
|
&& __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
||||||
|
&& selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
|
||||||
|
selmon->sel->tags <<= 1;
|
||||||
|
focus(NULL);
|
||||||
|
arrange(selmon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, long d4)
|
sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, long d4)
|
||||||
{
|
{
|
||||||
@@ -2496,6 +2522,28 @@ warp(const Client *c)
|
|||||||
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
|
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
viewtoleft(const Arg *arg) {
|
||||||
|
if(__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
||||||
|
&& selmon->tagset[selmon->seltags] > 1) {
|
||||||
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
||||||
|
selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1;
|
||||||
|
focus(NULL);
|
||||||
|
arrange(selmon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
viewtoright(const Arg *arg) {
|
||||||
|
if(__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
||||||
|
&& selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
|
||||||
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
||||||
|
selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1;
|
||||||
|
focus(NULL);
|
||||||
|
arrange(selmon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Client *
|
Client *
|
||||||
wintoclient(Window w)
|
wintoclient(Window w)
|
||||||
{
|
{
|
||||||
|
|||||||
2601
dwm.c.orig
2601
dwm.c.orig
File diff suppressed because it is too large
Load Diff
20
dwm.c.rej
Normal file
20
dwm.c.rej
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
--- dwm.c 2014-06-23 18:04:29.532917821 +0200
|
||||||
|
+++ dwm.c 2014-06-24 08:17:40.921714154 +0200
|
||||||
|
@@ -226,6 +226,8 @@ static void sigchld(int unused);
|
||||||
|
static void spawn(const Arg *arg);
|
||||||
|
static void tag(const Arg *arg);
|
||||||
|
static void tagmon(const Arg *arg);
|
||||||
|
+static void tagtoleft(const Arg *arg);
|
||||||
|
+static void tagtoright(const Arg *arg);
|
||||||
|
static int textnw(const char *text, unsigned int len);
|
||||||
|
static void tile(Monitor *);
|
||||||
|
static void togglebar(const Arg *arg);
|
||||||
|
@@ -245,6 +247,8 @@ static void updatewindowtype(Client *c);
|
||||||
|
static void updatetitle(Client *c);
|
||||||
|
static void updatewmhints(Client *c);
|
||||||
|
static void view(const Arg *arg);
|
||||||
|
+static void viewtoleft(const Arg *arg);
|
||||||
|
+static void viewtoright(const Arg *arg);
|
||||||
|
static Client *wintoclient(Window w);
|
||||||
|
static Monitor *wintomon(Window w);
|
||||||
|
static int xerror(Display *dpy, XErrorEvent *ee);
|
||||||
253
patches/dwm-alpha-6.1.diff
Normal file
253
patches/dwm-alpha-6.1.diff
Normal file
@@ -0,0 +1,253 @@
|
|||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 7054c06..4448d46 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -11,6 +11,8 @@ static const char normfgcolor[] = "#bbbbbb";
|
||||||
|
static const char selbordercolor[] = "#005577";
|
||||||
|
static const char selbgcolor[] = "#005577";
|
||||||
|
static const char selfgcolor[] = "#eeeeee";
|
||||||
|
+static unsigned int baralpha = 0xd0;
|
||||||
|
+static unsigned int borderalpha = OPAQUE;
|
||||||
|
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 */
|
||||||
|
diff --git a/config.mk b/config.mk
|
||||||
|
index 4eefb71..de25d2a 100644
|
||||||
|
--- a/config.mk
|
||||||
|
+++ b/config.mk
|
||||||
|
@@ -22,7 +22,7 @@ FREETYPEINC = /usr/include/freetype2
|
||||||
|
|
||||||
|
# includes and libs
|
||||||
|
INCS = -I${X11INC} -I${FREETYPEINC}
|
||||||
|
-LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
|
||||||
|
+LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lXrender
|
||||||
|
|
||||||
|
# flags
|
||||||
|
CPPFLAGS = -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
|
||||||
|
diff --git a/drw.c b/drw.c
|
||||||
|
index f49200b..12e3ebc 100644
|
||||||
|
--- a/drw.c
|
||||||
|
+++ b/drw.c
|
||||||
|
@@ -61,7 +61,7 @@ utf8decode(const char *c, long *u, size_t clen)
|
||||||
|
}
|
||||||
|
|
||||||
|
Drw *
|
||||||
|
-drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h)
|
||||||
|
+drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap)
|
||||||
|
{
|
||||||
|
Drw *drw;
|
||||||
|
|
||||||
|
@@ -71,8 +71,11 @@ drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h
|
||||||
|
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);
|
||||||
|
+ 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);
|
||||||
|
drw->fontcount = 0;
|
||||||
|
XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
|
||||||
|
|
||||||
|
@@ -86,7 +89,7 @@ drw_resize(Drw *drw, unsigned int w, unsigned int h)
|
||||||
|
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));
|
||||||
|
+ drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
@@ -180,16 +183,15 @@ drw_font_free(Fnt *font)
|
||||||
|
}
|
||||||
|
|
||||||
|
Clr *
|
||||||
|
-drw_clr_create(Drw *drw, const char *clrname)
|
||||||
|
+drw_clr_create(Drw *drw, const char *clrname, unsigned int alpha)
|
||||||
|
{
|
||||||
|
Clr *clr;
|
||||||
|
|
||||||
|
clr = ecalloc(1, sizeof(Clr));
|
||||||
|
- if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
|
||||||
|
- DefaultColormap(drw->dpy, drw->screen),
|
||||||
|
+ if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap,
|
||||||
|
clrname, &clr->rgb))
|
||||||
|
die("error, cannot allocate color '%s'\n", clrname);
|
||||||
|
- clr->pix = clr->rgb.pixel;
|
||||||
|
+ clr->pix = (clr->rgb.pixel & 0x00ffffffU) | (alpha << 24);
|
||||||
|
|
||||||
|
return clr;
|
||||||
|
}
|
||||||
|
@@ -245,9 +247,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *tex
|
||||||
|
XSetForeground(drw->dpy, drw->gc, invert ?
|
||||||
|
drw->scheme->fg->pix : drw->scheme->bg->pix);
|
||||||
|
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
|
||||||
|
- d = XftDrawCreate(drw->dpy, drw->drawable,
|
||||||
|
- DefaultVisual(drw->dpy, drw->screen),
|
||||||
|
- DefaultColormap(drw->dpy, drw->screen));
|
||||||
|
+ d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
curfont = drw->fonts[0];
|
||||||
|
diff --git a/drw.h b/drw.h
|
||||||
|
index e3b8515..1fed824 100644
|
||||||
|
--- a/drw.h
|
||||||
|
+++ b/drw.h
|
||||||
|
@@ -30,6 +30,9 @@ typedef struct {
|
||||||
|
Display *dpy;
|
||||||
|
int screen;
|
||||||
|
Window root;
|
||||||
|
+ Visual *visual;
|
||||||
|
+ unsigned int depth;
|
||||||
|
+ Colormap cmap;
|
||||||
|
Drawable drawable;
|
||||||
|
GC gc;
|
||||||
|
ClrScheme *scheme;
|
||||||
|
@@ -43,7 +46,7 @@ typedef struct {
|
||||||
|
} Extnts;
|
||||||
|
|
||||||
|
/* Drawable abstraction */
|
||||||
|
-Drw *drw_create(Display *, int, Window, unsigned int, unsigned int);
|
||||||
|
+Drw *drw_create(Display *, int, Window, unsigned int, unsigned int, Visual*, unsigned int, Colormap);
|
||||||
|
void drw_resize(Drw *, unsigned int, unsigned int);
|
||||||
|
void drw_free(Drw *);
|
||||||
|
|
||||||
|
@@ -55,7 +58,7 @@ void drw_font_getexts(Fnt *, const char *, unsigned int, Extnts *);
|
||||||
|
unsigned int drw_font_getexts_width(Fnt *, const char *, unsigned int);
|
||||||
|
|
||||||
|
/* Colour abstraction */
|
||||||
|
-Clr *drw_clr_create(Drw *, const char *);
|
||||||
|
+Clr *drw_clr_create(Drw *, const char *, unsigned int);
|
||||||
|
void drw_clr_free(Clr *);
|
||||||
|
|
||||||
|
/* Cursor abstraction */
|
||||||
|
diff --git a/dwm.c b/dwm.c
|
||||||
|
index 0362114..17fe373 100644
|
||||||
|
--- a/dwm.c
|
||||||
|
+++ b/dwm.c
|
||||||
|
@@ -57,6 +57,8 @@
|
||||||
|
#define TAGMASK ((1 << LENGTH(tags)) - 1)
|
||||||
|
#define TEXTW(X) (drw_text(drw, 0, 0, 0, 0, (X), 0) + drw->fonts[0]->h)
|
||||||
|
|
||||||
|
+#define OPAQUE 0xffU
|
||||||
|
+
|
||||||
|
/* enums */
|
||||||
|
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||||
|
enum { SchemeNorm, SchemeSel, SchemeLast }; /* color schemes */
|
||||||
|
@@ -232,6 +234,7 @@ static Monitor *wintomon(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 xinitvisual();
|
||||||
|
static void zoom(const Arg *arg);
|
||||||
|
|
||||||
|
/* variables */
|
||||||
|
@@ -267,6 +270,11 @@ static Drw *drw;
|
||||||
|
static Monitor *mons, *selmon;
|
||||||
|
static Window root;
|
||||||
|
|
||||||
|
+static int useargb = 0;
|
||||||
|
+static Visual *visual;
|
||||||
|
+static int depth;
|
||||||
|
+static Colormap cmap;
|
||||||
|
+
|
||||||
|
/* configuration, allows nested code to access above variables */
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
@@ -1556,7 +1564,8 @@ setup(void)
|
||||||
|
sw = DisplayWidth(dpy, screen);
|
||||||
|
sh = DisplayHeight(dpy, screen);
|
||||||
|
root = RootWindow(dpy, screen);
|
||||||
|
- drw = drw_create(dpy, screen, root, sw, sh);
|
||||||
|
+ xinitvisual();
|
||||||
|
+ drw = drw_create(dpy, screen, root, sw, sh, visual, depth, cmap);
|
||||||
|
drw_load_fonts(drw, fonts, LENGTH(fonts));
|
||||||
|
if (!drw->fontcount)
|
||||||
|
die("no fonts could be loaded.\n");
|
||||||
|
@@ -1580,12 +1589,12 @@ setup(void)
|
||||||
|
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
|
||||||
|
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
|
||||||
|
/* init appearance */
|
||||||
|
- scheme[SchemeNorm].border = drw_clr_create(drw, normbordercolor);
|
||||||
|
- scheme[SchemeNorm].bg = drw_clr_create(drw, normbgcolor);
|
||||||
|
- scheme[SchemeNorm].fg = drw_clr_create(drw, normfgcolor);
|
||||||
|
- scheme[SchemeSel].border = drw_clr_create(drw, selbordercolor);
|
||||||
|
- scheme[SchemeSel].bg = drw_clr_create(drw, selbgcolor);
|
||||||
|
- scheme[SchemeSel].fg = drw_clr_create(drw, selfgcolor);
|
||||||
|
+ scheme[SchemeNorm].border = drw_clr_create(drw, normbordercolor, borderalpha);
|
||||||
|
+ scheme[SchemeNorm].bg = drw_clr_create(drw, normbgcolor, baralpha);
|
||||||
|
+ scheme[SchemeNorm].fg = drw_clr_create(drw, normfgcolor, OPAQUE);
|
||||||
|
+ scheme[SchemeSel].border = drw_clr_create(drw, selbordercolor, borderalpha);
|
||||||
|
+ scheme[SchemeSel].bg = drw_clr_create(drw, selbgcolor, baralpha);
|
||||||
|
+ scheme[SchemeSel].fg = drw_clr_create(drw, selfgcolor, OPAQUE);
|
||||||
|
/* init bars */
|
||||||
|
updatebars();
|
||||||
|
updatestatus();
|
||||||
|
@@ -1798,15 +1807,17 @@ updatebars(void)
|
||||||
|
Monitor *m;
|
||||||
|
XSetWindowAttributes wa = {
|
||||||
|
.override_redirect = True,
|
||||||
|
- .background_pixmap = ParentRelative,
|
||||||
|
+ .background_pixel = 0,
|
||||||
|
+ .border_pixel = 0,
|
||||||
|
+ .colormap = cmap,
|
||||||
|
.event_mask = ButtonPressMask|ExposureMask
|
||||||
|
};
|
||||||
|
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),
|
||||||
|
- CopyFromParent, DefaultVisual(dpy, screen),
|
||||||
|
- CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
|
||||||
|
+ m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, depth,
|
||||||
|
+ InputOutput, visual,
|
||||||
|
+ CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa);
|
||||||
|
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
|
||||||
|
XMapRaised(dpy, m->barwin);
|
||||||
|
}
|
||||||
|
@@ -2107,6 +2118,43 @@ xerrorstart(Display *dpy, XErrorEvent *ee)
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
+xinitvisual()
|
||||||
|
+{
|
||||||
|
+ XVisualInfo *infos;
|
||||||
|
+ XRenderPictFormat *fmt;
|
||||||
|
+ int nitems;
|
||||||
|
+ int i;
|
||||||
|
+
|
||||||
|
+ XVisualInfo tpl = {
|
||||||
|
+ .screen = screen,
|
||||||
|
+ .depth = 32,
|
||||||
|
+ .class = TrueColor
|
||||||
|
+ };
|
||||||
|
+ long masks = VisualScreenMask | VisualDepthMask | VisualClassMask;
|
||||||
|
+
|
||||||
|
+ infos = XGetVisualInfo(dpy, masks, &tpl, &nitems);
|
||||||
|
+ visual = NULL;
|
||||||
|
+ for(i = 0; i < nitems; i ++) {
|
||||||
|
+ fmt = XRenderFindVisualFormat(dpy, infos[i].visual);
|
||||||
|
+ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
|
||||||
|
+ visual = infos[i].visual;
|
||||||
|
+ depth = infos[i].depth;
|
||||||
|
+ cmap = XCreateColormap(dpy, root, visual, AllocNone);
|
||||||
|
+ useargb = 1;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ XFree(infos);
|
||||||
|
+
|
||||||
|
+ if (! visual) {
|
||||||
|
+ visual = DefaultVisual(dpy, screen);
|
||||||
|
+ depth = DefaultDepth(dpy, screen);
|
||||||
|
+ cmap = DefaultColormap(dpy, screen);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
zoom(const Arg *arg)
|
||||||
|
{
|
||||||
|
Client *c = selmon->sel;
|
||||||
115
patches/dwm-focusadjacenttag-6.0.diff
Normal file
115
patches/dwm-focusadjacenttag-6.0.diff
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
diff -up a/config.h b/config.h
|
||||||
|
--- a/config.h 2014-06-23 18:04:29.536917000 +0200
|
||||||
|
+++ b/config.h 2014-06-24 08:15:51.857173332 +0200
|
||||||
|
@@ -74,6 +74,10 @@ 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_Left, viewtoleft, {0} },
|
||||||
|
+ { MODKEY, XK_Right, viewtoright, {0} },
|
||||||
|
+ { MODKEY|ShiftMask, XK_Left, tagtoleft, {0} },
|
||||||
|
+ { MODKEY|ShiftMask, XK_Right, tagtoright, {0} },
|
||||||
|
TAGKEYS( XK_1, 0)
|
||||||
|
TAGKEYS( XK_2, 1)
|
||||||
|
TAGKEYS( XK_3, 2)
|
||||||
|
diff -up a/dwm.1 b/dwm.1
|
||||||
|
--- a/dwm.1 2014-06-23 18:04:29.532917821 +0200
|
||||||
|
+++ b/dwm.1 2014-06-23 21:52:54.095867809 +0200
|
||||||
|
@@ -71,6 +71,18 @@ Send focused window to previous screen,
|
||||||
|
.B Mod1\-Shift\-.
|
||||||
|
Send focused window to next screen, if any.
|
||||||
|
.TP
|
||||||
|
+.B Mod1\-Right
|
||||||
|
+Focus tag on the right, if any.
|
||||||
|
+.TP
|
||||||
|
+.B Mod1\-Left
|
||||||
|
+Focus tag on the left, if any.
|
||||||
|
+.TP
|
||||||
|
+.B Mod1\-Shift\-Right
|
||||||
|
+Send focused window to tag on the right, if any.
|
||||||
|
+.TP
|
||||||
|
+.B Mod1\-Shift\-Left
|
||||||
|
+Send focused window to tag on the left, if any.
|
||||||
|
+.TP
|
||||||
|
.B Mod1\-b
|
||||||
|
Toggles bar on and off.
|
||||||
|
.TP
|
||||||
|
diff -up a/dwm.c b/dwm.c
|
||||||
|
--- a/dwm.c 2014-06-23 18:04:29.532917821 +0200
|
||||||
|
+++ b/dwm.c 2014-06-24 08:17:40.921714154 +0200
|
||||||
|
@@ -226,6 +226,8 @@ static void sigchld(int unused);
|
||||||
|
static void spawn(const Arg *arg);
|
||||||
|
static void tag(const Arg *arg);
|
||||||
|
static void tagmon(const Arg *arg);
|
||||||
|
+static void tagtoleft(const Arg *arg);
|
||||||
|
+static void tagtoright(const Arg *arg);
|
||||||
|
static int textnw(const char *text, unsigned int len);
|
||||||
|
static void tile(Monitor *);
|
||||||
|
static void togglebar(const Arg *arg);
|
||||||
|
@@ -245,6 +247,8 @@ static void updatewindowtype(Client *c);
|
||||||
|
static void updatetitle(Client *c);
|
||||||
|
static void updatewmhints(Client *c);
|
||||||
|
static void view(const Arg *arg);
|
||||||
|
+static void viewtoleft(const Arg *arg);
|
||||||
|
+static void viewtoright(const Arg *arg);
|
||||||
|
static Client *wintoclient(Window w);
|
||||||
|
static Monitor *wintomon(Window w);
|
||||||
|
static int xerror(Display *dpy, XErrorEvent *ee);
|
||||||
|
@@ -1690,6 +1694,28 @@ tagmon(const Arg *arg) {
|
||||||
|
sendmon(selmon->sel, dirtomon(arg->i));
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+tagtoleft(const Arg *arg) {
|
||||||
|
+ if(selmon->sel != NULL
|
||||||
|
+ && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
||||||
|
+ && selmon->tagset[selmon->seltags] > 1) {
|
||||||
|
+ selmon->sel->tags >>= 1;
|
||||||
|
+ focus(NULL);
|
||||||
|
+ arrange(selmon);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+tagtoright(const Arg *arg) {
|
||||||
|
+ if(selmon->sel != NULL
|
||||||
|
+ && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
||||||
|
+ && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
|
||||||
|
+ selmon->sel->tags <<= 1;
|
||||||
|
+ focus(NULL);
|
||||||
|
+ arrange(selmon);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
int
|
||||||
|
textnw(const char *text, unsigned int len) {
|
||||||
|
XRectangle r;
|
||||||
|
@@ -2052,6 +2078,28 @@ view(const Arg *arg) {
|
||||||
|
arrange(selmon);
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+viewtoleft(const Arg *arg) {
|
||||||
|
+ if(__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
||||||
|
+ && selmon->tagset[selmon->seltags] > 1) {
|
||||||
|
+ selmon->seltags ^= 1; /* toggle sel tagset */
|
||||||
|
+ selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1;
|
||||||
|
+ focus(NULL);
|
||||||
|
+ arrange(selmon);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+viewtoright(const Arg *arg) {
|
||||||
|
+ if(__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
||||||
|
+ && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
|
||||||
|
+ selmon->seltags ^= 1; /* toggle sel tagset */
|
||||||
|
+ selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1;
|
||||||
|
+ focus(NULL);
|
||||||
|
+ arrange(selmon);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
Client *
|
||||||
|
wintoclient(Window w) {
|
||||||
|
Client *c;
|
||||||
Reference in New Issue
Block a user