wok-current rev 2378
Add dwm (Dynamic Window Manager for 16Kb pkg
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Mar 07 23:40:48 2009 +0100 (2009-03-07) |
parents | 954adaf24456 |
children | fc83f21345f3 |
files | dwm/receipt dwm/stuff/dwm-session dwm/stuff/dwmbox |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dwm/receipt Sat Mar 07 23:40:48 2009 +0100 1.3 @@ -0,0 +1,57 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="dwm" 1.7 +VERSION="5.4.1" 1.8 +CATEGORY="x-window" 1.9 +SHORT_DESC="Very light dynamic window manager for X." 1.10 +MAINTAINER="pankso@slitaz.org" 1.11 +TARBALL="$PACKAGE-$VERSION.tar.gz" 1.12 +WEB_SITE="http://www.suckless.org/dwm/" 1.13 +WGET_URL="http://code.suckless.org/dl/dwm/$TARBALL" 1.14 +DEPENDS="xorg-libX11 xorg-xsetroot" 1.15 +BUILD_DEPENDS="xorg-libX11-dev" 1.16 + 1.17 +# Rules to configure and make the package. 1.18 +compile_rules() 1.19 +{ 1.20 + cd $src 1.21 + # From blue to brown and have lighter grey 1.22 + sed -i s/'#0066ff'/'#754800'/g config.def.h 1.23 + sed -i s/'#cccccc'/'#f1efeb'/g config.def.h 1.24 + # 6 tag-mask 1.25 + sed -i s/', "7", "8", "9"'// config.def.h 1.26 + # Firefox on current tag-mask 1.27 + sed -i s/'1 << 8,'/'0, '/ config.def.h 1.28 + # [Shift]+[Alt]+[Enter] 1.29 + sed -i s/uxterm/xterm/ config.def.h 1.30 + make 1.31 +} 1.32 + 1.33 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.34 +genpkg_rules() 1.35 +{ 1.36 + mkdir -p $fs/usr/bin 1.37 + cp -a $src/dwm $fs/usr/bin 1.38 + cp -a stuff/dwm-session $fs/usr/bin 1.39 + cp -a stuff/dwmbox $fs/usr/bin 1.40 + chown 0.0 $fs/usr/bin/* 1.41 +} 1.42 + 1.43 +post_install() 1.44 +{ 1.45 + res=`cat $1/etc/slim.conf | grep ^session | sed s/"sessions. *"//` 1.46 + # Adding WM to SLIM available sessions. 1.47 + if ! echo "$res" | grep -q $PACKAGE; then 1.48 + echo -n "Adding $PACKAGE to /etc/slim.conf..." 1.49 + sed -i "s/^sessions.*/sessions ${res},dwm/" /etc/slim.conf 1.50 + status 1.51 + fi 1.52 +} 1.53 + 1.54 +post_remove() 1.55 +{ 1.56 + # Remove karmen from SLIM available sessions. 1.57 + if grep -q dwm $1/etc/slim.conf; then 1.58 + sed -i s/,dwm// $1/etc/slim.conf 1.59 + fi 1.60 +}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/dwm/stuff/dwm-session Sat Mar 07 23:40:48 2009 +0100 2.3 @@ -0,0 +1,36 @@ 2.4 +#!/bin/sh 2.5 +# 2.6 +# Start dwm X session on SliTaz 2.7 +# 2.8 + 2.9 +CONFIG_DIR="$HOME/.config/dwm" 2.10 +AUTOSTART_SCRIPT="${CONFIG_DIR}/autostart.sh" 2.11 + 2.12 +[ ! -d "$CONFIG_DIR" ] && mkdir -p $CONFIG_DIR 2.13 + 2.14 +if [ ! -f "$AUTOSTART_SCRIPT" ]; then 2.15 + cat > $AUTOSTART_SCRIPT << EOF 2.16 +# This script is executed before dwm session starts on SliTaz. 2.17 +# 2.18 + 2.19 +# Background color 2.20 +xsetroot -solid DarkGoldenrod4 & 2.21 + 2.22 +# GTK interface to manage session. 2.23 +dwmbox & 2.24 + 2.25 +# Sleep 2 sec to let the terminal use main side. 2.26 +sleep 2 2.27 + 2.28 +# Launch a X terminal. 2.29 +xterm -bg black -fg white & 2.30 +EOF 2.31 +fi 2.32 + 2.33 +# Source autostarted applications. 2.34 +. $AUTOSTART_SCRIPT 2.35 + 2.36 +# Execute the Window manager. 2.37 +exec dwm 2.38 + 2.39 +exit 0
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/dwm/stuff/dwmbox Sat Mar 07 23:40:48 2009 +0100 3.3 @@ -0,0 +1,70 @@ 3.4 +#!/bin/sh 3.5 +# 3.6 +# Tiny GTKdialog box to help stating and usinf dwm. 3.7 +# (c) 2009 SliTaz GNU/Linux project - GNU gpl v3 3.8 +# 3.9 + 3.10 +export CONFIG_DIR="~/.config/dwm" 3.11 +export AUTOSTART_SCRIPT="${CONFIG_DIR}/autostart.sh" 3.12 + 3.13 +box() 3.14 +{ 3.15 + export BOX=' 3.16 +<window title="dwm" icon-name="video-display"> 3.17 +<vbox> 3.18 + <vbox> 3.19 + <text> 3.20 + <label> 3.21 +" 3.22 +Dynamic Window Manager: [Shift+Alt+ENTER] to open a terminal. 3.23 +" 3.24 + </label> 3.25 + </text> 3.26 + </vbox> 3.27 + <hbox> 3.28 + <entry> 3.29 + <variable>RUN</variable> 3.30 + </entry> 3.31 + <button> 3.32 + <label>Run</label> 3.33 + <input file icon="forward"></input> 3.34 + <action>$RUN &</action> 3.35 + </button> 3.36 + </hbox> 3.37 + <hbox> 3.38 + <button> 3.39 + <label>Terminal</label> 3.40 + <input file icon="xterm"></input> 3.41 + <action>xterm &</action> 3.42 + </button> 3.43 + <button> 3.44 + <label>Autostarted apps</label> 3.45 + <input file icon="gtk-edit"></input> 3.46 + <action>xterm -e "nano $AUTOSTART_SCRIPT" &</action> 3.47 + </button> 3.48 + <button> 3.49 + <label>Close box</label> 3.50 + <input file icon="gtk-close"></input> 3.51 + <action type="exit">exit</action> 3.52 + </button> 3.53 + <button> 3.54 + <label>Exit dwm</label> 3.55 + <input file icon="gtk-quit"></input> 3.56 + <action>killall dwm</action> 3.57 + </button> 3.58 + </hbox> 3.59 +</vbox> 3.60 +</window>' 3.61 + gtkdialog --center --program=BOX 3.62 +} 3.63 + 3.64 +case $1 in 3.65 + *_*) 3.66 + # Exec all function called by args (must have an underscore). 3.67 + $1 ;; 3.68 + *) 3.69 + sleep 1 3.70 + box ;; 3.71 +esac 3.72 + 3.73 +exit 0