new package: 'dwm'

TESTING. a ratpoison replacement. set WINDOWMANAGER="dwm" to test it
This commit is contained in:
Stefan Saraev 2013-10-12 16:46:09 +03:00
parent ac2719f5bb
commit 812c058c48
7 changed files with 268 additions and 0 deletions

View File

@ -0,0 +1,48 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
PKG_NAME="dwm"
PKG_VERSION="6.0"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="OSS"
PKG_SITE="http://dwm.suckless.org/"
PKG_URL="http://dl.suckless.org/dwm/dwm-${PKG_VERSION}.tar.gz"
PKG_DEPENDS="libX11 libXinerama"
PKG_BUILD_DEPENDS_TARGET="toolchain libX11 libXinerama"
PKG_PRIORITY="optional"
PKG_SECTION="x11/other"
PKG_SHORTDESC="dwm: dynamic window manager for X"
PKG_LONGDESC="dwm is a dynamic window manager for X. It manages windows in tiled, monocle and floating layouts. All of the layouts can be applied dynamically, optimising the environment for the application in use and the task performed"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
make_target() {
$MAKE LDFLAGS="$LDFLAGS -lX11 -lXinerama -lXft -lfontconfig" CFLAGS="$CFLAGS -DXINERAMA -std=c99" CC="$CC"
}
configure_target() {
:
}
post_install() {
enable_service windowmanager.service
}

View File

