wok-current rev 12408

karmen: better integration and use XDG standard
author Christophe Lincoln <pankso@slitaz.org>
date Fri Apr 20 18:05:26 2012 +0200 (2012-04-20)
parents 612c43caa4ec
children 4db4ca0c9c3e
files karmen/receipt karmen/stuff/etc/xdg/karmen/autostart.sh karmen/stuff/etc/xdg/karmen/wbar karmen/stuff/karmen-conf karmen/stuff/karmen-session karmen/stuff/xsessions/karmen.desktop
line diff
     1.1 --- a/karmen/receipt	Fri Apr 20 18:04:27 2012 +0200
     1.2 +++ b/karmen/receipt	Fri Apr 20 18:05:26 2012 +0200
     1.3 @@ -8,28 +8,30 @@
     1.4  TARBALL="$PACKAGE-$VERSION.tar.gz"
     1.5  WEB_SITE="http://karmen.sourceforge.net/"
     1.6  WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
     1.7 -DEPENDS="xorg-libX11 xorg-xsetroot wbar"
     1.8 +TAGS="wm window-manager"
     1.9 +
    1.10 +DEPENDS="xorg-libX11 xorg-xsetroot nano xterm xorg-xclock dialog"
    1.11  BUILD_DEPENDS="xorg-libX11-dev"
    1.12 -TAGS="wm window-manager"
    1.13  
    1.14  # Rules to configure and make the package.
    1.15  compile_rules()
    1.16  {
    1.17  	cd $src
    1.18 -	./configure --prefix=/usr &&
    1.19 -	make &&
    1.20 -	make DESTDIR=$PWD/_pkg install
    1.21 +	./configure --prefix=/usr \
    1.22 +		$CONFIGURE_ARGS &&
    1.23 +	make && make install
    1.24  }
    1.25  
    1.26  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.27  genpkg_rules()
    1.28  {
    1.29 -	mkdir -p $fs/usr
    1.30 +	mkdir -p $fs/usr/share
    1.31  	cp -a $_pkg/usr/bin $fs/usr
    1.32  	# Custom configuration and scripts.
    1.33 -	cp -a stuff/karmen-session $fs/usr/bin
    1.34 -	cp -a stuff/karmen-conf $fs/usr/bin
    1.35 -	cp -a stuff/etc $fs
    1.36 +	install -m 0755 $stuff/karmen-session $fs/usr/bin
    1.37 +	install -m 0755 $stuff/karmen-conf $fs/usr/bin
    1.38 +	cp -a $stuff/xsessions $fs/usr/share
    1.39 +	cp -a $stuff/etc $fs
    1.40  	chown 0.0 $fs/usr/bin/*
    1.41  }
    1.42  
    1.43 @@ -39,7 +41,7 @@
    1.44  	# Adding WM to SLIM available sessions.
    1.45  	if ! echo "$res" | grep -q $PACKAGE; then
    1.46  		echo -n "Adding $PACKAGE to /etc/slim.conf..."
    1.47 -		sed -i "s/^sessions.*/sessions            ${res},$PACKAGE/" /etc/slim.conf
    1.48 +		sed -i "s/^sessions.*/sessions            ${res},$PACKAGE/" $1/etc/slim.conf
    1.49  		status
    1.50  	fi
    1.51  }
     2.1 --- a/karmen/stuff/etc/xdg/karmen/autostart.sh	Fri Apr 20 18:04:27 2012 +0200
     2.2 +++ b/karmen/stuff/etc/xdg/karmen/autostart.sh	Fri Apr 20 18:05:26 2012 +0200
     2.3 @@ -5,9 +5,13 @@
     2.4  xsetroot -solid grey4 &
     2.5  
     2.6  # Cursor setting.
     2.7 -xsetroot -cursor_name arrow
     2.8 +xsetroot -cursor_name arrow &
     2.9  
    2.10 -# Wbar icons panel with a custom config file for Karmen providing
    2.11 -# a settings and logout function.
    2.12 -(sleep 2 && wbar -config $HOME/.config/karmen/wbar -pos top center \
    2.13 -	-jumpf 0 -zoomf 1.8 -isize 24 -bpress -balfa 0) &
    2.14 +# Start an Xterm.
    2.15 +xterm &
    2.16 +
    2.17 +# Start Karmen configurator/menu
    2.18 +xterm -geometry 50x20 -e karmen-conf &
    2.19 +
    2.20 +# Xclock
    2.21 +xclock &
     3.1 --- a/karmen/stuff/etc/xdg/karmen/wbar	Fri Apr 20 18:04:27 2012 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,16 +0,0 @@
     3.4 -# The Bar && Font
     3.5 -i: /usr/share/wbar/iconpack/osxbarback.png
     3.6 -t: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans/12
     3.7 -c:
     3.8 -
     3.9 -i: /usr/share/pixmaps/xterm.png
    3.10 -c: /usr/bin/xterm
    3.11 -t: Terminal
    3.12 -
    3.13 -i: /usr/share/pixmaps/preferences.png
    3.14 -c: /usr/bin/xterm -e 'karmen-conf'
    3.15 -t: Karmen configuration
    3.16 -
    3.17 -i: /usr/share/pixmaps/logout.png
    3.18 -c: /usr/bin/killall karmen
    3.19 -t: Logout
     4.1 --- a/karmen/stuff/karmen-conf	Fri Apr 20 18:04:27 2012 +0200
     4.2 +++ b/karmen/stuff/karmen-conf	Fri Apr 20 18:05:26 2012 +0200
     4.3 @@ -11,35 +11,31 @@
     4.4  --title " Karmen settings " \
     4.5  --menu "" 15 70 5 \
     4.6  "autostart" "Autostarted applications" \
     4.7 -"wbar" "Wbat icons panel configuration" \
     4.8 -"quit" "Exit Karmen configuration" \
     4.9 +"exitwm" "Exit Karmen session" \
    4.10 +"reboot" "Reboot system" \
    4.11 +"quit" "Quit Karmen configuration" \
    4.12  2>&1 1>&3`
    4.13  retval=$?
    4.14  exec 3>&-
    4.15 +
    4.16  case $retval in
    4.17 -	0)
    4.18 -		continue ;;
    4.19 -	1)
    4.20 -		echo "Cancel pressed."
    4.21 -		exit 0 ;;
    4.22 +	0) continue ;;
    4.23 +	1) echo "Cancel pressed." && exit 0 ;;
    4.24  	255)
    4.25  		if test -n "$value"; then
    4.26  			echo "$value"
    4.27  		else
    4.28 -			echo "ESC pressed."
    4.29 -			exit 0
    4.30 +			echo "ESC pressed." && exit 0
    4.31  		fi ;;
    4.32  esac
    4.33  
    4.34  case $value in
    4.35  	autostart)
    4.36  		nano $CONFIG_DIR/autostart.sh 
    4.37 -		exec $PWD/karmen-dialog ;;
    4.38 -	wbar)
    4.39 -		nano $CONFIG_DIR/wbar
    4.40 -		exec $PWD/karmen-dialog ;;
    4.41 -	quit)
    4.42 -		continue ;;
    4.43 +		exec $(basename $0) ;;
    4.44 +	exitwm) killall karmen ;;
    4.45 +	reboot) reboot || reboot -f ;;
    4.46 +	quit) continue ;;
    4.47  esac
    4.48  
    4.49  exit 0
     5.1 --- a/karmen/stuff/karmen-session	Fri Apr 20 18:04:27 2012 +0200
     5.2 +++ b/karmen/stuff/karmen-session	Fri Apr 20 18:05:26 2012 +0200
     5.3 @@ -3,14 +3,15 @@
     5.4  # Start Karmen X session on SliTaz
     5.5  #
     5.6  
     5.7 -CONFIG_DIR="$HOME/.config/karmen"
     5.8 -AUTOSTART_SCRIPT="${CONFIG_DIR}/autostart.sh"
     5.9 +export XDG_CONFIG_HOME="$HOME/.config"
    5.10 +export XDG_CURRENT_DESKTOP=karmen
    5.11 +AUTOSTART_SCRIPT="${XDG_CONFIG_HOME}/karmen/autostart.sh"
    5.12  
    5.13  # These file are provided by SliTaz to provide a better experience
    5.14  # with Karmen. Autostart script for applications and Wbar with a logout
    5.15  # icon.
    5.16 -if [ ! -d "$CONFIG_DIR" ]; then
    5.17 -	cp -a /etc/xdg/karmen $CONFIG_DIR
    5.18 +if [ ! -d "$XDG_CONFIG_HOME/karmen" ]; then
    5.19 +	cp -r /etc/xdg/karmen $XDG_CONFIG_HOME
    5.20  fi
    5.21  
    5.22  # Source autostarted applications.
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/karmen/stuff/xsessions/karmen.desktop	Fri Apr 20 18:05:26 2012 +0200
     6.3 @@ -0,0 +1,5 @@
     6.4 +[Desktop Entry]
     6.5 +Encoding=UTF-8
     6.6 +Type=XSession
     6.7 +Name=Karmen Session
     6.8 +Exec=karmen