Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
061578bd73 | ||
|
|
c3f392644c | ||
|
|
56b069739b | ||
|
|
699c7bd99c | ||
|
|
f7ee3c4d2a | ||
|
|
12b83c13ba | ||
|
|
b05b22ae95 | ||
|
|
5cab3cf6c1 | ||
|
|
b313ef7f43 | ||
|
|
4481fb0cee |
65
config.h
65
config.h
@@ -3,6 +3,11 @@
|
|||||||
// patch config - uselessgap
|
// patch config - uselessgap
|
||||||
static const unsigned int gappx = 6; /* gap pixel between windows */
|
static const unsigned int gappx = 6; /* gap pixel between windows */
|
||||||
|
|
||||||
|
// three column patch include
|
||||||
|
#include "tcl.c"
|
||||||
|
// to use x keysymbols (eg xev button produces XF86AudioraiseVolume = XF86XK_AudioRaisevolume)
|
||||||
|
#include <X11/XF86keysym.h>
|
||||||
|
|
||||||
/* appearance */
|
/* appearance */
|
||||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
static const unsigned int snap = 32; /* snap pixel */
|
static const unsigned int snap = 32; /* snap pixel */
|
||||||
@@ -12,8 +17,8 @@ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display
|
|||||||
static const int showsystray = 1; /* 0 means no systray */
|
static const int showsystray = 1; /* 0 means no systray */
|
||||||
static const int showbar = 1; /* 0 means no bar */
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
static const int topbar = 1; /* 0 means bottom bar */
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
static const char *fonts[] = { "monospace:size=10" };
|
static const char *fonts[] = { "Terminus:size=10" };
|
||||||
static const char dmenufont[] = "monospace:size=10";
|
static const char dmenufont[] = "Terminus:size=10";
|
||||||
static const char col_gray1[] = "#222222";
|
static const char col_gray1[] = "#222222";
|
||||||
static const char col_gray2[] = "#444444";
|
static const char col_gray2[] = "#444444";
|
||||||
static const char col_gray3[] = "#bbbbbb";
|
static const char col_gray3[] = "#bbbbbb";
|
||||||
@@ -24,7 +29,9 @@ static const char col_norm_fg[] = "#bbbbbb";
|
|||||||
static const char col_norm_bg[] = "#222222";
|
static const char col_norm_bg[] = "#222222";
|
||||||
static const char col_sel_fg[] = "#eeeeee";
|
static const char col_sel_fg[] = "#eeeeee";
|
||||||
static const char col_sel_bg[] = "#222222";
|
static const char col_sel_bg[] = "#222222";
|
||||||
static const char col_norm_bdr[] = "#555555";
|
//static const char col_norm_bdr[] = "#555555";
|
||||||
|
// this is to remove the border from non-selected windows
|
||||||
|
static const char col_norm_bdr[] = "#222222";
|
||||||
static const char col_sel_bdr[] = "#444444";
|
static const char col_sel_bdr[] = "#444444";
|
||||||
/* end my colors */
|
/* end my colors */
|
||||||
static const char *colors[][3] = {
|
static const char *colors[][3] = {
|
||||||
@@ -36,7 +43,8 @@ static const char *colors[][3] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* tagging */
|
/* tagging */
|
||||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
//static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||||
|
static const char *tags[] = { "一", "二", "三", "四", "五", "六", "七", "八", "九" };
|
||||||
|
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
/* xprop(1):
|
/* xprop(1):
|
||||||
@@ -45,9 +53,18 @@ static const Rule rules[] = {
|
|||||||
*/
|
*/
|
||||||
/* class instance title tags mask isfloating monitor */
|
/* class instance title tags mask isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
||||||
{ "firefox", NULL, NULL, 2, 0, -1 },
|
// { "firefox", NULL, NULL, 2, 0, -1 },
|
||||||
{ "URxvt", "cal", NULL, 0, 1, -1 },
|
// make calculator floating
|
||||||
{ "urxvt-f", NULL, NULL, 0, 1, -1 },
|
{ "SpeedCrunch", NULL, NULL, 0, 1, -1 },
|
||||||
|
{ "URxvt", NULL, "urxvt-f", 0, 1, -1 },
|
||||||
|
{ "mpv", NULL, NULL, 0, 1, -1 },
|
||||||
|
{ "vlc", NULL, NULL, 0, 1, -1 },
|
||||||
|
// didnt work
|
||||||
|
{ "org.gnome.Nautilus", NULL, NULL, 0, 1, -1 },
|
||||||
|
// $ xprop WM_CLASS #working below!
|
||||||
|
{ "Org.gnome.Nautilus", NULL, NULL, 0, 1, -1 },
|
||||||
|
{ "anki", NULL, NULL, 0, 1, -1 },
|
||||||
|
// { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
@@ -60,6 +77,7 @@ static const Layout layouts[] = {
|
|||||||
{ "[]=", tile }, /* first entry is default */
|
{ "[]=", tile }, /* first entry is default */
|
||||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
{ "><>", NULL }, /* no layout function means floating behavior */
|
||||||
{ "[M]", monocle },
|
{ "[M]", monocle },
|
||||||
|
{ "|||", tcl },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* key definitions */
|
/* key definitions */
|
||||||
@@ -82,6 +100,11 @@ static const char *lockcmd[] = { "slock", NULL };
|
|||||||
static const char *prtscrcmd[] = { "flameshot", "gui", NULL};
|
static const char *prtscrcmd[] = { "flameshot", "gui", NULL};
|
||||||
static const char *vol_up[] = { "volume_up.sh", NULL};
|
static const char *vol_up[] = { "volume_up.sh", NULL};
|
||||||
static const char *vol_down[] = { "volume_down.sh", NULL};
|
static const char *vol_down[] = { "volume_down.sh", NULL};
|
||||||
|
static const char *playerctl_play_pause[] = { "playerctl_play_pause", NULL};
|
||||||
|
static const char *playerctl_previous[] = { "playerctl_previous", NULL};
|
||||||
|
static const char *playerctl_next[] = { "playerctl_next", NULL};
|
||||||
|
static const char *calccmd[] = { "speedcrunch", NULL};
|
||||||
|
static const char *jmenu[] = {"jmenu", NULL};
|
||||||
|
|
||||||
static Key keys[] = {
|
static Key keys[] = {
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
@@ -90,17 +113,20 @@ static Key keys[] = {
|
|||||||
{ MODKEY|ControlMask, XK_Return, spawn, {.v = floattermcmd } },
|
{ MODKEY|ControlMask, XK_Return, spawn, {.v = floattermcmd } },
|
||||||
{ MODKEY, XK_b, togglebar, {0} },
|
{ MODKEY, XK_b, togglebar, {0} },
|
||||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
{ MODKEY|ShiftMask, XK_i, incnmaster, {.i = +1 } },
|
||||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
{ MODKEY|ShiftMask, XK_d, incnmaster, {.i = -1 } },
|
||||||
|
{ MODKEY, XK_d, spawn, {.v = jmenu } },
|
||||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||||
{ MODKEY, XK_Return, zoom, {0} },
|
{ MODKEY, XK_Return, zoom, {0} },
|
||||||
{ MODKEY, XK_Tab, view, {0} },
|
{ MODKEY, XK_Tab, view, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
||||||
|
{ MODKEY, XK_c, spawn, {.v = calccmd } },
|
||||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||||
|
{ MODKEY|ShiftMask, XK_t, setlayout, {.v = &layouts[3]} },
|
||||||
{ MODKEY, XK_space, setlayout, {0} },
|
{ MODKEY, XK_space, setlayout, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||||
@@ -123,11 +149,24 @@ static Key keys[] = {
|
|||||||
TAGKEYS( XK_8, 7)
|
TAGKEYS( XK_8, 7)
|
||||||
TAGKEYS( XK_9, 8)
|
TAGKEYS( XK_9, 8)
|
||||||
//{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
//{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||||
{ MODKEY|ControlMask, XK_q, quit, {0} },
|
// modified to alternative kill window
|
||||||
{ 0, XK_Print, spawn, {.v = prtscrcmd } },
|
{ MODKEY|ShiftMask, XK_q, killclient, {0} },
|
||||||
|
{ MODKEY|ControlMask, XK_q, quit, {0} },
|
||||||
|
{ 0, XK_Print, spawn, {.v = prtscrcmd } },
|
||||||
|
{ MODKEY, XK_F8, spawn, {.v = playerctl_play_pause } },
|
||||||
|
{ MODKEY, XK_F9, spawn, {.v = playerctl_previous } },
|
||||||
|
{ MODKEY, XK_F10, spawn, {.v = playerctl_next } },
|
||||||
{ MODKEY, XK_F11, spawn, {.v = vol_down } },
|
{ MODKEY, XK_F11, spawn, {.v = vol_down } },
|
||||||
{ MODKEY, XK_F12, spawn, {.v = vol_up } },
|
{ MODKEY, XK_F12, spawn, {.v = vol_up } },
|
||||||
{ MODKEY|ControlMask, XK_l, spawn, {.v = lockcmd } },
|
// trying to get volume knob working - trying symbols from XF86keysym.h and the keysym printed from xev
|
||||||
|
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = vol_up } },
|
||||||
|
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = vol_down } },
|
||||||
|
{ 0, XF86XK_AudioMute, spawn, {.v = playerctl_play_pause } },
|
||||||
|
//{ MODKEY, 0x1008ff13, spawn, {.v = vol_up} },
|
||||||
|
//{ 0, 0x1008ff12, spawn, {.v = playerctl_play_pause } },
|
||||||
|
//{ MODKEY, 0x1008ff11, spawn, {.v = vol_down } },
|
||||||
|
// end volume knob
|
||||||
|
{ MODKEY|ControlMask, XK_l, spawn, {.v = lockcmd } },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* button definitions */
|
/* button definitions */
|
||||||
|
|||||||
142
config.h.orig
142
config.h.orig
@@ -1,142 +0,0 @@
|
|||||||
/* 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} },
|
|
||||||
};
|
|
||||||
|
|
||||||
176
dwm.1.orig
176
dwm.1.orig
@@ -1,176 +0,0 @@
|
|||||||
.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.
|
|
||||||
20
dwm.c.rej
20
dwm.c.rej
@@ -1,20 +0,0 @@
|
|||||||
--- 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);
|
|
||||||
@@ -1,253 +0,0 @@
|
|||||||
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;
|
|
||||||
74
tcl.c
Normal file
74
tcl.c
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
void
|
||||||
|
tcl(Monitor * m)
|
||||||
|
{
|
||||||
|
int x, y, h, w, mw, sw, bdw;
|
||||||
|
unsigned int i, n;
|
||||||
|
Client * c;
|
||||||
|
|
||||||
|
for (n = 0, c = nexttiled(m->clients); c;
|
||||||
|
c = nexttiled(c->next), n++);
|
||||||
|
|
||||||
|
if (n == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
c = nexttiled(m->clients);
|
||||||
|
|
||||||
|
mw = m->mfact * m->ww;
|
||||||
|
sw = (m->ww - mw) / 2;
|
||||||
|
bdw = (2 * c->bw);
|
||||||
|
resize(c,
|
||||||
|
n < 3 ? m->wx : m->wx + sw,
|
||||||
|
m->wy,
|
||||||
|
n == 1 ? m->ww - bdw : mw - bdw,
|
||||||
|
m->wh - bdw,
|
||||||
|
False);
|
||||||
|
|
||||||
|
if (--n == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
w = (m->ww - mw) / ((n > 1) + 1);
|
||||||
|
c = nexttiled(c->next);
|
||||||
|
|
||||||
|
if (n > 1)
|
||||||
|
{
|
||||||
|
x = m->wx + ((n > 1) ? mw + sw : mw);
|
||||||
|
y = m->wy;
|
||||||
|
h = m->wh / (n / 2);
|
||||||
|
|
||||||
|
if (h < bh)
|
||||||
|
h = m->wh;
|
||||||
|
|
||||||
|
for (i = 0; c && i < n / 2; c = nexttiled(c->next), i++)
|
||||||
|
{
|
||||||
|
resize(c,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
w - bdw,
|
||||||
|
(i + 1 == n / 2) ? m->wy + m->wh - y - bdw : h - bdw,
|
||||||
|
False);
|
||||||
|
|
||||||
|
if (h != m->wh)
|
||||||
|
y = c->y + HEIGHT(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
x = (n + 1 / 2) == 1 ? mw : m->wx;
|
||||||
|
y = m->wy;
|
||||||
|
h = m->wh / ((n + 1) / 2);
|
||||||
|
|
||||||
|
if (h < bh)
|
||||||
|
h = m->wh;
|
||||||
|
|
||||||
|
for (i = 0; c; c = nexttiled(c->next), i++)
|
||||||
|
{
|
||||||
|
resize(c,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
(i + 1 == (n + 1) / 2) ? w - bdw : w - bdw,
|
||||||
|
(i + 1 == (n + 1) / 2) ? m->wy + m->wh - y - bdw : h - bdw,
|
||||||
|
False);
|
||||||
|
|
||||||
|
if (h != m->wh)
|
||||||
|
y = c->y + HEIGHT(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user