@ -0,0 +1,74 @@
From 2e056332a4ef0783f67b430bbb282f8c632984d5 Mon Sep 17 00:00:00 2001
From: Stefan Saraev <stefan@saraev.ca>
Date: Sat, 12 Oct 2013 14:24:16 +0300
Subject: [PATCH 1/5] cleanup and crosscompile
---
Makefile | 20 ++++++--------------
dwm.c | 4 ++--
2 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/Makefile b/Makefile
index b139b54..ca28790 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,6 @@
# dwm - dynamic window manager
# See LICENSE file for copyright and license details.
-include config.mk
-
SRC = dwm.c
OBJ = ${SRC:.c=.o}
@@ -42,19 +40,13 @@ dist: clean
@rm -rf dwm-${VERSION}
install: all
- @echo installing executable file to ${DESTDIR}${PREFIX}/bin
- @mkdir -p ${DESTDIR}${PREFIX}/bin
- @cp -f dwm ${DESTDIR}${PREFIX}/bin
- @chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
- @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
- @mkdir -p ${DESTDIR}${MANPREFIX}/man1
- @sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
- @chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
+ @echo installing executable file to ${DESTDIR}${PREFIX}/usr/bin
+ @mkdir -p ${DESTDIR}${PREFIX}/usr/bin
+ @cp -f dwm ${DESTDIR}${PREFIX}/usr/bin
+ @chmod 755 ${DESTDIR}${PREFIX}/usr/bin/dwm
uninstall:
- @echo removing executable file from ${DESTDIR}${PREFIX}/bin
- @rm -f ${DESTDIR}${PREFIX}/bin/dwm
- @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
- @rm -f ${DESTDIR}${MANPREFIX}/man1/dwm.1
+ @echo removing executable file from ${DESTDIR}${PREFIX}/usr/bin
+ @rm -f ${DESTDIR}${PREFIX}/usr/bin/dwm
.PHONY: all options clean dist install uninstall
diff --git a/dwm.c b/dwm.c
index 1d78655..cb8be1e 100644
--- a/dwm.c
+++ b/dwm.c
@@ -2006,7 +2006,7 @@ updatetitle(Client *c) {
void
updatestatus(void) {
if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
- strcpy(stext, "dwm-"VERSION);
+ strcpy(stext, "dwm");
drawbar(selmon);
}
@@ -2129,7 +2129,7 @@ zoom(const Arg *arg) {
int
main(int argc, char *argv[]) {
if(argc == 2 && !strcmp("-v", argv[1]))
- die("dwm-"VERSION", © 2006-2011 dwm engineers, see LICENSE for details\n");
+ die("dwm, © 2006-2011 dwm engineers, see LICENSE for details\n");
else if(argc != 1)
die("usage: dwm [-v]\n");
if(!setlocale(LC_CTYPE, "") || !XSupportsLocale())
--
1.7.2.5

View File

@ -0,0 +1,19 @@
commit 1040e9440a68bfa50c070f3cf956e46546d54729
Author: Stefan Saraev <stefan@saraev.ca>
Date: Sat Oct 12 16:37:56 2013 +0300
do not die if XAllocNamedColor fails
diff --git a/dwm.c b/dwm.c
index cb8be1e..5f9f419 100644
--- a/dwm.c
+++ b/dwm.c
@@ -932,7 +932,7 @@ getcolor(const char *colstr) {
XColor color;
if(!XAllocNamedColor(dpy, cmap, colstr, &color, &color))
- die("error, cannot allocate color '%s'\n", colstr);
+ printf("error, cannot allocate color '%s'\n", colstr);
return color.pixel;
}

View File

@ -0,0 +1,25 @@
From 71091fbbdf97ad13c13b9f893dd12062e9fcf61d Mon Sep 17 00:00:00 2001
From: Stefan Saraev <stefan@saraev.ca>
Date: Sat, 12 Oct 2013 14:26:11 +0300
Subject: [PATCH 3/5] hide bar
---
config.def.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/config.def.h b/config.def.h
index 77ff358..0c9b846 100644
--- a/config.def.h
+++ b/config.def.h
@@ -10,7 +10,7 @@ static const char selbgcolor[] = "#005577";
static const char selfgcolor[] = "#eeeeee";
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
-static const Bool showbar = True; /* False means no bar */
+static const Bool showbar = False; /* False means no bar */
static const Bool topbar = True; /* False means bottom bar */
/* tagging */
--
1.7.2.5

View File

@ -0,0 +1,28 @@
From 61a6d07989876ee179500e7c50d7783f1d313054 Mon Sep 17 00:00:00 2001
From: Stefan Saraev <stefan@saraev.ca>
Date: Sat, 12 Oct 2013 14:26:29 +0300
Subject: [PATCH 4/5] set default layout to monocle
last window on top and focused
---
config.def.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/config.def.h b/config.def.h
index 0c9b846..422ff0b 100644
--- a/config.def.h
+++ b/config.def.h
@@ -29,9 +29,9 @@ static const Bool resizehints = True; /* True means respect size hints in tiled
static const Layout layouts[] = {
/* symbol arrange function */
+ { "[M]", monocle },
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
};
/* key definitions */
--
1.7.2.5

View File

@ -0,0 +1,58 @@
From 542759343e637727587a3a64794bdff38d45a91c Mon Sep 17 00:00:00 2001
From: Stefan Saraev <stefan@saraev.ca>
Date: Sat, 12 Oct 2013 14:26:51 +0300
Subject: [PATCH 5/5] strip hotkeys
only alt-tab we need
---
config.def.h | 34 +---------------------------------
1 files changed, 1 insertions(+), 33 deletions(-)
diff --git a/config.def.h b/config.def.h
index 422ff0b..4186ec2 100644
--- a/config.def.h
+++ b/config.def.h
@@ -51,39 +51,7 @@ static const char *termcmd[] = { "uxterm", NULL };
static Key keys[] = {
/* modifier key function argument */
- { MODKEY, XK_p, spawn, {.v = dmenucmd } },
- { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
- { MODKEY, XK_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, XK_Tab, focusstack, {.i = +1 } },
};
/* button definitions */
--
1.7.2.5

View File

@ -0,0 +1,16 @@
[Unit]
Description=dwm Window Manager
Requires=xorg.service
After=xorg.service
Before=xbmc.service
[Service]
Environment=DISPLAY=:0
ExecStart=/usr/bin/dwm
KillMode=process
Restart=always
RestartSec=1
StartLimitInterval=0
[Install]
WantedBy=graphical.target