slitaz-tools rev 158 2.0

Modified tazx for Openbox as default WM
author Christophe Lincoln <pankso@slitaz.org>
date Tue Apr 22 22:58:03 2008 +0200 (2008-04-22)
parents 871550a2fc88
children 8a91091fc00a
files tinyutils/jwmbgconf tinyutils/mountbox tinyutils/slitaz-installer.sh tinyutils/tazx
line diff
     1.1 --- a/tinyutils/jwmbgconf	Mon Apr 21 11:26:09 2008 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,79 +0,0 @@
     1.4 -#!/bin/sh
     1.5 -# 
     1.6 -# Gtkdialog box to change JWM backgroud.
     1.7 -# - SliTaz GNU/Linux 2008.
     1.8 -#
     1.9 -VERSION=20080305
    1.10 -
    1.11 -# Get current image zype and path.
    1.12 -LINE=`cat ~/.jwmrc | grep -w '^      <Background type='`
    1.13 -TYPE=${LINE#*=\"}
    1.14 -TYPE=${TYPE%%\"\>*}
    1.15 -BG_PATH=${LINE#*\"$TYPE\">}
    1.16 -export BG_PATH=${BG_PATH%</Background>}
    1.17 -
    1.18 -# We need an actions to be executed by another window dialog
    1.19 -# to get values from the main dialog variables.
    1.20 -export ACTION='
    1.21 -  <vbox>
    1.22 -    <text use-markup="true" width-chars="28">
    1.23 -      <label>
    1.24 -"
    1.25 -<b>Changing JWM background</b>
    1.26 -"
    1.27 -      </label>
    1.28 -    </text>
    1.29 -    <progressbar>
    1.30 -      <label>Please wait...</label>
    1.31 -      <action>sed -i s#$BG_PATH#$NEW_PATH# $HOME/.jwmrc</action>
    1.32 -      <input>echo 50; jwm -restart; echo 100</input>
    1.33 -      <action type="closewindow">ACTION</action>
    1.34 -    </progressbar>
    1.35 -  </vbox>
    1.36 -'
    1.37 -
    1.38 -# Image type, path and reload button. We use \" to be Ash compatible.
    1.39 -#
    1.40 -export BG_DIALOG="
    1.41 -<window title=\"JWM Background\">
    1.42 -  <vbox>
    1.43 -    
    1.44 -        <text use-markup=\"true\" width-chars=\"50\">
    1.45 -      <label>
    1.46 -\"
    1.47 -<b>Wallpaper - JWM Background image</b>
    1.48 -\"
    1.49 -</label>
    1.50 -    </text>
    1.51 -      
    1.52 -      <hbox>
    1.53 -        <entry>
    1.54 -          <default>$BG_PATH</default>
    1.55 -          <variable>NEW_PATH</variable>
    1.56 -        </entry>
    1.57 -        <button>
    1.58 -          <input file icon=\"image\"></input>
    1.59 -          <action type=\"fileselect\">NEW_PATH</action>
    1.60 -        </button>
    1.61 -      </hbox>
    1.62 -    
    1.63 -    <hbox>
    1.64 -      <button>
    1.65 -        <label>Change Wallpaper</label>
    1.66 -        <input file icon=\"reload\"></input>
    1.67 -        <action type=\"launch\">ACTION</action>
    1.68 -      </button>
    1.69 -      <button>
    1.70 -        <input file icon=\"exit\"></input>
    1.71 -        <action type=\"exit\">Exit</action>
    1.72 -      </button>
    1.73 -    </hbox>
    1.74 -  
    1.75 -  </vbox>
    1.76 -</window>
    1.77 -"
    1.78 -
    1.79 -# Execute main dialog.
    1.80 -gtkdialog --program=BG_DIALOG
    1.81 -
    1.82 -exit 0
     2.1 --- a/tinyutils/mountbox	Mon Apr 21 11:26:09 2008 +0000
     2.2 +++ b/tinyutils/mountbox	Tue Apr 22 22:58:03 2008 +0200
     2.3 @@ -138,7 +138,7 @@
     2.4        <button>
     2.5          <label>Browse</label>
     2.6          <input file icon="folder"></input>
     2.7 -        <action>emelfm2 --one=$MOUNT_POINT</action>
     2.8 +        <action>pcmanfm $MOUNT_POINT</action>
     2.9        </button>
    2.10        <button>
    2.11          <label>Eject</label>
     3.1 --- a/tinyutils/slitaz-installer.sh	Mon Apr 21 11:26:09 2008 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,330 +0,0 @@
     3.4 -#!/bin/sh
     3.5 -# slitaz-installer.sh - SliTaz GNU/Linux installer script.
     3.6 -#
     3.7 -# So this is SliTaz installer all in SHell script compatible Ash from Busybox.
     3.8 -# All the comments are in English but displayed messages are in French. The 
     3.9 -# scrip starts with a few main variables, then all the functions and then
    3.10 -# a sequece of functions.
    3.11 -#
    3.12 -# (C) 2007-2008 SliTaz - GNU General Public License v3.
    3.13 -#
    3.14 -# Author : Christophe Lincoln <pankso@slitaz.org>
    3.15 -#
    3.16 -VERSION=0.1
    3.17 -
    3.18 -# We need to know cdrom device and kernel version string
    3.19 -# to copy files.
    3.20 -DRIVE_NAME=`cat /proc/sys/dev/cdrom/info | grep "drive name" | cut -f 3`
    3.21 -CDROM=/dev/$DRIVE_NAME
    3.22 -TARGET_ROOT=/mnt/target
    3.23 -KERNEL=vmlinuz-`uname -r`
    3.24 -
    3.25 -#######################
    3.26 -# Installer functions #
    3.27 -#######################
    3.28 -
    3.29 -# Status function.
    3.30 -status()
    3.31 -{
    3.32 -	local CHECK=$?
    3.33 -	echo -en "\\033[70G[ "
    3.34 -	if [ $CHECK = 0 ]; then
    3.35 -		echo -en "\\033[1;33mOK"
    3.36 -	else
    3.37 -		echo -en "\\033[1;31mFailed"
    3.38 -	fi
    3.39 -	echo -e "\\033[0;39m ]"
    3.40 -}
    3.41 -
    3.42 -# Start install with basic informations.
    3.43 -start_infos()
    3.44 -{
    3.45 -	clear
    3.46 -	echo ""
    3.47 -	echo -e "\033[1mSliTaz GNU/Linux - Installateur mode texte\033[0m
    3.48 -================================================================================
    3.49 -
    3.50 -Bienvenue dans l'installateur en mode texte de SliTaz GNU/Linux. Il vous
    3.51 -suffirat de répondre à quelques questions lors des différentes étapes
    3.52 -d'installation. Avant de commencer, assurer vous de connaître le nom de la
    3.53 -partitions sur laquelle vous désirez installer SliTaz. L'installateur va
    3.54 -commencer par vous proposer de formater la partition cible et la monter.
    3.55 -Ensuite il va monter le cdrom, décompresser les fichiers et les installer
    3.56 -sur la cible. Pour finir, vous aurez aussi la possibilité d'installer le 
    3.57 -gestionnaire de démarrage GRUB, si besoin est. A noter que pour continuer
    3.58 -cette installation, vous devez avoir les droits d'administrateur root, qui
    3.59 -peuvent s'obtenir via la commande 'su' et le mot de passe 'root'.
    3.60 -
    3.61 -================================================================================"
    3.62 -	echo ""
    3.63 -	echo -n "Commencer l'installation (oui/Non) ? "; read anser
    3.64 -	if [ ! "$anser" = "oui" ]; then
    3.65 -		echo -e "\nArrêt volontaire.\n"
    3.66 -		exit 0
    3.67 -	fi
    3.68 -}
    3.69 -
    3.70 -# Exit install if user is not root.
    3.71 -check_root()
    3.72 -{
    3.73 -	if test $(id -u) != 0 ; then
    3.74 -	   echo -e "
    3.75 -Vous devez être root pour continuer l'installation du système. Arrêt.
    3.76 -Vous pouvez utiliser 'su' suivi du mot de passe root pour devenir 
    3.77 -administarteur.\n"
    3.78 -	   exit 0
    3.79 -	fi
    3.80 -}
    3.81 -
    3.82 -# Display a list of available partition.
    3.83 -fdisk_list()
    3.84 -{
    3.85 -	echo ""
    3.86 -	fdisk -l | grep ^/dev
    3.87 -	echo ""
    3.88 -}
    3.89 -
    3.90 -# We need a partition to install.
    3.91 -ask_for_target_dev()
    3.92 -{
    3.93 -	echo ""
    3.94 -	echo -e "\033[1mPartition racine\033[0m
    3.95 -================================================================================
    3.96 -
    3.97 -Veuilliez indiquer la partition à utiliser pour installer SliTaz GNU/Linux,
    3.98 -exemple : '/dev/hda1'. Vous pouvez tapez 'list' pour afficher une liste 
    3.99 -des partitions disponibles sur le ou les disques durs."
   3.100 -	echo ""
   3.101 -	echo -n "Partition à utiliser : "; read anser
   3.102 -	while [ "$anser" == "list" ]; do
   3.103 -		fdisk_list
   3.104 -		echo -n "Partition à utiliser : "; read anser
   3.105 -	done
   3.106 -	if [ "$anser" == "" ]; then
   3.107 -		echo -e "\nPas de partition spécifiée. Arrêt.\n"
   3.108 -		exit 0
   3.109 -	else
   3.110 -		TARGET_DEV=$anser
   3.111 -	fi
   3.112 -}
   3.113 -
   3.114 -# Mkfs if needed/wanted.
   3.115 -mkfs_target_dev()
   3.116 -{
   3.117 -	echo ""
   3.118 -	echo "SliTaz va être installé sur la partition : $TARGET_DEV"
   3.119 -	echo ""
   3.120 -	echo -n "Faut t'il formater la partition en ext3 (oui/Non) ? "; read anser
   3.121 -	if [ "$anser" == "oui" ]; then
   3.122 -		mkfs.ext3 $TARGET_DEV
   3.123 -	else
   3.124 -		echo "Le système de fichiers déjà présent sera utilisé..."
   3.125 -	fi
   3.126 -}
   3.127 -
   3.128 -# Mount target device and cdrom.
   3.129 -mount_devices()
   3.130 -{
   3.131 -	echo ""
   3.132 -	mkdir -p $TARGET_ROOT /media/cdrom
   3.133 -	echo "Montage de la partitions et du cdrom..."
   3.134 -	# Mount points can be already used.
   3.135 -	if mount | grep $TARGET_ROOT; then
   3.136 -		umount $TARGET_ROOT
   3.137 -	fi
   3.138 -	if mount | grep /media/cdrom; then
   3.139 -		umount /media/cdrom
   3.140 -	fi
   3.141 -	mount $TARGET_DEV $TARGET_ROOT
   3.142 -	mount -t iso9660 $CDROM /media/cdrom || exit 1
   3.143 -}
   3.144 -
   3.145 -# Copy and install Kernel.
   3.146 -install_kernel()
   3.147 -{
   3.148 -	echo ""
   3.149 -	echo -n "Création du répertoire /boot..."
   3.150 -	mkdir -p $TARGET_ROOT/boot
   3.151 -	status
   3.152 -	echo -n "Copie du noyau Linux..."
   3.153 -	cp /media/cdrom/boot/bzImage $TARGET_ROOT/boot/$KERNEL
   3.154 -	status
   3.155 -}
   3.156 -
   3.157 -# Syslinux/isolinux.
   3.158 -copy_bootloaders()
   3.159 -{
   3.160 -	echo -n "Copie des bootloaders syslinux/isolinux..."
   3.161 -	if [ -d "/media/cdrom/boot/syslinux" ]; then
   3.162 -		cp -a /media/cdrom/boot/syslinux $TARGET_ROOT/boot
   3.163 -	fi
   3.164 -	if [ -d "/media/cdrom/boot/isolinux" ]; then
   3.165 -		cp -a /media/cdrom/boot/isolinux $TARGET_ROOT/boot
   3.166 -	fi
   3.167 -	status
   3.168 -}
   3.169 -
   3.170 -# Copy and extract lzma'ed or gziped rootfs.
   3.171 -copy_extract_rootfs()
   3.172 -{
   3.173 -	echo -n "Copie du système de fichier racine..."
   3.174 -	cp /media/cdrom/boot/rootfs.gz $TARGET_ROOT
   3.175 -	status
   3.176 -	echo "Extraction du système de fichiers racine (rootfs.gz)..."
   3.177 -	cd $TARGET_ROOT
   3.178 -	( zcat rootfs.gz 2>/dev/null || lzma d rootfs.gz -so 2>/dev/null || \
   3.179 -	  cat rootfs.gz ) | cpio -id
   3.180 -	# unpack /usr
   3.181 -	for i in etc/tazlito/*.extract; do
   3.182 -		[ -f "$i" ] && . $i /media/cdrom
   3.183 -	done
   3.184 -	sqfs="/cdrom/usr.sqfs"
   3.185 -	[ -f $sqfs ] || sqfs=".usr.sqfs"
   3.186 -	if [ -f $sqfs ]; then
   3.187 -		echo -en "\nDécompression de /usr... "
   3.188 -		rmdir usr
   3.189 -		sbin/unsquashfs -d usr $sqfs
   3.190 -		[ "$sqfs" = ".usr.sqfs" ] && rm -f $sqfs
   3.191 -	fi
   3.192 -	cromfs="/media/cdrom/usr.cromfs"
   3.193 -	[ -f $cromfs ] || cromfs=".usr.cromfs"
   3.194 -	if [ -f $cromfs ]; then
   3.195 -		rmdir usr
   3.196 -		bin/unmkcromfs $cromfs usr
   3.197 -		[ "$cromfs" = ".usr.cromfs" ] && rm -f $cromfs
   3.198 -	fi
   3.199 -	if [ -d usr/.moved ]; then
   3.200 -		echo -en "\nRestoration des fichiers déplacés dans /usr... "
   3.201 -		( cd usr/.moved ; find * -print ) | \
   3.202 -		while read file; do
   3.203 -			[ -L "$file" ] || continue
   3.204 -			rm -f "$file"
   3.205 -			mv "usr/.moved/$file" "$file"
   3.206 -		done
   3.207 -		rm -rf usr/.moved
   3.208 -	fi
   3.209 -	echo ""
   3.210 -	echo -n "Suppression des fichiers copiés..."
   3.211 -	rm -f rootfs.gz init
   3.212 -	status
   3.213 -}
   3.214 -
   3.215 -# Pre configure freshly installed system.
   3.216 -pre_config_system()
   3.217 -{
   3.218 -	# /etc/skel with hacker default personnal files.
   3.219 -	echo -n "Copie des fichiers personnels de hacker dans : /etc/skel..."
   3.220 -	cp -a $TARGET_ROOT/home/hacker $TARGET_ROOT/etc/skel
   3.221 -	status
   3.222 -	# Add root device to CHECK_FS in rcS.conf to check filesystem 
   3.223 -	# on each boot.
   3.224 -	echo -n "Configuration de CHECK_FS dans /etc/rcS.conf..."
   3.225 -	sed -i s#'CHECK_FS=\"\"'#"CHECK_FS=\"$TARGET_DEV\""# $TARGET_ROOT/etc/rcS.conf	
   3.226 -	status
   3.227 -	sleep 2
   3.228 -}
   3.229 -
   3.230 -# Determin disk letter, GRUB partition number and GRUB disk number.
   3.231 -grub_install()
   3.232 -{
   3.233 -	DISK_LETTER=${TARGET_DEV#/dev/[h-s]d}
   3.234 -	DISK_LETTER=${DISK_LETTER%[0-9]}
   3.235 -	GRUB_PARTITION=$((${TARGET_DEV#/dev/[h-s]d[a-z]}-1))
   3.236 -	for disk in a b c d e f g h
   3.237 -	do
   3.238 -		nb=$(($nb+1))
   3.239 -		if [ "$disk" = "$DISK_LETTER" ]; then
   3.240 -			GRUB_DISK=$(($nb-1))
   3.241 -			break
   3.242 -		fi
   3.243 -	done
   3.244 -	GRUB_ROOT="(hd${GRUB_DISK},${GRUB_PARTITION})"
   3.245 -
   3.246 -	# Creat the target GRUB configuration.
   3.247 -	echo -n "Création du fichier de configuration de GRUB (menu.lst)..."
   3.248 -	mkdir -p $TARGET_ROOT/boot/grub
   3.249 -	cat > $TARGET_ROOT/boot/grub/menu.lst << _EOF_
   3.250 -# /boot/grub/menu.lst: GRUB boot loader configuration.
   3.251 -#
   3.252 -
   3.253 -# By default, boot the first entry.
   3.254 -default 0
   3.255 -
   3.256 -# Boot automatically after 8 secs.
   3.257 -timeout 8
   3.258 -
   3.259 -# Change the colors.
   3.260 -color yellow/brown light-green/black
   3.261 -
   3.262 -# For booting SliTaz from : $TARGET_DEV
   3.263 -#
   3.264 -title 	SliTaz GNU/Linux (cooking) (Kernel $KERNEL)
   3.265 -		root $GRUB_ROOT
   3.266 -		kernel /boot/$KERNEL root=$TARGET_DEV
   3.267 -
   3.268 -_EOF_
   3.269 -	status
   3.270 -	# GRUB info with disk name used for grub-install
   3.271 -	TARGET_DISK=`echo $TARGET_DEV | sed s/"[0-9]"/''/`
   3.272 -	echo ""
   3.273 -	echo -e "\033[1mGRUB - Informations et installation\033[0m
   3.274 -================================================================================
   3.275 -
   3.276 -Avant de redémarrer sur votre nouveau système SliTaz GNU/Linux, veuillez vous
   3.277 -assurer qu'un gestionnaire de démarrage est bien installé. Si ce n'est pas le
   3.278 -cas vous pouvez répondre oui et installer GRUB ou lancer la commande :
   3.279 -
   3.280 -    # grub-install --no-floppy --root-directory=$TARGET_ROOT $TARGET_DISK
   3.281 -
   3.282 -Les lignes suivantes on été ajoutées au fichier de configuration de GRUB
   3.283 -/boot/grub/menu.lst de la cible. Elles feront démarrer SliTaz en installant
   3.284 -GRUB. Si vous n'installez pas GRUB, vous pouvez utiliser ces même lignes dans
   3.285 -un autre fichier menu.lst, situé sur une autre partitions :
   3.286 -
   3.287 -    title  SliTaz GNU/Linux (cooking) (Kernel $KERNEL)
   3.288 -           root $GRUB_ROOT
   3.289 -           kernel /boot/$KERNEL root=$TARGET_DEV
   3.290 -
   3.291 -================================================================================"
   3.292 -	echo ""
   3.293 -
   3.294 -	# GRUB install
   3.295 -	echo -n "Installer GRUB sur le disque : $TARGET_DISK (oui/Non) ? "; read anser
   3.296 -	if [ "$anser" = "oui" ]; then
   3.297 -		grub-install --no-floppy --root-directory=$TARGET_ROOT $TARGET_DISK
   3.298 -	else
   3.299 -		echo "GRUB n'a pas été installé."
   3.300 -	fi
   3.301 -}
   3.302 -
   3.303 -# End of installation
   3.304 -end_of_install()
   3.305 -{
   3.306 -	echo ""
   3.307 -	echo -e "\033[1mFin de l'installation\033[0m
   3.308 -================================================================================
   3.309 -
   3.310 -Installation terminée. Vous pouvez dès maintenant redémarrer sur votre nouveau
   3.311 -système SliTaz GNU/Linux et commencer à finement le configurer en fonction de
   3.312 -vos besoins et préférences. Vous trouverez un support technique gratuit via
   3.313 -la liste de discussion et/ou le forum officiel du projet."
   3.314 -	echo ""
   3.315 -}
   3.316 -
   3.317 -######################
   3.318 -# Installer sequence #
   3.319 -######################
   3.320 -
   3.321 -start_infos
   3.322 -check_root
   3.323 -ask_for_target_dev
   3.324 -mkfs_target_dev
   3.325 -mount_devices
   3.326 -install_kernel
   3.327 -copy_bootloaders
   3.328 -copy_extract_rootfs
   3.329 -pre_config_system
   3.330 -grub_install
   3.331 -end_of_install
   3.332 -
   3.333 -exit 0
     4.1 --- a/tinyutils/tazx	Mon Apr 21 11:26:09 2008 +0000
     4.2 +++ b/tinyutils/tazx	Tue Apr 22 22:58:03 2008 +0200
     4.3 @@ -16,7 +16,7 @@
     4.4  if [ -n "$1" ]; then
     4.5  	WM=$1
     4.6  else
     4.7 -	WM=jwm
     4.8 +	WM=openbox
     4.9  fi
    4.10  
    4.11  ####################
    4.12 @@ -151,7 +151,7 @@
    4.13  {
    4.14  	if [ "$WM" == "openbox" -o "$WM" == "ob" ]; then
    4.15  		 WM=openbox-session
    4.16 -		 XSEVER_OPTS="dpms -terminate"
    4.17 +		 XSEVER_OPTS="dpms +extension Composite"
    4.18  	fi
    4.19  	# Check if a personnal autostart script exist if OB is installed.
    4.20  	if [ -d "/var/lib/tazpkg/installed/openbox" ]; then
    4.21 @@ -159,13 +159,16 @@
    4.22  			mkdir -p $HOME/.config/openbox
    4.23  			cp /etc/xdg/openbox/autostart.sh $HOME/.config/openbox
    4.24  		fi
    4.25 -		# Script for hacker, Openbox can be used with a LiveCD flavor or
    4.26 -		# LiveUSB.
    4.27 +		# Script for hacker.
    4.28  		if [ ! -f "/home/hacker/.config/openbox/autostart.sh" ]; then
    4.29  			mkdir -p /home/hacker/.config/openbox
    4.30  			cp /etc/xdg/openbox/autostart.sh /home/hacker/.config/openbox
    4.31 -			chown -R hacker.hacker /home/hacker/.config
    4.32  		fi
    4.33 +		if [ ! -f "/home/hacker/.config/openbox/menu.xml" ]; then
    4.34 +			mkdir -p /home/hacker/.config/openbox
    4.35 +			cp /etc/xdg/openbox/menu.xml /home/hacker/.config/openbox
    4.36 +		fi
    4.37 +		chown -R hacker.hacker /home/hacker/.config
    4.38  	fi
    4.39  }
    4.40  
    4.41 @@ -177,7 +180,7 @@
    4.42  # You can use F1 with Slim or 'tazx' to configure permanantly 
    4.43  # your default WM: tazx e17
    4.44  #
    4.45 -WM=jwm
    4.46 +WM=openbox
    4.47  
    4.48  case $1 in
    4.49  	e17|enlightenment_start)
    4.50 @@ -193,7 +196,7 @@
    4.51  	*)
    4.52  		# LXpanel by default with JWM (use less memory started 
    4.53  		# from here rater than from StartupCommand).
    4.54 -		if [ "$WM" = "jwm" ]; then
    4.55 +		if [ "$WM" = "openbox" ]; then
    4.56  			lxpanel &
    4.57  		fi
    4.58  		exec $WM