# HG changeset patch # User Christophe Lincoln # Date 1236465648 -3600 # Node ID 6a44a2d57a0f718e2e58fdeb82cdb8cbcd4de343 # Parent 954adaf2445692975fd0dc1ef4630c8bf47ae98d Add dwm (Dynamic Window Manager for 16Kb pkg diff -r 954adaf24456 -r 6a44a2d57a0f dwm/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwm/receipt Sat Mar 07 23:40:48 2009 +0100 @@ -0,0 +1,57 @@ +# SliTaz package receipt. + +PACKAGE="dwm" +VERSION="5.4.1" +CATEGORY="x-window" +SHORT_DESC="Very light dynamic window manager for X." +MAINTAINER="pankso@slitaz.org" +TARBALL="$PACKAGE-$VERSION.tar.gz" +WEB_SITE="http://www.suckless.org/dwm/" +WGET_URL="http://code.suckless.org/dl/dwm/$TARBALL" +DEPENDS="xorg-libX11 xorg-xsetroot" +BUILD_DEPENDS="xorg-libX11-dev" + +# Rules to configure and make the package. +compile_rules() +{ + cd $src + # From blue to brown and have lighter grey + sed -i s/'#0066ff'/'#754800'/g config.def.h + sed -i s/'#cccccc'/'#f1efeb'/g config.def.h + # 6 tag-mask + sed -i s/', "7", "8", "9"'// config.def.h + # Firefox on current tag-mask + sed -i s/'1 << 8,'/'0, '/ config.def.h + # [Shift]+[Alt]+[Enter] + sed -i s/uxterm/xterm/ config.def.h + make +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/bin + cp -a $src/dwm $fs/usr/bin + cp -a stuff/dwm-session $fs/usr/bin + cp -a stuff/dwmbox $fs/usr/bin + chown 0.0 $fs/usr/bin/* +} + +post_install() +{ + res=`cat $1/etc/slim.conf | grep ^session | sed s/"sessions. *"//` + # Adding WM to SLIM available sessions. + if ! echo "$res" | grep -q $PACKAGE; then + echo -n "Adding $PACKAGE to /etc/slim.conf..." + sed -i "s/^sessions.*/sessions ${res},dwm/" /etc/slim.conf + status + fi +} + +post_remove() +{ + # Remove karmen from SLIM available sessions. + if grep -q dwm $1/etc/slim.conf; then + sed -i s/,dwm// $1/etc/slim.conf + fi +} diff -r 954adaf24456 -r 6a44a2d57a0f dwm/stuff/dwm-session --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwm/stuff/dwm-session Sat Mar 07 23:40:48 2009 +0100 @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Start dwm X session on SliTaz +# + +CONFIG_DIR="$HOME/.config/dwm" +AUTOSTART_SCRIPT="${CONFIG_DIR}/autostart.sh" + +[ ! -d "$CONFIG_DIR" ] && mkdir -p $CONFIG_DIR + +if [ ! -f "$AUTOSTART_SCRIPT" ]; then + cat > $AUTOSTART_SCRIPT << EOF +# This script is executed before dwm session starts on SliTaz. +# + +# Background color +xsetroot -solid DarkGoldenrod4 & + +# GTK interface to manage session. +dwmbox & + +# Sleep 2 sec to let the terminal use main side. +sleep 2 + +# Launch a X terminal. +xterm -bg black -fg white & +EOF +fi + +# Source autostarted applications. +. $AUTOSTART_SCRIPT + +# Execute the Window manager. +exec dwm + +exit 0 diff -r 954adaf24456 -r 6a44a2d57a0f dwm/stuff/dwmbox --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwm/stuff/dwmbox Sat Mar 07 23:40:48 2009 +0100 @@ -0,0 +1,70 @@ +#!/bin/sh +# +# Tiny GTKdialog box to help stating and usinf dwm. +# (c) 2009 SliTaz GNU/Linux project - GNU gpl v3 +# + +export CONFIG_DIR="~/.config/dwm" +export AUTOSTART_SCRIPT="${CONFIG_DIR}/autostart.sh" + +box() +{ + export BOX=' + + + + + + + + + + RUN + + + + + + + + + + +' + gtkdialog --center --program=BOX +} + +case $1 in + *_*) + # Exec all function called by args (must have an underscore). + $1 ;; + *) + sleep 1 + box ;; +esac + +exit 0