feat(x11): migrate to pure Xlibre + dwm/dmenu/st stack, fix fcitx5-t9 bottom bar, PM8909 PON shutdown, and remove Wayland
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
image: alpine/edge
|
||||
packages:
|
||||
- editorconfig-checker
|
||||
- libxft-dev
|
||||
- libx11-dev
|
||||
- libxinerama-dev
|
||||
- pango-dev
|
||||
sources:
|
||||
- https://git.sr.ht/~mil/sxmo-dwm
|
||||
tasks:
|
||||
- editorconfig-check: |
|
||||
cd sxmo-dwm
|
||||
ec
|
||||
- make: |
|
||||
cd sxmo-dwm
|
||||
make
|
||||
@@ -0,0 +1,14 @@
|
||||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*.{sh|c}]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = tab
|
||||
#max_line_length = 80
|
||||
spaces_around_operators = true
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
@@ -0,0 +1,37 @@
|
||||
MIT/X Consortium License
|
||||
|
||||
© 2006-2019 Anselm R Garbe <anselm@garbe.ca>
|
||||
© 2006-2009 Jukka Salmi <jukka at salmi dot ch>
|
||||
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
© 2007-2011 Peter Hartlich <sgkkr at hartlich dot com>
|
||||
© 2007-2009 Szabolcs Nagy <nszabolcs at gmail dot com>
|
||||
© 2007-2009 Christof Musik <christof at sendfax dot de>
|
||||
© 2007-2009 Premysl Hruby <dfenze at gmail dot com>
|
||||
© 2007-2008 Enno Gottox Boland <gottox at s01 dot de>
|
||||
© 2008 Martin Hurton <martin dot hurton at gmail dot com>
|
||||
© 2008 Neale Pickett <neale dot woozle dot org>
|
||||
© 2009 Mate Nagy <mnagy at port70 dot net>
|
||||
© 2010-2016 Hiltjo Posthuma <hiltjo@codemadness.org>
|
||||
© 2010-2012 Connor Lane Smith <cls@lubutu.com>
|
||||
© 2011 Christoph Lohmann <20h@r-36.net>
|
||||
© 2015-2016 Quentin Rameau <quinq@fifth.space>
|
||||
© 2015-2016 Eric Pruitt <eric.pruitt@gmail.com>
|
||||
© 2016-2017 Markus Teich <markus.teich@stusta.mhn.de>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,51 @@
|
||||
# dwm - dynamic window manager
|
||||
# See LICENSE file for copyright and license details.
|
||||
|
||||
include config.mk
|
||||
|
||||
SRC = drw.c dwm.c util.c
|
||||
OBJ = ${SRC:.c=.o}
|
||||
|
||||
all: options dwm
|
||||
|
||||
options:
|
||||
@echo dwm build options:
|
||||
@echo "CFLAGS = ${CFLAGS}"
|
||||
@echo "LDFLAGS = ${LDFLAGS}"
|
||||
@echo "CC = ${CC}"
|
||||
|
||||
.c.o:
|
||||
${CC} -c ${CFLAGS} $<
|
||||
|
||||
${OBJ}: config.h config.mk
|
||||
|
||||
config.h:
|
||||
cp config.def.h $@
|
||||
|
||||
dwm: ${OBJ}
|
||||
${CC} -o $@ ${OBJ} ${LDFLAGS}
|
||||
|
||||
clean:
|
||||
rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz
|
||||
|
||||
dist: clean
|
||||
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}
|
||||
tar -cf dwm-${VERSION}.tar dwm-${VERSION}
|
||||
gzip dwm-${VERSION}.tar
|
||||
rm -rf dwm-${VERSION}
|
||||
|
||||
install: all
|
||||
mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
cp -f dwm ${DESTDIR}${PREFIX}/bin
|
||||
chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
|
||||
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||
sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
|
||||
chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
|
||||
|
||||
uninstall:
|
||||
rm -f ${DESTDIR}${PREFIX}/bin/dwm\
|
||||
${DESTDIR}${MANPREFIX}/man1/dwm.1
|
||||
|
||||
.PHONY: all options clean dist install uninstall
|
||||
@@ -0,0 +1,50 @@
|
||||
dwm - dynamic window manager
|
||||
============================
|
||||
[](https://builds.sr.ht/~mil/sxmo-dwm?)
|
||||
|
||||
dwm is an extremely fast, small, and dynamic window manager for X.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
In order to build dwm you need the Xlib header files.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
Edit config.mk to match your local setup (dwm is installed into
|
||||
the /usr/local namespace by default).
|
||||
|
||||
Afterwards enter the following command to build and install dwm (if
|
||||
necessary as root):
|
||||
|
||||
make clean install
|
||||
|
||||
|
||||
Running dwm
|
||||
-----------
|
||||
Add the following line to your .xinitrc to start dwm using startx:
|
||||
|
||||
exec dwm
|
||||
|
||||
In order to connect dwm to a specific display, make sure that
|
||||
the DISPLAY environment variable is set correctly, e.g.:
|
||||
|
||||
DISPLAY=foo.bar:1 exec dwm
|
||||
|
||||
(This will start dwm on display :1 of the host foo.bar.)
|
||||
|
||||
In order to display status info in the bar, you can do something
|
||||
like this in your .xinitrc:
|
||||
|
||||
while xsetroot -name "`date` `uptime | sed 's/.*,//'`"
|
||||
do
|
||||
sleep 1
|
||||
done &
|
||||
exec dwm
|
||||
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
The configuration of dwm is done by creating a custom config.h
|
||||
and (re)compiling the source code.
|
||||
@@ -0,0 +1,171 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/* appearance */
|
||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||
static const unsigned int snap = 16; /* snap pixel */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const char font[] = "Fira Code, DejaVuSansM Nerd Font 15px";
|
||||
static const char dmenufont[] = "Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true";
|
||||
static const char col_gray1[] = "#323232";
|
||||
static const char col_gray2[] = "#444444";
|
||||
static const char col_gray3[] = "#dddddd";
|
||||
static const char col_gray4[] = "#ffffff";
|
||||
static const char col_cyan[] = "#005577";
|
||||
static const char *defaultcolors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||
[SchemeTabActive] = { col_gray2, col_gray3, col_gray2 },
|
||||
[SchemeTabInactive] = { col_gray1, col_gray3, col_gray1 }
|
||||
};
|
||||
|
||||
/* 1 means attach after the currently active window */
|
||||
static const int attachbelow = 1;
|
||||
|
||||
/* tagging */
|
||||
static const char *tags[] = { "1", "2", "3", "4" };
|
||||
|
||||
static const Rule rules[] = {
|
||||
/* class instance title tags mask isfloating isterminal noswallow monitor */
|
||||
{ "st", NULL, NULL, 0, 0, 1, 1, -1, 0},
|
||||
{ "St", NULL, NULL, 0, 0, 1, 1, -1, 0},
|
||||
{ "svkbd", NULL, NULL, TAGMASK, 1, 1, 0, -1, 1},
|
||||
};
|
||||
|
||||
/* layout(s) */
|
||||
static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */
|
||||
static const int nmaster = 1; /* number of clients in master area */
|
||||
static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
|
||||
|
||||
/* Bartabgroups properties */
|
||||
#define BARTAB_BORDERS 1 // 0 = off, 1 = on
|
||||
#define BARTAB_BOTTOMBORDER 1 // 0 = off, 1 = on
|
||||
#define BARTAB_TAGSINDICATOR 1 // 0 = off, 1 = on if >1 client/view tag, 2 = always on
|
||||
#define BARTAB_TAGSPX 4 // # pixels for tag grid boxes
|
||||
#define BARTAB_TAGSROWS 2 // # rows in tag grid (9 tags, e.g. 3x3)
|
||||
static void (*bartabmonfns[])(Monitor *) = { monocle, bstack };
|
||||
static void (*bartabfloatfns[])(Monitor *) = { NULL };
|
||||
|
||||
static const Layout ppcyclelayouts[] = {
|
||||
/* symbol arrange function */
|
||||
{ "", bstack }, /* first entry is default (vertical stack for 240x320) */
|
||||
{ "", monocle },
|
||||
{ "", tile },
|
||||
};
|
||||
|
||||
static const Layout layouts[] = {
|
||||
/* symbol arrange function */
|
||||
{ "", bstack }, /* first entry is default */
|
||||
{ "", tile },
|
||||
{ "F", NULL },
|
||||
{ "", monocle },
|
||||
{ "DD", deckdouble },
|
||||
{ "D", deck },
|
||||
};
|
||||
|
||||
/* key definitions */
|
||||
#define MODKEY Mod4Mask
|
||||
#define ALTKEY Mod1Mask
|
||||
#define TAGKEYS(KEY,TAG) \
|
||||
{ KeyPress, MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||
{ KeyPress, MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||
{ KeyPress, MODKEY|ShiftMask, KEY, tag, {.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_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
||||
|
||||
#include <X11/XF86keysym.h>
|
||||
#ifndef _EVDEVK
|
||||
#define _EVDEVK(_v) (0x10081000 + (_v))
|
||||
#endif
|
||||
static Key keys[] = {
|
||||
/* Nokia 8110 4G / MSM8909 Physical Keypad & Action Keys */
|
||||
{ KeyPress, 0, XK_Menu, spawn, { .v = (const char*[]){ "sxmo_appmenu.sh", "sys", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_KbdLcdMenu1, spawn, { .v = (const char*[]){ "sxmo_appmenu.sh", "sys", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_Back, spawn, { .v = (const char*[]){ "sxmo_appmenu.sh", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_KbdLcdMenu2, spawn, { .v = (const char*[]){ "sxmo_appmenu.sh", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_Phone, spawn, { .v = (const char*[]){ "sxmo_hook_inputhandler.sh", "enter_one", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_PickupPhone, spawn, { .v = (const char*[]){ "sxmo_hook_inputhandler.sh", "enter_one", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_PowerOff, spawn, { .v = (const char*[]){ "sxmo_multikey.sh", "powerbutton", "powerbutton_one", "powerbutton_two", "powerbutton_three", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_AudioRaiseVolume, spawn, { .v = (const char*[]){ "sxmo_audio.sh", "vol", "up", "5", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_AudioLowerVolume, spawn, { .v = (const char*[]){ "sxmo_audio.sh", "vol", "down", "5", NULL } } },
|
||||
|
||||
/* Used by scripts via xdotool */
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_e, shiftview, {.i = -1} },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_r, shiftview, {.i = +1} },
|
||||
{ KeyPress, MODKEY, XK_e, clienttagpush, {.i = -1} },
|
||||
{ KeyPress, MODKEY, XK_r, clienttagpush, {.i = +1} },
|
||||
|
||||
/* Quick Navigation */
|
||||
{ KeyPress, MODKEY, XK_p, spawn, SHCMD("sxmo_appmenu.sh") },
|
||||
{ KeyPress, MODKEY, XK_d, spawn, SHCMD("sxmo_files.sh") },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_Return, spawn, SHCMD("st") },
|
||||
{ KeyPress, MODKEY, XK_b, togglebar, {0} },
|
||||
{ KeyPress, MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||
{ KeyPress, MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||
{ KeyPress, MODKEY, XK_Down, focusstack, {.i = +1 } },
|
||||
{ KeyPress, MODKEY, XK_Up, focusstack, {.i = -1 } },
|
||||
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_j, pushdown, {.i = +1 } },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_k, pushup, {.i = -1 } },
|
||||
|
||||
{ KeyPress, MODKEY, XK_x, focusstack, {.i = +1 } },
|
||||
|
||||
{ KeyPress, 0, XF86XK_MonBrightnessUp, spawn, SHCMD("sxmo_brightness.sh up") },
|
||||
{ KeyPress, 0, XF86XK_MonBrightnessDown, spawn, SHCMD("sxmo_brightness.sh down") },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_Down, spawn, SHCMD("sxmo_audio.sh vol down") },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_Up, spawn, SHCMD("sxmo_audio.sh vol up") },
|
||||
|
||||
{ KeyPress, MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||
{ KeyPress, MODKEY, XK_o, incnmaster, {.i = -1 } },
|
||||
{ KeyPress, MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||
{ KeyPress, MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||
{ KeyPress, MODKEY, XK_Return, zoom, {0} },
|
||||
{ KeyPress, MODKEY, XK_Tab, view, {0} },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_c, killclient, {0} },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_q, killclient, {0} },
|
||||
|
||||
{ KeyPress, MODKEY, XK_semicolon, switchcol, {0} },
|
||||
{ KeyPress, MODKEY, XK_s, transfer, {0} },
|
||||
|
||||
/* monocle */
|
||||
{ KeyPress, MODKEY, XK_m, setlayout, {.v = &layouts[3]} },
|
||||
/* tile */
|
||||
{ KeyPress, MODKEY, XK_slash, setlayout, {.v = &layouts[1]} },
|
||||
/* bstack */
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_slash, setlayout, {.v = &layouts[0]} },
|
||||
|
||||
{ KeyPress, MODKEY, XK_f, togglefloating, {0} },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_f, unfloatvisible, {0} },
|
||||
|
||||
/* cycle through the layouts in ppcyclelayouts */
|
||||
{ KeyPress, MODKEY, XK_space, cyclelayout, {.i = +1} },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||
{ KeyPress, MODKEY, XK_0, view, {.ui = ~0 } },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||
|
||||
{ KeyPress, MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||
{ KeyPress, MODKEY, XK_period, focusmon, {.i = +1 } },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||
|
||||
TAGKEYS( XK_1, 0)
|
||||
TAGKEYS( XK_2, 1)
|
||||
TAGKEYS( XK_3, 2)
|
||||
TAGKEYS( XK_4, 3)
|
||||
};
|
||||
|
||||
/* button definitions */
|
||||
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
||||
static Button buttons[] = {
|
||||
/* click event mask button function argument */
|
||||
{ ClkTagBar, 0, Button1, view, {0} },
|
||||
{ ClkLtSymbol, 0, Button1, cyclelayout, {.i = +1} },
|
||||
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
||||
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
||||
};
|
||||
@@ -0,0 +1,171 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/* appearance */
|
||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||
static const unsigned int snap = 16; /* snap pixel */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const char font[] = "Fira Code, DejaVuSansM Nerd Font 15px";
|
||||
static const char dmenufont[] = "Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true";
|
||||
static const char col_gray1[] = "#323232";
|
||||
static const char col_gray2[] = "#444444";
|
||||
static const char col_gray3[] = "#dddddd";
|
||||
static const char col_gray4[] = "#ffffff";
|
||||
static const char col_cyan[] = "#005577";
|
||||
static const char *defaultcolors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||
[SchemeTabActive] = { col_gray2, col_gray3, col_gray2 },
|
||||
[SchemeTabInactive] = { col_gray1, col_gray3, col_gray1 }
|
||||
};
|
||||
|
||||
/* 1 means attach after the currently active window */
|
||||
static const int attachbelow = 1;
|
||||
|
||||
/* tagging */
|
||||
static const char *tags[] = { "1", "2", "3", "4" };
|
||||
|
||||
static const Rule rules[] = {
|
||||
/* class instance title tags mask isfloating isterminal noswallow monitor */
|
||||
{ "st", NULL, NULL, 0, 0, 1, 1, -1, 0},
|
||||
{ "St", NULL, NULL, 0, 0, 1, 1, -1, 0},
|
||||
{ "svkbd", NULL, NULL, TAGMASK, 1, 1, 0, -1, 1},
|
||||
};
|
||||
|
||||
/* layout(s) */
|
||||
static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */
|
||||
static const int nmaster = 1; /* number of clients in master area */
|
||||
static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
|
||||
|
||||
/* Bartabgroups properties */
|
||||
#define BARTAB_BORDERS 1 // 0 = off, 1 = on
|
||||
#define BARTAB_BOTTOMBORDER 1 // 0 = off, 1 = on
|
||||
#define BARTAB_TAGSINDICATOR 1 // 0 = off, 1 = on if >1 client/view tag, 2 = always on
|
||||
#define BARTAB_TAGSPX 4 // # pixels for tag grid boxes
|
||||
#define BARTAB_TAGSROWS 2 // # rows in tag grid (9 tags, e.g. 3x3)
|
||||
static void (*bartabmonfns[])(Monitor *) = { monocle, bstack };
|
||||
static void (*bartabfloatfns[])(Monitor *) = { NULL };
|
||||
|
||||
static const Layout ppcyclelayouts[] = {
|
||||
/* symbol arrange function */
|
||||
{ "", bstack }, /* first entry is default (vertical stack for 240x320) */
|
||||
{ "", monocle },
|
||||
{ "", tile },
|
||||
};
|
||||
|
||||
static const Layout layouts[] = {
|
||||
/* symbol arrange function */
|
||||
{ "", bstack }, /* first entry is default */
|
||||
{ "", tile },
|
||||
{ "F", NULL },
|
||||
{ "", monocle },
|
||||
{ "DD", deckdouble },
|
||||
{ "D", deck },
|
||||
};
|
||||
|
||||
/* key definitions */
|
||||
#define MODKEY Mod4Mask
|
||||
#define ALTKEY Mod1Mask
|
||||
#define TAGKEYS(KEY,TAG) \
|
||||
{ KeyPress, MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||
{ KeyPress, MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||
{ KeyPress, MODKEY|ShiftMask, KEY, tag, {.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_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
||||
|
||||
#include <X11/XF86keysym.h>
|
||||
#ifndef _EVDEVK
|
||||
#define _EVDEVK(_v) (0x10081000 + (_v))
|
||||
#endif
|
||||
static Key keys[] = {
|
||||
/* Nokia 8110 4G / MSM8909 Physical Keypad & Action Keys */
|
||||
{ KeyPress, 0, XK_Menu, spawn, { .v = (const char*[]){ "sxmo_appmenu.sh", "sys", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_KbdLcdMenu1, spawn, { .v = (const char*[]){ "sxmo_appmenu.sh", "sys", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_Back, spawn, { .v = (const char*[]){ "sxmo_appmenu.sh", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_KbdLcdMenu2, spawn, { .v = (const char*[]){ "sxmo_appmenu.sh", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_Phone, spawn, { .v = (const char*[]){ "sxmo_hook_inputhandler.sh", "enter_one", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_PickupPhone, spawn, { .v = (const char*[]){ "sxmo_hook_inputhandler.sh", "enter_one", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_PowerOff, spawn, { .v = (const char*[]){ "sxmo_multikey.sh", "powerbutton", "powerbutton_one", "powerbutton_two", "powerbutton_three", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_AudioRaiseVolume, spawn, { .v = (const char*[]){ "sxmo_audio.sh", "vol", "up", "5", NULL } } },
|
||||
{ KeyPress, 0, XF86XK_AudioLowerVolume, spawn, { .v = (const char*[]){ "sxmo_audio.sh", "vol", "down", "5", NULL } } },
|
||||
|
||||
/* Used by scripts via xdotool */
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_e, shiftview, {.i = -1} },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_r, shiftview, {.i = +1} },
|
||||
{ KeyPress, MODKEY, XK_e, clienttagpush, {.i = -1} },
|
||||
{ KeyPress, MODKEY, XK_r, clienttagpush, {.i = +1} },
|
||||
|
||||
/* Quick Navigation */
|
||||
{ KeyPress, MODKEY, XK_p, spawn, SHCMD("sxmo_appmenu.sh") },
|
||||
{ KeyPress, MODKEY, XK_d, spawn, SHCMD("sxmo_files.sh") },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_Return, spawn, SHCMD("st") },
|
||||
{ KeyPress, MODKEY, XK_b, togglebar, {0} },
|
||||
{ KeyPress, MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||
{ KeyPress, MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||
{ KeyPress, MODKEY, XK_Down, focusstack, {.i = +1 } },
|
||||
{ KeyPress, MODKEY, XK_Up, focusstack, {.i = -1 } },
|
||||
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_j, pushdown, {.i = +1 } },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_k, pushup, {.i = -1 } },
|
||||
|
||||
{ KeyPress, MODKEY, XK_x, focusstack, {.i = +1 } },
|
||||
|
||||
{ KeyPress, 0, XF86XK_MonBrightnessUp, spawn, SHCMD("sxmo_brightness.sh up") },
|
||||
{ KeyPress, 0, XF86XK_MonBrightnessDown, spawn, SHCMD("sxmo_brightness.sh down") },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_Down, spawn, SHCMD("sxmo_audio.sh vol down") },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_Up, spawn, SHCMD("sxmo_audio.sh vol up") },
|
||||
|
||||
{ KeyPress, MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||
{ KeyPress, MODKEY, XK_o, incnmaster, {.i = -1 } },
|
||||
{ KeyPress, MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||
{ KeyPress, MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||
{ KeyPress, MODKEY, XK_Return, zoom, {0} },
|
||||
{ KeyPress, MODKEY, XK_Tab, view, {0} },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_c, killclient, {0} },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_q, killclient, {0} },
|
||||
|
||||
{ KeyPress, MODKEY, XK_semicolon, switchcol, {0} },
|
||||
{ KeyPress, MODKEY, XK_s, transfer, {0} },
|
||||
|
||||
/* monocle */
|
||||
{ KeyPress, MODKEY, XK_m, setlayout, {.v = &layouts[3]} },
|
||||
/* tile */
|
||||
{ KeyPress, MODKEY, XK_slash, setlayout, {.v = &layouts[1]} },
|
||||
/* bstack */
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_slash, setlayout, {.v = &layouts[0]} },
|
||||
|
||||
{ KeyPress, MODKEY, XK_f, togglefloating, {0} },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_f, unfloatvisible, {0} },
|
||||
|
||||
/* cycle through the layouts in ppcyclelayouts */
|
||||
{ KeyPress, MODKEY, XK_space, cyclelayout, {.i = +1} },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||
{ KeyPress, MODKEY, XK_0, view, {.ui = ~0 } },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||
|
||||
{ KeyPress, MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||
{ KeyPress, MODKEY, XK_period, focusmon, {.i = +1 } },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||
{ KeyPress, MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||
|
||||
TAGKEYS( XK_1, 0)
|
||||
TAGKEYS( XK_2, 1)
|
||||
TAGKEYS( XK_3, 2)
|
||||
TAGKEYS( XK_4, 3)
|
||||
};
|
||||
|
||||
/* button definitions */
|
||||
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
||||
static Button buttons[] = {
|
||||
/* click event mask button function argument */
|
||||
{ ClkTagBar, 0, Button1, view, {0} },
|
||||
{ ClkLtSymbol, 0, Button1, cyclelayout, {.i = +1} },
|
||||
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
||||
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
# dwm version
|
||||
VERSION = 6.3.1-sxmo
|
||||
|
||||
# Customize below to fit your system
|
||||
|
||||
# paths
|
||||
PREFIX = /usr/local
|
||||
MANPREFIX = ${PREFIX}/share/man
|
||||
|
||||
X11INC = /usr/X11R6/include
|
||||
X11LIB = /usr/X11R6/lib
|
||||
|
||||
# Xinerama, comment if you don't want it
|
||||
XINERAMALIBS = -lXinerama
|
||||
XINERAMAFLAGS = -DXINERAMA
|
||||
|
||||
# freetype
|
||||
FREETYPELIBS = -lfontconfig -lXft
|
||||
FREETYPEINC = /usr/include/freetype2
|
||||
# OpenBSD (uncomment)
|
||||
#FREETYPEINC = ${X11INC}/freetype2
|
||||
|
||||
# Disable bonsai by uncommenting this
|
||||
#NOBONSAIFLAGS = -DNOBONSAI
|
||||
|
||||
# includes and libs
|
||||
INCS = -I${X11INC} -I${FREETYPEINC} `pkg-config --cflags xft pango pangoxft`
|
||||
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lX11-xcb -lxcb -lxcb-res -lrt `pkg-config --libs xft pango pangoxft`
|
||||
|
||||
# flags
|
||||
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} ${NOBONSAIFLAGS}
|
||||
#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
|
||||
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
|
||||
LDFLAGS = ${LIBS}
|
||||
|
||||
# Solaris
|
||||
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
|
||||
#LDFLAGS = ${LIBS}
|
||||
|
||||
# compiler and linker
|
||||
CC = cc
|
||||
@@ -0,0 +1,298 @@
|
||||
/* 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 <pango/pango.h>
|
||||
#include <pango/pangoxft.h>
|
||||
|
||||
#include "drw.h"
|
||||
#include "util.h"
|
||||
|
||||
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);
|
||||
drw_font_free(drw->font);
|
||||
free(drw);
|
||||
}
|
||||
|
||||
/* This function is an implementation detail. Library users should use
|
||||
* drw_font_create instead.
|
||||
*/
|
||||
static Fnt *
|
||||
xfont_create(Drw *drw, const char *fontname)
|
||||
{
|
||||
Fnt *font;
|
||||
PangoFontMap *fontmap;
|
||||
PangoContext *context;
|
||||
PangoFontDescription *desc;
|
||||
PangoFontMetrics *metrics;
|
||||
|
||||
if (!fontname) {
|
||||
die("no font specified.");
|
||||
}
|
||||
|
||||
font = ecalloc(1, sizeof(Fnt));
|
||||
font->dpy = drw->dpy;
|
||||
|
||||
fontmap = pango_xft_get_font_map(drw->dpy, drw->screen);
|
||||
context = pango_font_map_create_context(fontmap);
|
||||
desc = pango_font_description_from_string(fontname);
|
||||
font->layout = pango_layout_new(context);
|
||||
pango_layout_set_font_description(font->layout, desc);
|
||||
|
||||
metrics = pango_context_get_metrics(context, desc, NULL);
|
||||
font->h = pango_font_metrics_get_height(metrics) / PANGO_SCALE;
|
||||
|
||||
pango_font_metrics_unref(metrics);
|
||||
g_object_unref(context);
|
||||
|
||||
return font;
|
||||
}
|
||||
|
||||
static void
|
||||
xfont_free(Fnt *font)
|
||||
{
|
||||
if (!font)
|
||||
return;
|
||||
if (font->layout)
|
||||
g_object_unref(font->layout);
|
||||
free(font);
|
||||
}
|
||||
|
||||
Fnt*
|
||||
drw_font_create(Drw* drw, const char font[])
|
||||
{
|
||||
Fnt *fnt = NULL;
|
||||
|
||||
if (!drw || !font)
|
||||
return NULL;
|
||||
|
||||
fnt = xfont_create(drw, font);
|
||||
|
||||
return (drw->font = fnt);
|
||||
}
|
||||
|
||||
void
|
||||
drw_font_free(Fnt *font)
|
||||
{
|
||||
if (font) {
|
||||
xfont_free(font);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
|
||||
{
|
||||
if (!drw || !dest || !clrname)
|
||||
return;
|
||||
|
||||
if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
|
||||
DefaultColormap(drw->dpy, drw->screen),
|
||||
clrname, dest))
|
||||
die("error, cannot allocate color '%s'", clrname);
|
||||
}
|
||||
|
||||
/* Wrapper to create color schemes. The caller has to call free(3) on the
|
||||
* returned color scheme when done using it. */
|
||||
Clr *
|
||||
drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
|
||||
{
|
||||
size_t i;
|
||||
Clr *ret;
|
||||
|
||||
/* need at least two colors for a scheme */
|
||||
if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor))))
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < clrcount; i++)
|
||||
drw_clr_create(drw, &ret[i], clrnames[i]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
drw_setscheme(Drw *drw, Clr *scm)
|
||||
{
|
||||
if (drw)
|
||||
drw->scheme = scm;
|
||||
}
|
||||
|
||||
void
|
||||
drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert)
|
||||
{
|
||||
if (!drw || !drw->scheme)
|
||||
return;
|
||||
XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel);
|
||||
if (filled)
|
||||
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
|
||||
else
|
||||
XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1);
|
||||
}
|
||||
|
||||
int
|
||||
drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup)
|
||||
{
|
||||
char buf[1024];
|
||||
int ty, th;
|
||||
unsigned int ew, eh;
|
||||
XftDraw *d = NULL;
|
||||
size_t i, len;
|
||||
|
||||
int render = x || y || w || h;
|
||||
|
||||
if (!drw || (render && !drw->scheme) || !text || !drw->font)
|
||||
return 0;
|
||||
|
||||
if (!render) {
|
||||
w = ~w;
|
||||
} else {
|
||||
XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
|
||||
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));
|
||||
x += lpad;
|
||||
w -= lpad;
|
||||
}
|
||||
|
||||
len = strlen(text);
|
||||
|
||||
if (len) {
|
||||
drw_font_getexts(drw->font, text, len, &ew, &eh, markup);
|
||||
th = eh;
|
||||
/* shorten text if necessary */
|
||||
for (len = MIN(len, sizeof(buf) - 1); len && ew > w; len--) {
|
||||
drw_font_getexts(drw->font, text, len, &ew, &eh, markup);
|
||||
if (eh > th)
|
||||
th = eh;
|
||||
}
|
||||
|
||||
if (len) {
|
||||
memcpy(buf, text, len);
|
||||
buf[len] = '\0';
|
||||
if (len < strlen(text))
|
||||
for (i = len; i && i > len - 3; buf[--i] = '.')
|
||||
; /* NOP */
|
||||
|
||||
if (render) {
|
||||
ty = y + (h - th) / 2;
|
||||
if(markup)
|
||||
pango_layout_set_markup(drw->font->layout, buf, len);
|
||||
else
|
||||
pango_layout_set_text(drw->font->layout, buf, len);
|
||||
pango_xft_render_layout(d, &drw->scheme[invert ? ColBg : ColFg],
|
||||
drw->font->layout, x * PANGO_SCALE, ty * PANGO_SCALE);
|
||||
if(markup) /* clear markup attributes */
|
||||
pango_layout_set_attributes(drw->font->layout, NULL);
|
||||
}
|
||||
x += ew;
|
||||
w -= ew;
|
||||
}
|
||||
}
|
||||
|
||||
if (d)
|
||||
XftDrawDestroy(d);
|
||||
|
||||
return x + (render ? w : 0);
|
||||
}
|
||||
|
||||
void
|
||||
drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
|
||||
{
|
||||
if (!drw)
|
||||
return;
|
||||
|
||||
XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y);
|
||||
XSync(drw->dpy, False);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
drw_font_getwidth(Drw *drw, const char *text, Bool markup)
|
||||
{
|
||||
if (!drw || !drw->font || !text)
|
||||
return 0;
|
||||
return drw_text(drw, 0, 0, 0, 0, 0, text, 0, markup);
|
||||
}
|
||||
|
||||
void
|
||||
drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h, Bool markup)
|
||||
{
|
||||
if (!font || !text)
|
||||
return;
|
||||
|
||||
PangoRectangle r;
|
||||
if(markup)
|
||||
pango_layout_set_markup(font->layout, text, len);
|
||||
else
|
||||
pango_layout_set_text(font->layout, text, len);
|
||||
pango_layout_get_extents(font->layout, 0, &r);
|
||||
if(markup) /* clear markup attributes */
|
||||
pango_layout_set_attributes(font->layout, NULL);
|
||||
if (w)
|
||||
*w = r.width / PANGO_SCALE;
|
||||
if (h)
|
||||
*h = r.height / PANGO_SCALE;
|
||||
}
|
||||
|
||||
Cur *
|
||||
drw_cur_create(Drw *drw, int shape)
|
||||
{
|
||||
Cur *cur;
|
||||
Pixmap blank;
|
||||
XColor dummy;
|
||||
static const char data[1] = {0};
|
||||
|
||||
(void)shape;
|
||||
if (!drw || !(cur = ecalloc(1, sizeof(Cur))))
|
||||
return NULL;
|
||||
|
||||
memset(&dummy, 0, sizeof(dummy));
|
||||
blank = XCreateBitmapFromData(drw->dpy, drw->root, data, 1, 1);
|
||||
cur->cursor = XCreatePixmapCursor(drw->dpy, blank, blank, &dummy, &dummy, 0, 0);
|
||||
XFreePixmap(drw->dpy, blank);
|
||||
|
||||
return cur;
|
||||
}
|
||||
|
||||
void
|
||||
drw_cur_free(Drw *drw, Cur *cursor)
|
||||
{
|
||||
if (!cursor)
|
||||
return;
|
||||
|
||||
XFreeCursor(drw->dpy, cursor->cursor);
|
||||
free(cursor);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
typedef struct {
|
||||
Cursor cursor;
|
||||
} Cur;
|
||||
|
||||
typedef struct Fnt {
|
||||
Display *dpy;
|
||||
unsigned int h;
|
||||
PangoLayout *layout;
|
||||
} Fnt;
|
||||
|
||||
enum { ColFg, ColBg, ColBorder }; /* Clr scheme index */
|
||||
typedef XftColor Clr;
|
||||
|
||||
typedef struct {
|
||||
unsigned int w, h;
|
||||
Display *dpy;
|
||||
int screen;
|
||||
Window root;
|
||||
Drawable drawable;
|
||||
GC gc;
|
||||
Clr *scheme;
|
||||
Fnt *font;
|
||||
} Drw;
|
||||
|
||||
/* Drawable abstraction */
|
||||
Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
|
||||
void drw_resize(Drw *drw, unsigned int w, unsigned int h);
|
||||
void drw_free(Drw *drw);
|
||||
|
||||
/* Fnt abstraction */
|
||||
Fnt *drw_font_create(Drw* drw, const char font[]);
|
||||
void drw_font_free(Fnt* set);
|
||||
unsigned int drw_font_getwidth(Drw *drw, const char *text, Bool markup);
|
||||
void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h, Bool markup);
|
||||
|
||||
/* Colorscheme abstraction */
|
||||
void drw_clr_create(Drw *drw, Clr *dest, const char *clrname);
|
||||
Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount);
|
||||
|
||||
/* Cursor abstraction */
|
||||
Cur *drw_cur_create(Drw *drw, int shape);
|
||||
void drw_cur_free(Drw *drw, Cur *cursor);
|
||||
|
||||
/* Drawing context manipulation */
|
||||
void drw_setscheme(Drw *drw, Clr *scm);
|
||||
|
||||
/* Drawing functions */
|
||||
void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert);
|
||||
int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup);
|
||||
|
||||
/* Map functions */
|
||||
void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h);
|
||||
@@ -0,0 +1,226 @@
|
||||
.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
|
||||
The attach below patch makes newly spawned windows attach after the currently
|
||||
selected window
|
||||
.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 Mod4\-Button1
|
||||
click on a tag label applies that tag to the focused window.
|
||||
.TP
|
||||
.B Mod4\-Button3
|
||||
click on a tag label adds/removes that tag to/from the focused window.
|
||||
.SS Keyboard commands
|
||||
.TP
|
||||
.B Mod4\-Shift\-Return
|
||||
Start
|
||||
.BR st(1).
|
||||
.TP
|
||||
.B Mod4\-p
|
||||
Spawn
|
||||
.BR dmenu(1)
|
||||
for launching other programs.
|
||||
.TP
|
||||
.B Mod4\-,
|
||||
Focus previous screen, if any.
|
||||
.TP
|
||||
.B Mod4\-.
|
||||
Focus next screen, if any.
|
||||
.TP
|
||||
.B Mod4\-Shift\-,
|
||||
Send focused window to previous screen, if any.
|
||||
.TP
|
||||
.B Mod4\-Shift\-.
|
||||
Send focused window to next screen, if any.
|
||||
.TP
|
||||
.B Mod4\-b
|
||||
Toggles bar on and off.
|
||||
.TP
|
||||
.B Mod4\-t
|
||||
Sets tiled layout.
|
||||
.TP
|
||||
.B Mod4\-f
|
||||
Sets floating layout.
|
||||
.TP
|
||||
.B Mod4\-m
|
||||
Sets monocle layout.
|
||||
.TP
|
||||
.B Mod4\-space
|
||||
Toggles between current and previous layout.
|
||||
.TP
|
||||
.B Mod4\-Control\-,
|
||||
Cycles backwards in layout list.
|
||||
.TP
|
||||
.B Mod4\-Control\-.
|
||||
Cycles forwards in layout list.
|
||||
.TP
|
||||
.B Mod4\-j
|
||||
Focus next window.
|
||||
.TP
|
||||
.B Mod4\-k
|
||||
Focus previous window.
|
||||
.TP
|
||||
.B Mod4\-i
|
||||
Increase number of windows in master area.
|
||||
.TP
|
||||
.B Mod4\-d
|
||||
Decrease number of windows in master area.
|
||||
.TP
|
||||
.B Mod4\-l
|
||||
Increase master area size.
|
||||
.TP
|
||||
.B Mod4\-h
|
||||
Decrease master area size.
|
||||
.TP
|
||||
.B Mod4\-Return
|
||||
Zooms/cycles focused window to/from master area (tiled layouts only).
|
||||
.TP
|
||||
.B Mod4\-Shift\-c
|
||||
Close focused window.
|
||||
.TP
|
||||
.B Mod4\-Shift\-space
|
||||
Toggle focused window between tiled and floating state.
|
||||
.TP
|
||||
.B Mod4\-Tab
|
||||
Toggles to the previously selected tags.
|
||||
.TP
|
||||
.B Mod4\-Shift\-[1..n]
|
||||
Apply nth tag to focused window.
|
||||
.TP
|
||||
.B Mod4\-Shift\-0
|
||||
Apply all tags to focused window.
|
||||
.TP
|
||||
.B Mod4\-Control\-Shift\-[1..n]
|
||||
Add/remove nth tag to/from focused window.
|
||||
.TP
|
||||
.B Mod4\-[1..n]
|
||||
View all windows with nth tag.
|
||||
.TP
|
||||
.B Mod4\-0
|
||||
View all windows with any tag.
|
||||
.TP
|
||||
.B Mod4\-Control\-[1..n]
|
||||
Add/remove all windows with nth tag to/from the view.
|
||||
.TP
|
||||
.B Mod4\-Shift\-q
|
||||
Quit dwm.
|
||||
.SS Mouse commands
|
||||
.TP
|
||||
.B Mod4\-Button1
|
||||
Move focused window while dragging. Tiled windows will be toggled to the floating state.
|
||||
.TP
|
||||
.B Mod4\-Button2
|
||||
Toggles focused window between floating and tiled state.
|
||||
.TP
|
||||
.B Mod4\-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, or by setting X resources.
|
||||
.P
|
||||
The following X resource settings can be set:
|
||||
.TP
|
||||
.BI dwm.font
|
||||
defines the font or font set used.
|
||||
.TP
|
||||
.BI dwm.background
|
||||
defines the normal background color.
|
||||
.IR #RGB ,
|
||||
.IR #RRGGBB ,
|
||||
and X color names are supported.
|
||||
.TP
|
||||
.BI dwm.border
|
||||
defines the normal border color
|
||||
.TP
|
||||
.BI dwm.selbackground
|
||||
defines the selected background color
|
||||
.TP
|
||||
.BI dwm.selforeground
|
||||
defines the selected foreground color
|
||||
.TP
|
||||
.BI dwm.selborder
|
||||
defines the selected border color
|
||||
.TP
|
||||
.BI dwm.tabactivebackground
|
||||
defines the background color for active tabs
|
||||
.TP
|
||||
.BI dwm.tabactiveforeground
|
||||
defines the foreground color for active tabs
|
||||
.TP
|
||||
.BI dwm.tabactiveborder
|
||||
defines the border color for active tabs
|
||||
.TP
|
||||
.BI dwm.tabinactivebackground
|
||||
defines the background color for inactive tabs
|
||||
.TP
|
||||
.BI dwm.tabinactiveforeground
|
||||
defines the foreground color for inactive tabs
|
||||
.TP
|
||||
.BI dwm.tabinactiveborder
|
||||
defines the border color for inactive tabs
|
||||
.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.
|
||||
+3259
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 373 B |
@@ -0,0 +1,42 @@
|
||||
/* cc transient.c -o transient -lX11 */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
int main(void) {
|
||||
Display *d;
|
||||
Window r, f, t = None;
|
||||
XSizeHints h;
|
||||
XEvent e;
|
||||
|
||||
d = XOpenDisplay(NULL);
|
||||
if (!d)
|
||||
exit(1);
|
||||
r = DefaultRootWindow(d);
|
||||
|
||||
f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0);
|
||||
h.min_width = h.max_width = h.min_height = h.max_height = 400;
|
||||
h.flags = PMinSize | PMaxSize;
|
||||
XSetWMNormalHints(d, f, &h);
|
||||
XStoreName(d, f, "floating");
|
||||
XMapWindow(d, f);
|
||||
|
||||
XSelectInput(d, f, ExposureMask);
|
||||
while (1) {
|
||||
XNextEvent(d, &e);
|
||||
|
||||
if (t == None) {
|
||||
sleep(5);
|
||||
t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0);
|
||||
XSetTransientForHint(d, t, f);
|
||||
XStoreName(d, t, "transient");
|
||||
XMapWindow(d, t);
|
||||
XSelectInput(d, t, ExposureMask);
|
||||
}
|
||||
}
|
||||
|
||||
XCloseDisplay(d);
|
||||
exit(0);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
void *
|
||||
ecalloc(size_t nmemb, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
if (!(p = calloc(nmemb, size)))
|
||||
die("calloc:");
|
||||
return p;
|
||||
}
|
||||
|
||||
void
|
||||
die(const char *fmt, ...) {
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
|
||||
fputc(' ', stderr);
|
||||
perror(NULL);
|
||||
} else {
|
||||
fputc('\n', stderr);
|
||||
}
|
||||
|
||||
exit(1);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(A, B) ((A) > (B) ? (A) : (B))
|
||||
#endif
|
||||
#ifndef MIN
|
||||
#define MIN(A, B) ((A) < (B) ? (A) : (B))
|
||||
#endif
|
||||
#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
|
||||
|
||||
void die(const char *fmt, ...);
|
||||
void *ecalloc(size_t nmemb, size_t size);
|
||||
Reference in New Issue
Block a user