slitaz-tools rev 585

Rename stuff to oldstuff and mv subox to it
author Christophe Lincoln <pankso@slitaz.org>
date Sat Apr 30 01:29:28 2011 +0200 (2011-04-30)
parents bac3728828c5
children 4b793f809619
files oldstuff/README oldstuff/images/tazctrlbox.png oldstuff/subox oldstuff/tazctrlbox oldstuff/tazctrlbox.desktop oldstuff/tazfile stuff/README stuff/images/tazctrlbox.png stuff/tazctrlbox stuff/tazctrlbox.desktop stuff/tazfile tinyutils/subox
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/oldstuff/README	Sat Apr 30 01:29:28 2011 +0200
     1.3 @@ -0,0 +1,5 @@
     1.4 +
     1.5 +
     1.6 +Some old stuff we had used in SliTaz. We keep thes files, code, etc since
     1.7 +they may have good things we will reuse on day.
     1.8 +
     2.1 Binary file oldstuff/images/tazctrlbox.png has changed
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/oldstuff/subox	Sat Apr 30 01:29:28 2011 +0200
     3.3 @@ -0,0 +1,114 @@
     3.4 +#!/bin/sh
     3.5 +#
     3.6 +# Gtkdialog to execute program as root from a WM menu.
     3.7 +# (c) SliTaz GNU/Linux 2008-2010 - GNU gpl.
     3.8 +#
     3.9 +VERSION=20100324
    3.10 +
    3.11 +# Usage.
    3.12 +if [ -z "$1" ]; then
    3.13 +    echo "Slitaz subox version : $VERSION"
    3.14 +    echo -e "\nUsage : subox program\n"
    3.15 +    exit 0
    3.16 +fi
    3.17 +
    3.18 +# Nothing to do if we are root
    3.19 +test $(id -u) = 0 && exec $1
    3.20 +
    3.21 +# Include gettext helper script.
    3.22 +. /usr/bin/gettext.sh
    3.23 +
    3.24 +# Export package name for gettext.
    3.25 +TEXTDOMAIN='subox'
    3.26 +export TEXTDOMAIN
    3.27 +
    3.28 +# Keep command in an exported variable to be used by SU_DIALOG.
    3.29 +export SU_CMD=$1
    3.30 +
    3.31 +# Error window if the pwd is wrong.
    3.32 +export ERROR_DIALOG='
    3.33 +<window title="Subox">
    3.34 +  <vbox>
    3.35 +
    3.36 +    <text use-markup="true">
    3.37 +      <label>"
    3.38 +<b>SliTaz - Subox</b>"
    3.39 +      </label>
    3.40 +    </text>
    3.41 +    <text wrap="true" width-chars="48">
    3.42 +	<label>"'`gettext "Error: wrong password!"`'"</label>
    3.43 +    </text>
    3.44 +
    3.45 +    <hbox>
    3.46 +      <button ok></button>
    3.47 +    </hbox>
    3.48 +</vbox>
    3.49 +</window>
    3.50 +'
    3.51 +
    3.52 +# Main window and root password default entry set to 'root'.
    3.53 +SU_DIALOG='
    3.54 +<window title="Subox" skip_taskbar_hint="true">
    3.55 +<vbox>
    3.56 +
    3.57 +	<text use-markup="true">
    3.58 +		<label>"
    3.59 +<b>SliTaz - Subox</b>"
    3.60 +		</label>
    3.61 +	</text>
    3.62 +	<text wrap="true" width-chars="50">
    3.63 +		<label>"'`gettext "
    3.64 +Please enter root password (default root) to execute :"`'
    3.65 +'$@'
    3.66 +"
    3.67 +		</label>
    3.68 +	</text>
    3.69 +	
    3.70 +	<hbox>
    3.71 +		<text use-markup="true">
    3.72 +			<label>"'`gettext "<b>Admin password :</b>"`'"</label>
    3.73 +		</text>
    3.74 +		<entry visibility="false">'
    3.75 +
    3.76 +# Check if we have a saved passwd.
    3.77 +if [ -s $HOME/.config/slitaz/subox.conf ]; then
    3.78 +	PASSWD=`cat $HOME/.config/slitaz/subox.conf`
    3.79 +	[ -n "$PASSWD" ] && SU_DIALOG="$SU_DIALOG <default>$PASSWD</default>" && AUTO_SAVED_PASSWD=true
    3.80 +else 
    3.81 +AUTO_SAVED_PASSWD=false
    3.82 +fi
    3.83 +
    3.84 +export SU_DIALOG=''${SU_DIALOG}'
    3.85 +			<variable>PASSWD</variable>
    3.86 +		</entry>
    3.87 +	</hbox>
    3.88 +	
    3.89 +	<hbox>
    3.90 +		<checkbox>
    3.91 +			
    3.92 +			<label>"'`gettext "Autosave password"`'"</label>
    3.93 +			<variable>AUTOSAVE</variable>'
    3.94 +if [ $AUTO_SAVED_PASSWD = "true" ]
    3.95 +	then SU_DIALOG="$SU_DIALOG <default>true</default>"
    3.96 +	else SU_DIALOG="$SU_DIALOG <default>false</default>"
    3.97 +fi
    3.98 +
    3.99 +export SU_DIALOG=''${SU_DIALOG}'
   3.100 +			
   3.101 +		</checkbox>
   3.102 +		<button ok>
   3.103 +			<action> echo $PASSWD | su -c "$SU_CMD &" || gtkdialog --center --program=ERROR_DIALOG</action>
   3.104 +			<action>[ $AUTOSAVE == true ] && echo $PASSWD > '$HOME/.config/slitaz/subox.conf'</action>
   3.105 +			<action>[ $AUTOSAVE == true ] && chmod 0600 '$HOME/.config/slitaz/subox.conf'</action>
   3.106 +			<action>[ $AUTOSAVE == false ] && cat /dev/null > '$HOME/.config/slitaz/subox.conf'</action>
   3.107 +			<action type="closewindow">SU_DIALOG</action>
   3.108 +		</button>
   3.109 +		<button cancel></button>
   3.110 +	</hbox>
   3.111 +
   3.112 +</vbox>
   3.113 +</window>'
   3.114 +
   3.115 +gtkdialog --center --program=SU_DIALOG > /dev/null
   3.116 +
   3.117 +exit 0
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/oldstuff/tazctrlbox	Sat Apr 30 01:29:28 2011 +0200
     4.3 @@ -0,0 +1,563 @@
     4.4 +#!/bin/sh
     4.5 +#
     4.6 +# SliTaz Control Box is a tool to configure and manage a SliTaz system.
     4.7 +# The script uses GTKdialog for the UI interface. Some shell functions
     4.8 +# are called by argument. Individual window dialogs are put into 
     4.9 +# functions.
    4.10 +#
    4.11 +# (C) GNU gpl v3 - SliTaz GNU/Linux 2010.
    4.12 +# Author: Christophe Lincoln <pankso@slitaz.org>
    4.13 +#
    4.14 +VERSION=1.1
    4.15 +
    4.16 +# Include gettext helper script.
    4.17 +. /usr/bin/gettext.sh
    4.18 +
    4.19 +# Export package name for gettext.
    4.20 +TEXTDOMAIN='tazctrlbox'
    4.21 +export TEXTDOMAIN
    4.22 +
    4.23 +# Get init configuration.
    4.24 +. /etc/rcS.conf
    4.25 +
    4.26 +# Tazctrlbox is only for root.
    4.27 +if test $(id -u) != 0 ; then
    4.28 +	exec subox $0
    4.29 +	exit 0
    4.30 +fi
    4.31 +
    4.32 +# By default autologin is not configured on an installed system.
    4.33 +if ! grep -q 'auto_login' /etc/slim.conf; then
    4.34 +	echo '# Auto login default user' >> /etc/slim.conf
    4.35 +	echo 'auto_login          no' >> /etc/slim.conf
    4.36 +fi
    4.37 +
    4.38 +# Change Grub menu.lst timeout.
    4.39 +sed_grub_timeout()
    4.40 +{
    4.41 +	CURRENT=`cat /boot/grub/menu.lst | grep ^timeout | cut -d " " -f2`
    4.42 +	sed -i s/"timeout $CURRENT"/"timeout $GRUB_TIMEOUT"/ /boot/grub/menu.lst
    4.43 +}
    4.44 +
    4.45 +# Change Grub menu.lst timeout.
    4.46 +sed_grub_color()
    4.47 +{
    4.48 +	CURRENT=`cat /boot/grub/menu.lst | grep ^color | cut -d " " -f2-3`
    4.49 +	sed -i s#"color $CURRENT"#"color $GRUB_COLOR"# /boot/grub/menu.lst
    4.50 +}
    4.51 +
    4.52 +# Set check fs on boot.
    4.53 +sed_check_fs()
    4.54 +{
    4.55 +	sed -i s#"CHECK_FS=\"$CHECK_FS\""#"CHECK_FS=\"$NEW_CHECK_FS\""# \
    4.56 +		/etc/rcS.conf
    4.57 +}
    4.58 +
    4.59 +# Set loaded modules on boot.
    4.60 +sed_load_modules()
    4.61 +{
    4.62 +	sed -i s/"LOAD_MODULES=\"$LOAD_MODULES\""/"LOAD_MODULES=\"$NEW_MODULES\""/ \
    4.63 +		/etc/rcS.conf
    4.64 +}
    4.65 +
    4.66 +# Set daemons to run on boot.
    4.67 +sed_run_daemons()
    4.68 +{
    4.69 +	sed -i s/"RUN_DAEMONS=\"$RUN_DAEMONS\""/"RUN_DAEMONS=\"$NEW_DAEMONS\""/ \
    4.70 +		/etc/rcS.conf
    4.71 +}
    4.72 +
    4.73 +# Get user list.
    4.74 +get_users()
    4.75 +{
    4.76 +	for i in `cat /etc/passwd | cut -d ":" -f 1`
    4.77 +	do
    4.78 +		if [ -d /home/$i ]; then
    4.79 +			login=$i
    4.80 +			uid=`cat /etc/passwd | grep $i | cut -d ":" -f 3`
    4.81 +			gid=`cat /etc/passwd | grep $i | cut -d ":" -f 4`
    4.82 +			name=`cat /etc/passwd | grep $i | cut -d ":" -f 5 | sed s/,,,//`
    4.83 +			home=`cat /etc/passwd | grep $i | cut -d ":" -f 6`
    4.84 +			shell=`cat /etc/passwd | grep $i | cut -d ":" -f 7`
    4.85 +			echo "system-users | $login | $uid:$gid | $name | $home | $shell"
    4.86 +		fi
    4.87 +	done
    4.88 +}
    4.89 +
    4.90 +# Remove a user or change passwd.
    4.91 +manage_user()
    4.92 +{
    4.93 +	export MANAGE_DIALOG="
    4.94 +<window title=\"`gettext "Manage user: "`$USER\" icon-name=\"computer\">
    4.95 +	<vbox>
    4.96 +		<vbox>
    4.97 +			<text wrap=\"false\" width-chars=\"34\">
    4.98 +				<label>\"
    4.99 +Login name: $USER
   4.100 +				\"</label>
   4.101 +			</text>
   4.102 +		</vbox>
   4.103 +		<hbox>
   4.104 +			<text wrap=\"false\">
   4.105 +				<label>\"`gettext "New password:"`\"</label>
   4.106 +			</text>
   4.107 +			<entry invisible_char=\"*\" visibility=\"false\" max_length=\"8\">
   4.108 +				<variable>PASSWD</variable>
   4.109 +			</entry>
   4.110 +			<button>
   4.111 +				<label>Change</label>
   4.112 +				<input file icon=\"forward\"></input>
   4.113 +				<action>echo \"$USER:$PASSWD\" | chpasswd</action>
   4.114 +				<action type=\"closewindow\">MANAGE_USER</action>
   4.115 +			</button>
   4.116 +		</hbox>
   4.117 +		<hbox>
   4.118 +			<button>
   4.119 +				<label>`gettext "Delete user"`</label>
   4.120 +				<input file icon=\"gtk-delete\"></input>
   4.121 +				<action>deluser $USER</action>
   4.122 +				<action type=\"closewindow\">MANAGE_USER</action>
   4.123 +			</button>
   4.124 +			<button cancel>
   4.125 +				<action type=\"closewindow\">MANAGE_USER</action>
   4.126 +			</button>
   4.127 +		</hbox>
   4.128 +	</vbox>
   4.129 +</window>
   4.130 +"
   4.131 +	gtkdialog --center --program=MANAGE_DIALOG >/dev/null
   4.132 +}
   4.133 +
   4.134 +# Add a new user.
   4.135 +add_user()
   4.136 +{
   4.137 +	export ADD_USER_DIALOG='
   4.138 +<window title="New user" icon-name="gtk-add">
   4.139 +	<vbox>
   4.140 +		<vbox>
   4.141 +			<text wrap="false" width-chars="34">
   4.142 +				<label>"'`gettext "
   4.143 +New account information"`'
   4.144 +				"</label>
   4.145 +			</text>
   4.146 +		</vbox>
   4.147 +		<hbox>
   4.148 +			<text wrap="false">
   4.149 +				<label>"'`gettext "Login:"`'      "</label>
   4.150 +			</text>
   4.151 +			<entry>
   4.152 +				<variable>NEW_USER</variable>
   4.153 +			</entry>
   4.154 +		</hbox>
   4.155 +		<hbox>
   4.156 +			<text wrap="false">
   4.157 +				<label>"'`gettext "Password:"`'"</label>
   4.158 +			</text>
   4.159 +			<entry invisible_char="*" visibility="false" max_length="8">
   4.160 +				<variable>PASSWD</variable>
   4.161 +			</entry>
   4.162 +		</hbox>
   4.163 +		<hbox>
   4.164 +			<button ok>
   4.165 +				<action>adduser -D $NEW_USER</action>
   4.166 +				<action>echo "$NEW_USER:$PASSWD" | chpasswd</action>
   4.167 +				<action>addgroup $NEW_USER audio</action>
   4.168 +				<action>addgroup $NEW_USER cdrom</action>
   4.169 +				<action>addgroup $NEW_USER floppy</action>
   4.170 +				<action>addgroup $NEW_USER video</action>
   4.171 +				<action>rmdir /home/$NEW_USER</action>
   4.172 +				<action>cp -a /etc/skel /home/$NEW_USER</action>
   4.173 +				<action>cp /root/.xinitrc /home/$NEW_USER</action>
   4.174 +				<action>mkdir -p /home/$NEW_USER/.config/slitaz</action>
   4.175 +				<action>cp -a /etc/slitaz/applications.conf /home/$NEW_USER/.config/slitaz</action>
   4.176 +				<action>chown -R $NEW_USER:$NEW_USER /home/$NEW_USER</action>
   4.177 +				<action type="closewindow">MANAGE_USER</action>
   4.178 +			</button>
   4.179 +			<button cancel>
   4.180 +				<action type="closewindow">MANAGE_USER</action>
   4.181 +			</button>
   4.182 +		</hbox>
   4.183 +	</vbox>
   4.184 +</window>
   4.185 +'
   4.186 +	gtkdialog --center --program=ADD_USER_DIALOG >/dev/null	
   4.187 +}
   4.188 +
   4.189 +# i18n functions.
   4.190 +list_locales()
   4.191 +{
   4.192 +	cd /usr/share/i18n/locales
   4.193 +	for locale in `ls -1 [a-z][a-z]_[A-Z][A-Z]`
   4.194 +	do
   4.195 +		echo "preferences-desktop-locale | $locale | UTF-8"
   4.196 +	done
   4.197 +}
   4.198 +gen_utf8_locale()
   4.199 +{
   4.200 +	rm -rf /usr/lib/locale/$LANGUAGE
   4.201 +	localedef -i $LANGUAGE -c -f UTF-8 /usr/lib/locale/$LANGUAGE
   4.202 +	# System configuration
   4.203 +	echo "LANG=$LANGUAGE" > /etc/locale.conf
   4.204 +	echo "LC_ALL=$LANGUAGE" >> /etc/locale.conf
   4.205 +}
   4.206 +
   4.207 +# Main dialog with notebook.
   4.208 +#
   4.209 +export MAIN_DIALOG='
   4.210 +<window title="'`gettext "SliTaz Control Box"`'" icon-name="computer">
   4.211 +<vbox>
   4.212 +
   4.213 +	<hbox>
   4.214 +		<text use-markup="true">
   4.215 +			<label>"'`gettext "<b>SliTaz Control Box</b>"`'"</label>
   4.216 +		</text>
   4.217 +		<pixmap>
   4.218 +			<input file>/usr/share/pixmaps/tazctrlbox.png</input>
   4.219 +		</pixmap>
   4.220 +	</hbox>
   4.221 +
   4.222 +	<notebook labels="'`gettext "Boot loader|Initialization|Login manager|Time|Language|Users"`'">'
   4.223 +	
   4.224 +# GRUB.
   4.225 +MAIN_DIALOG=${MAIN_DIALOG}"
   4.226 +	<vbox>
   4.227 +		<frame `gettext "Grub boot loader"`>
   4.228 +			<hbox>
   4.229 +				<text wrap=\"false\">
   4.230 +					<label>\"`gettext "Timeout:"`\"</label>
   4.231 +				</text>
   4.232 +				<entry>
   4.233 +					<input>cat /boot/grub/menu.lst | grep ^timeout | cut -d \" \" -f2</input>
   4.234 +					<variable>GRUB_TIMEOUT</variable>
   4.235 +				</entry>
   4.236 +				<button>
   4.237 +					<label>`gettext "Change"`</label>
   4.238 +					<input file icon=\"forward\"></input>
   4.239 +					<action>$0 sed_grub_timeout</action>
   4.240 +				</button>
   4.241 +			</hbox>
   4.242 +			<hbox>
   4.243 +				<text wrap=\"false\">
   4.244 +					<label>\"`gettext "Color:"`    \"</label>
   4.245 +				</text>
   4.246 +				<entry>
   4.247 +					<input>cat /boot/grub/menu.lst | grep ^color | cut -d \" \" -f2-3</input>
   4.248 +					<variable>GRUB_COLOR</variable>
   4.249 +				</entry>
   4.250 +				<button>
   4.251 +					<label>`gettext "Change"`</label>
   4.252 +					<input file icon=\"forward\"></input>
   4.253 +					<action>$0 sed_grub_color</action>
   4.254 +				</button>
   4.255 +			</hbox>
   4.256 +			<hbox>
   4.257 +				<text wrap=\"false\">
   4.258 +					<label>\"`gettext "Configuration file:"`\"</label>
   4.259 +				</text>
   4.260 +				<button>
   4.261 +					<label>/boot/grub/menu.lst</label>
   4.262 +					<input file icon=\"accessories-text-editor\"></input>
   4.263 +					<action>leafpad /boot/grub/menu.lst</action>
   4.264 +					<action>refresh:GRUB_COLOR</action>
   4.265 +					<action>refresh:GRUB_TIMEOUT</action>
   4.266 +				</button>
   4.267 +			</hbox>
   4.268 +		</frame>
   4.269 +	</vbox>"
   4.270 +# Init script.
   4.271 +MAIN_DIALOG=${MAIN_DIALOG}"
   4.272 +	<vbox>
   4.273 +		<frame `gettext "rcS init scripts"`>
   4.274 +			<hbox>
   4.275 +				<text wrap=\"false\">
   4.276 +					<label>\"`gettext "Check filesystems:"`\"</label>
   4.277 +				</text>
   4.278 +				<entry>
   4.279 +					<input>echo $CHECK_FS</input>
   4.280 +					<variable>NEW_CHECK_FS</variable>
   4.281 +				</entry>
   4.282 +				<button>
   4.283 +					<label>Change</label>
   4.284 +					<input file icon=\"forward\"></input>
   4.285 +					<action>$0 sed_check_fs</action>
   4.286 +				</button>
   4.287 +			</hbox>
   4.288 +			<hbox>
   4.289 +				<text wrap=\"false\">
   4.290 +					<label>\"`gettext "Load modules:"`      \"</label>
   4.291 +				</text>
   4.292 +				<entry>
   4.293 +					<input>echo $LOAD_MODULES</input>
   4.294 +					<variable>NEW_MODULES</variable>
   4.295 +				</entry>
   4.296 +				<button>
   4.297 +					<label>`gettext "Change"`</label>
   4.298 +					<input file icon=\"forward\"></input>
   4.299 +					<action>$0 sed_load_modules</action>
   4.300 +				</button>
   4.301 +			</hbox>
   4.302 +			<hbox>
   4.303 +				<text wrap=\"false\">
   4.304 +					<label>\"`gettext "Run daemons:"`       \"</label>
   4.305 +				</text>
   4.306 +				<entry>
   4.307 +					<input>echo $RUN_DAEMONS</input>
   4.308 +					<variable>NEW_DAEMONS</variable>
   4.309 +				</entry>
   4.310 +				<button>
   4.311 +					<label>`gettext "Change"`</label>
   4.312 +					<input file icon=\"forward\"></input>
   4.313 +					<action>$0 sed_run_daemons</action>
   4.314 +				</button>
   4.315 +			</hbox>
   4.316 +			<hbox>
   4.317 +				<text wrap=\"false\">
   4.318 +					<label>\"`gettext "Add local commands:"`\"</label>
   4.319 +				</text>
   4.320 +				<button>
   4.321 +					<label>/etc/init.d/local.sh</label>
   4.322 +					<input file icon=\"accessories-text-editor\"></input>
   4.323 +					<action>leafpad /etc/init.d/local.sh</action>
   4.324 +				</button>
   4.325 +			</hbox>
   4.326 +		</frame>
   4.327 +	</vbox>"
   4.328 +# Slim login.
   4.329 +MAIN_DIALOG=${MAIN_DIALOG}'
   4.330 +	<vbox>
   4.331 +		<frame '`gettext "Slim settings"`'>
   4.332 +			<hbox>
   4.333 +				<text wrap="false">
   4.334 +					<label>"'`gettext "Sessions:"`'                "</label>
   4.335 +				</text>
   4.336 +				<entry>
   4.337 +					<input>cat /etc/slim.conf | grep ^session | sed s/"sessions. *"//</input>
   4.338 +					<variable>SLIM_SESSIONS</variable>
   4.339 +				</entry>
   4.340 +				<button>
   4.341 +					<label>'`gettext "Change"`'</label>
   4.342 +					<input file icon="forward"></input>
   4.343 +					<action>sed -i "s/^sessions.*/sessions            $SLIM_SESSIONS/" /etc/slim.conf</action>
   4.344 +				</button>
   4.345 +			</hbox>
   4.346 +			<hbox>
   4.347 +				<text wrap="false">
   4.348 +					<label>"'`gettext "Default user:"`'           "</label>
   4.349 +				</text>
   4.350 +				<entry>
   4.351 +					<input>cat /etc/slim.conf | grep ^default_user | sed s/"default_user. *"//</input>
   4.352 +					<variable>SLIM_DEF_USER</variable>
   4.353 +				</entry>
   4.354 +				<button>
   4.355 +					<label>'`gettext "Change"`'</label>
   4.356 +					<input file icon="forward"></input>
   4.357 +					<action>sed -i "s/^default_user.*/default_user        $SLIM_DEF_USER/" /etc/slim.conf</action>
   4.358 +				</button>
   4.359 +			</hbox>
   4.360 +			<hbox>
   4.361 +				<text wrap="false">
   4.362 +					<label>"'`gettext "Auto login (yes|no):"`' "</label>
   4.363 +				</text>
   4.364 +				<entry max_length="3">
   4.365 +					<input>cat /etc/slim.conf | grep ^auto_login | sed s/"auto_login. *"//</input>
   4.366 +					<variable>SLIM_AUTO_LOGIN</variable>
   4.367 +				</entry>
   4.368 +				<button>
   4.369 +					<label>'`gettext "Change"`'</label>
   4.370 +					<input file icon="forward"></input>
   4.371 +					<action>sed -i "s/^auto_login.*/auto_login          $SLIM_AUTO_LOGIN/" /etc/slim.conf</action>
   4.372 +				</button>
   4.373 +			</hbox>
   4.374 +			<hbox>
   4.375 +				<text wrap="false">
   4.376 +					<label>"'`gettext "Theme:"`'"</label>
   4.377 +				</text>
   4.378 +				<combobox>
   4.379 +					<variable>NEW_SLIM_THEME</variable>'
   4.380 +# List all installed Slim themes.
   4.381 +for dir in $(ls /usr/share/slim/themes)
   4.382 +do
   4.383 +	THEME_ITEMS="<item>$dir</item>"
   4.384 +	MAIN_DIALOG=${MAIN_DIALOG}${THEME_ITEMS}
   4.385 +done		
   4.386 +MAIN_DIALOG=${MAIN_DIALOG}'
   4.387 +				</combobox>	
   4.388 +				<button>
   4.389 +					<label>'`gettext "Preview"`'</label>
   4.390 +					<input file icon="video-display"></input>
   4.391 +					<action>slim -p /usr/share/slim/themes/$NEW_SLIM_THEME &</action>
   4.392 +				</button>
   4.393 +				<button>
   4.394 +					<label>'`gettext "Change"`'</label>
   4.395 +					<input file icon="forward"></input>
   4.396 +					<action>sed -i "s/^current_theme.*/current_theme       $NEW_SLIM_THEME/" /etc/slim.conf</action>
   4.397 +					<action>refresh:SLIM_THEME</action>
   4.398 +				</button>
   4.399 +			</hbox>
   4.400 +			<hbox>
   4.401 +				<text wrap="false">
   4.402 +					<label>"'`gettext "Configuration file:"`'"</label>
   4.403 +				</text>
   4.404 +				<button>
   4.405 +					<label>/etc/slim.conf</label>
   4.406 +					<input file icon="accessories-text-editor"></input>
   4.407 +					<action>leafpad /etc/slim.conf</action>
   4.408 +					<action>refresh:SLIM_SESSIONS</action>
   4.409 +					<action>refresh:SLIM_DEF_USER</action>
   4.410 +				</button>
   4.411 +			</hbox>
   4.412 +		</frame>
   4.413 +	</vbox>'
   4.414 +# Time settings.
   4.415 +MAIN_DIALOG=${MAIN_DIALOG}'	
   4.416 +	<vbox>
   4.417 +		<frame '`gettext "Date and time"`'>
   4.418 +			<hbox>
   4.419 +				<text wrap="false">
   4.420 +					<label>"'`gettext "System time:"`'   "</label>
   4.421 +				</text>
   4.422 +				<entry editable="false">
   4.423 +					<input>LC_ALL=C date</input>
   4.424 +					<variable>DATE</variable>
   4.425 +				</entry>
   4.426 +				<button>
   4.427 +					<label>'`gettext "Sync online"`'</label>
   4.428 +					<input file icon="reload"></input>
   4.429 +					<action>rdate -s tick.greyware.com</action>
   4.430 +					<action>refresh:DATE</action>
   4.431 +					<action>refresh:HWTIME</action>
   4.432 +				</button>
   4.433 +			</hbox>
   4.434 +			<hbox>
   4.435 +				<text wrap="false">
   4.436 +					<label>"'`gettext "Hardware time:"`'"</label>
   4.437 +				</text>
   4.438 +				<entry editable="false">
   4.439 +					<input>LC_ALL=C hwclock</input>
   4.440 +					<variable>HWTIME</variable>
   4.441 +				</entry>
   4.442 +				<button>
   4.443 +					<label>'`gettext "Set from system"`'</label>
   4.444 +					<input file icon="reload"></input>
   4.445 +					<action>hwclock -w -u</action>
   4.446 +					<action>refresh:HWTIME</action>
   4.447 +					<action>refresh:DATE</action>
   4.448 +				</button>
   4.449 +			</hbox>
   4.450 +			<hbox>
   4.451 +				<text wrap="true">
   4.452 +					<label>"'`gettext "Timezone:"`'       "</label>
   4.453 +				</text>
   4.454 +				<entry>
   4.455 +					<input>cat /etc/TZ</input>
   4.456 +					<variable>NEW_TZ</variable>
   4.457 +				</entry>
   4.458 +				<button>
   4.459 +					<label>'`gettext "Change"`'</label>
   4.460 +					<input file icon="forward"></input>
   4.461 +					<action>echo "$NEW_TZ" > /etc/TZ</action>
   4.462 +				</button>
   4.463 +			</hbox>
   4.464 +		</frame>
   4.465 +	</vbox>'
   4.466 +# Language settings.
   4.467 +MAIN_DIALOG=${MAIN_DIALOG}"
   4.468 +	<vbox>
   4.469 +		<tree>
   4.470 +			<width>600</width><height>210</height>
   4.471 +			<variable>LANGUAGE</variable>
   4.472 +			<label>`gettext "Language|Charmap"`</label>
   4.473 +			<input icon_column=\"0\">$0 list_locales</input>
   4.474 +			<action>$0 gen_utf8_locale</action>
   4.475 +		</tree>
   4.476 +		<hbox>
   4.477 +		<text width-chars=\"60\">
   4.478 +			<label>
   4.479 +\"`gettext "To change the system language you can double-click on the locale name."`\"
   4.480 +			</label>
   4.481 +		</text>
   4.482 +		<button>
   4.483 +			<label>`gettext "Keymap"`</label>
   4.484 +			<input file icon=\"input-keyboard\"></input>
   4.485 +			<action>tazkeymap &</action>
   4.486 +		</button>
   4.487 +	</hbox>
   4.488 +	</vbox>"
   4.489 +# Display users list through get_users.
   4.490 +MAIN_DIALOG=${MAIN_DIALOG}"
   4.491 +	<vbox>
   4.492 +		<tree>
   4.493 +			<width>600</width><height>210</height>
   4.494 +			<variable>USER</variable>
   4.495 +			<label>`gettext "Login|uid:gid|Name|Home|SHell"`</label>
   4.496 +			<input icon_column=\"0\">$0 get_users</input>
   4.497 +			<action>$0 manage_user</action>
   4.498 +			<action>refresh:USER</action>
   4.499 +		</tree>
   4.500 +		<hbox>
   4.501 +		<text width-chars=\"60\">
   4.502 +			<label>
   4.503 +\"`gettext "To change passwords or delete users you can double-click on the user name."`\"
   4.504 +			</label>
   4.505 +		</text>
   4.506 +		<button>
   4.507 +			<label>`gettext "Add newuser"`</label>
   4.508 +			<input file icon=\"gtk-add\"></input>
   4.509 +			<action>$0 add_user</action>
   4.510 +			<action>refresh:USER</action>
   4.511 +		</button>
   4.512 +	</hbox>
   4.513 +	</vbox>"
   4.514 +export MAIN_DIALOG=${MAIN_DIALOG}'	
   4.515 +	</notebook>
   4.516 +
   4.517 +	<hbox>
   4.518 +		<button>
   4.519 +			<label>'`gettext "Network"`'</label>
   4.520 +			<input file icon="netbox"></input>
   4.521 +			<action>netbox &</action>
   4.522 +		</button>
   4.523 +		<button>
   4.524 +			<label>'`gettext "Wireless"`'</label>
   4.525 +			<input file icon="network-wireless"></input>
   4.526 +			<action>wifibox &</action>
   4.527 +		</button>
   4.528 +		<button>
   4.529 +			<label>'`gettext "Packages"`'</label>
   4.530 +			<input file icon="tazpkg"></input>
   4.531 +			<action>tazpkgbox &</action>
   4.532 +		</button>
   4.533 +		<button>
   4.534 +			<label>'`gettext "Hardware"`'</label>
   4.535 +			<input file icon="computer"></input>
   4.536 +			<action>tazhw box &</action>
   4.537 +		</button>
   4.538 +		<button>
   4.539 +			<label>'`gettext "Server"`'</label>
   4.540 +			<input file icon="utilities-system-monitor"></input>
   4.541 +			<action>serverbox &</action>
   4.542 +		</button>
   4.543 +		<button>
   4.544 +			<label>'`gettext "Storage"`'</label>
   4.545 +			<input file icon="media-flash"></input>
   4.546 +			<action>mountbox &</action>
   4.547 +		</button>
   4.548 +		<button>
   4.549 +			<label>'`gettext "Exit"`'</label>
   4.550 +			<input file icon="exit"></input>
   4.551 +			<action type="exit">Exit</action>
   4.552 +		</button>
   4.553 +	</hbox>
   4.554 +
   4.555 +</vbox>
   4.556 +
   4.557 +</window>'
   4.558 +
   4.559 +# Script can be called with an arg to exec a function.
   4.560 +if [ -n "$1" ]; then
   4.561 +	$1
   4.562 +else
   4.563 +	gtkdialog --center --program=MAIN_DIALOG >/dev/null
   4.564 +fi
   4.565 +
   4.566 +exit 0
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/oldstuff/tazctrlbox.desktop	Sat Apr 30 01:29:28 2011 +0200
     5.3 @@ -0,0 +1,10 @@
     5.4 +[Desktop Entry]
     5.5 +Encoding=UTF-8
     5.6 +Name=Control Box
     5.7 +Name[fr]=Boîte de contrôle
     5.8 +Name[pt]=Painel de Controle
     5.9 +Comment=Manage your SliTaz system
    5.10 +Exec=subox tazctrlbox
    5.11 +Icon=tazctrlbox.png
    5.12 +Type=Application
    5.13 +Categories=System;Application;
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/oldstuff/tazfile	Sat Apr 30 01:29:28 2011 +0200
     6.3 @@ -0,0 +1,140 @@
     6.4 +#!/bin/sh
     6.5 +# Tazfile - Tiny autonomus zone files locator.
     6.6 +#
     6.7 +# This is a lightweight files locator for *.tazpkg files written in
     6.8 +# SHell script. It works well with Busybox ash shell and bash. Tazfile lets you
     6.9 +# create and explore a files list database.
    6.10 +#
    6.11 +# (C) 2008 SliTaz - GNU General Public License v3.
    6.12 +#
    6.13 +# Author : Pascal Bellard <pascal.bellard@slitaz.org>
    6.14 +#
    6.15 +VERSION=1.0
    6.16 +
    6.17 +####################
    6.18 +# Script variables #
    6.19 +####################
    6.20 +
    6.21 +# Initialize some variables to use words
    6.22 +# rather than numbers for functions and actions.
    6.23 +COMMAND=$1
    6.24 +TOP_DIR=`pwd`
    6.25 +TMP_DIR=/tmp/tazfile-$$-$RANDOM
    6.26 +
    6.27 +# Path to tazpkg used dir and configuration files
    6.28 +LOCALSTATE=/var/lib/tazpkg
    6.29 +INSTALLED=$LOCALSTATE/installed
    6.30 +MIRROR=$LOCALSTATE/mirror
    6.31 +FILES_LIST=$LOCALSTATE/files.list.lzma
    6.32 +DEFAULT_MIRROR="http://download.tuxfamily.org/slitaz/packages/`cat /etc/slitaz-release`/"
    6.33 +
    6.34 +# Check if the directories and files used by Tazfile
    6.35 +# exist. If not and user is root we create them.
    6.36 +if test $(id -u) = 0 ; then
    6.37 +	if [ ! -d "$INSTALLED" ]; then
    6.38 +		mkdir -p $INSTALLED
    6.39 +	fi
    6.40 +	if [ ! -f "$LOCALSTATE/mirror" ]; then
    6.41 +		echo "$DEFAULT_MIRROR" > $LOCALSTATE/mirror
    6.42 +	fi
    6.43 +fi
    6.44 +
    6.45 +####################
    6.46 +# Script functions #
    6.47 +####################
    6.48 +
    6.49 +# Print the usage.
    6.50 +usage ()
    6.51 +{
    6.52 +	echo -e "SliTaz files locator - Version: $VERSION\n
    6.53 +\033[1mUsage:\033[0m tazfile [command] [file...]\n
    6.54 +\033[1mCommands: \033[0m
    6.55 +  usage            Print this short usage.
    6.56 +  build            Build a files list to stdout from a list of packages.  
    6.57 +  recharge         Recharge your $(basename $FILES_LIST) from the mirror.
    6.58 +  search	   Search for file(s) in all (installed or not) packages.
    6.59 +
    6.60 +\033[1mExample: \033[0m
    6.61 +  $ find . -name '*.tazpkg' | tazfile build > $(basename $FILES_LIST)
    6.62 +  $ tazfile recharge
    6.63 +  $ tazfile search awk cpio "  
    6.64 +}
    6.65 +
    6.66 +# Check for packages.list to download and install packages.
    6.67 +check_for_files_list_lzma()
    6.68 +{
    6.69 +	if [ ! -f "$FILES_LIST" ]; then
    6.70 +		echo -e "
    6.71 +Unable to find the list : $FILES_LIST\n
    6.72 +You must probably run 'tazfile recharge' as root to get the latest list of 
    6.73 +files available on the mirror.\n"
    6.74 +		exit 0
    6.75 +	fi
    6.76 +}
    6.77 +
    6.78 +# Download a file trying all mirrors
    6.79 +download()
    6.80 +{
    6.81 +	for i in $(cat $MIRROR); do
    6.82 +		wget $i$@ && break
    6.83 +	done
    6.84 +}
    6.85 +
    6.86 +build_database()
    6.87 +{
    6.88 +        while read pkg; do
    6.89 +                cat $pkg | ( cd $TMP_DIR
    6.90 +                        cpio -iu > /dev/null 2>&1
    6.91 +                        . ./receipt
    6.92 +                        echo "$PACKAGE"
    6.93 +                        cat ./files.list ) | awk '
    6.94 +                            BEGIN { name="" }
    6.95 +                            {
    6.96 +                                if (name == "") name=$0;
    6.97 +                                else printf("%s: %s\n",name,$0);
    6.98 +                            }'
    6.99 +        done
   6.100 +}
   6.101 +
   6.102 +###################
   6.103 +# Tazpkg commands #
   6.104 +###################
   6.105 +
   6.106 +case "$COMMAND" in
   6.107 +	build)
   6.108 +		# Create files.list.lzma to stdout.
   6.109 +		#
   6.110 +		mkdir $TMP_DIR
   6.111 +		build_database | lzma e -si -so
   6.112 +		rm -rf $TMP_DIR
   6.113 +		;;
   6.114 +	recharge)
   6.115 +		# Recharge files.list.lzma from a mirror.
   6.116 +		#
   6.117 +		cd $LOCALSTATE
   6.118 +		echo ""
   6.119 +		mv -f $FILES_LIST $FILES_LIST.old 2> /dev/null
   6.120 +		download $(basename $FILES_LIST)
   6.121 +		;;
   6.122 +	search)
   6.123 +		# Search for a file by pattern or name in files.list.lzma.
   6.124 +		#
   6.125 +		check_for_files_list_lzma
   6.126 +		while [ -n "$2" ]; do
   6.127 +			unlzma -c $FILES_LIST | \
   6.128 +				grep -i -- "$2$" | while read line; do
   6.129 +					pkg=${line%:*}
   6.130 +					if [ -d $INSTALLED/$pkg ]; then
   6.131 +						echo -n "[already installed]  "
   6.132 +					fi
   6.133 +					echo "$line"
   6.134 +				done
   6.135 +			shift
   6.136 +		done
   6.137 +		;;
   6.138 +	usage|*)
   6.139 +		# Print a short help or give usage for an unknown or empty command.
   6.140 +		#
   6.141 +		usage
   6.142 +		;;
   6.143 +esac
     7.1 --- a/stuff/README	Fri Apr 29 21:27:38 2011 +0200
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,5 +0,0 @@
     7.4 -
     7.5 -
     7.6 -Some old stuff we had used in SliTaz. We keep thes files, code, etc since
     7.7 -they may have good things we will reuse on day.
     7.8 -
     8.1 Binary file stuff/images/tazctrlbox.png has changed
     9.1 --- a/stuff/tazctrlbox	Fri Apr 29 21:27:38 2011 +0200
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,563 +0,0 @@
     9.4 -#!/bin/sh
     9.5 -#
     9.6 -# SliTaz Control Box is a tool to configure and manage a SliTaz system.
     9.7 -# The script uses GTKdialog for the UI interface. Some shell functions
     9.8 -# are called by argument. Individual window dialogs are put into 
     9.9 -# functions.
    9.10 -#
    9.11 -# (C) GNU gpl v3 - SliTaz GNU/Linux 2010.
    9.12 -# Author: Christophe Lincoln <pankso@slitaz.org>
    9.13 -#
    9.14 -VERSION=1.1
    9.15 -
    9.16 -# Include gettext helper script.
    9.17 -. /usr/bin/gettext.sh
    9.18 -
    9.19 -# Export package name for gettext.
    9.20 -TEXTDOMAIN='tazctrlbox'
    9.21 -export TEXTDOMAIN
    9.22 -
    9.23 -# Get init configuration.
    9.24 -. /etc/rcS.conf
    9.25 -
    9.26 -# Tazctrlbox is only for root.
    9.27 -if test $(id -u) != 0 ; then
    9.28 -	exec subox $0
    9.29 -	exit 0
    9.30 -fi
    9.31 -
    9.32 -# By default autologin is not configured on an installed system.
    9.33 -if ! grep -q 'auto_login' /etc/slim.conf; then
    9.34 -	echo '# Auto login default user' >> /etc/slim.conf
    9.35 -	echo 'auto_login          no' >> /etc/slim.conf
    9.36 -fi
    9.37 -
    9.38 -# Change Grub menu.lst timeout.
    9.39 -sed_grub_timeout()
    9.40 -{
    9.41 -	CURRENT=`cat /boot/grub/menu.lst | grep ^timeout | cut -d " " -f2`
    9.42 -	sed -i s/"timeout $CURRENT"/"timeout $GRUB_TIMEOUT"/ /boot/grub/menu.lst
    9.43 -}
    9.44 -
    9.45 -# Change Grub menu.lst timeout.
    9.46 -sed_grub_color()
    9.47 -{
    9.48 -	CURRENT=`cat /boot/grub/menu.lst | grep ^color | cut -d " " -f2-3`
    9.49 -	sed -i s#"color $CURRENT"#"color $GRUB_COLOR"# /boot/grub/menu.lst
    9.50 -}
    9.51 -
    9.52 -# Set check fs on boot.
    9.53 -sed_check_fs()
    9.54 -{
    9.55 -	sed -i s#"CHECK_FS=\"$CHECK_FS\""#"CHECK_FS=\"$NEW_CHECK_FS\""# \
    9.56 -		/etc/rcS.conf
    9.57 -}
    9.58 -
    9.59 -# Set loaded modules on boot.
    9.60 -sed_load_modules()
    9.61 -{
    9.62 -	sed -i s/"LOAD_MODULES=\"$LOAD_MODULES\""/"LOAD_MODULES=\"$NEW_MODULES\""/ \
    9.63 -		/etc/rcS.conf
    9.64 -}
    9.65 -
    9.66 -# Set daemons to run on boot.
    9.67 -sed_run_daemons()
    9.68 -{
    9.69 -	sed -i s/"RUN_DAEMONS=\"$RUN_DAEMONS\""/"RUN_DAEMONS=\"$NEW_DAEMONS\""/ \
    9.70 -		/etc/rcS.conf
    9.71 -}
    9.72 -
    9.73 -# Get user list.
    9.74 -get_users()
    9.75 -{
    9.76 -	for i in `cat /etc/passwd | cut -d ":" -f 1`
    9.77 -	do
    9.78 -		if [ -d /home/$i ]; then
    9.79 -			login=$i
    9.80 -			uid=`cat /etc/passwd | grep $i | cut -d ":" -f 3`
    9.81 -			gid=`cat /etc/passwd | grep $i | cut -d ":" -f 4`
    9.82 -			name=`cat /etc/passwd | grep $i | cut -d ":" -f 5 | sed s/,,,//`
    9.83 -			home=`cat /etc/passwd | grep $i | cut -d ":" -f 6`
    9.84 -			shell=`cat /etc/passwd | grep $i | cut -d ":" -f 7`
    9.85 -			echo "system-users | $login | $uid:$gid | $name | $home | $shell"
    9.86 -		fi
    9.87 -	done
    9.88 -}
    9.89 -
    9.90 -# Remove a user or change passwd.
    9.91 -manage_user()
    9.92 -{
    9.93 -	export MANAGE_DIALOG="
    9.94 -<window title=\"`gettext "Manage user: "`$USER\" icon-name=\"computer\">
    9.95 -	<vbox>
    9.96 -		<vbox>
    9.97 -			<text wrap=\"false\" width-chars=\"34\">
    9.98 -				<label>\"
    9.99 -Login name: $USER
   9.100 -				\"</label>
   9.101 -			</text>
   9.102 -		</vbox>
   9.103 -		<hbox>
   9.104 -			<text wrap=\"false\">
   9.105 -				<label>\"`gettext "New password:"`\"</label>
   9.106 -			</text>
   9.107 -			<entry invisible_char=\"*\" visibility=\"false\" max_length=\"8\">
   9.108 -				<variable>PASSWD</variable>
   9.109 -			</entry>
   9.110 -			<button>
   9.111 -				<label>Change</label>
   9.112 -				<input file icon=\"forward\"></input>
   9.113 -				<action>echo \"$USER:$PASSWD\" | chpasswd</action>
   9.114 -				<action type=\"closewindow\">MANAGE_USER</action>
   9.115 -			</button>
   9.116 -		</hbox>
   9.117 -		<hbox>
   9.118 -			<button>
   9.119 -				<label>`gettext "Delete user"`</label>
   9.120 -				<input file icon=\"gtk-delete\"></input>
   9.121 -				<action>deluser $USER</action>
   9.122 -				<action type=\"closewindow\">MANAGE_USER</action>
   9.123 -			</button>
   9.124 -			<button cancel>
   9.125 -				<action type=\"closewindow\">MANAGE_USER</action>
   9.126 -			</button>
   9.127 -		</hbox>
   9.128 -	</vbox>
   9.129 -</window>
   9.130 -"
   9.131 -	gtkdialog --center --program=MANAGE_DIALOG >/dev/null
   9.132 -}
   9.133 -
   9.134 -# Add a new user.
   9.135 -add_user()
   9.136 -{
   9.137 -	export ADD_USER_DIALOG='
   9.138 -<window title="New user" icon-name="gtk-add">
   9.139 -	<vbox>
   9.140 -		<vbox>
   9.141 -			<text wrap="false" width-chars="34">
   9.142 -				<label>"'`gettext "
   9.143 -New account information"`'
   9.144 -				"</label>
   9.145 -			</text>
   9.146 -		</vbox>
   9.147 -		<hbox>
   9.148 -			<text wrap="false">
   9.149 -				<label>"'`gettext "Login:"`'      "</label>
   9.150 -			</text>
   9.151 -			<entry>
   9.152 -				<variable>NEW_USER</variable>
   9.153 -			</entry>
   9.154 -		</hbox>
   9.155 -		<hbox>
   9.156 -			<text wrap="false">
   9.157 -				<label>"'`gettext "Password:"`'"</label>
   9.158 -			</text>
   9.159 -			<entry invisible_char="*" visibility="false" max_length="8">
   9.160 -				<variable>PASSWD</variable>
   9.161 -			</entry>
   9.162 -		</hbox>
   9.163 -		<hbox>
   9.164 -			<button ok>
   9.165 -				<action>adduser -D $NEW_USER</action>
   9.166 -				<action>echo "$NEW_USER:$PASSWD" | chpasswd</action>
   9.167 -				<action>addgroup $NEW_USER audio</action>
   9.168 -				<action>addgroup $NEW_USER cdrom</action>
   9.169 -				<action>addgroup $NEW_USER floppy</action>
   9.170 -				<action>addgroup $NEW_USER video</action>
   9.171 -				<action>rmdir /home/$NEW_USER</action>
   9.172 -				<action>cp -a /etc/skel /home/$NEW_USER</action>
   9.173 -				<action>cp /root/.xinitrc /home/$NEW_USER</action>
   9.174 -				<action>mkdir -p /home/$NEW_USER/.config/slitaz</action>
   9.175 -				<action>cp -a /etc/slitaz/applications.conf /home/$NEW_USER/.config/slitaz</action>
   9.176 -				<action>chown -R $NEW_USER:$NEW_USER /home/$NEW_USER</action>
   9.177 -				<action type="closewindow">MANAGE_USER</action>
   9.178 -			</button>
   9.179 -			<button cancel>
   9.180 -				<action type="closewindow">MANAGE_USER</action>
   9.181 -			</button>
   9.182 -		</hbox>
   9.183 -	</vbox>
   9.184 -</window>
   9.185 -'
   9.186 -	gtkdialog --center --program=ADD_USER_DIALOG >/dev/null	
   9.187 -}
   9.188 -
   9.189 -# i18n functions.
   9.190 -list_locales()
   9.191 -{
   9.192 -	cd /usr/share/i18n/locales
   9.193 -	for locale in `ls -1 [a-z][a-z]_[A-Z][A-Z]`
   9.194 -	do
   9.195 -		echo "preferences-desktop-locale | $locale | UTF-8"
   9.196 -	done
   9.197 -}
   9.198 -gen_utf8_locale()
   9.199 -{
   9.200 -	rm -rf /usr/lib/locale/$LANGUAGE
   9.201 -	localedef -i $LANGUAGE -c -f UTF-8 /usr/lib/locale/$LANGUAGE
   9.202 -	# System configuration
   9.203 -	echo "LANG=$LANGUAGE" > /etc/locale.conf
   9.204 -	echo "LC_ALL=$LANGUAGE" >> /etc/locale.conf
   9.205 -}
   9.206 -
   9.207 -# Main dialog with notebook.
   9.208 -#
   9.209 -export MAIN_DIALOG='
   9.210 -<window title="'`gettext "SliTaz Control Box"`'" icon-name="computer">
   9.211 -<vbox>
   9.212 -
   9.213 -	<hbox>
   9.214 -		<text use-markup="true">
   9.215 -			<label>"'`gettext "<b>SliTaz Control Box</b>"`'"</label>
   9.216 -		</text>
   9.217 -		<pixmap>
   9.218 -			<input file>/usr/share/pixmaps/tazctrlbox.png</input>
   9.219 -		</pixmap>
   9.220 -	</hbox>
   9.221 -
   9.222 -	<notebook labels="'`gettext "Boot loader|Initialization|Login manager|Time|Language|Users"`'">'
   9.223 -	
   9.224 -# GRUB.
   9.225 -MAIN_DIALOG=${MAIN_DIALOG}"
   9.226 -	<vbox>
   9.227 -		<frame `gettext "Grub boot loader"`>
   9.228 -			<hbox>
   9.229 -				<text wrap=\"false\">
   9.230 -					<label>\"`gettext "Timeout:"`\"</label>
   9.231 -				</text>
   9.232 -				<entry>
   9.233 -					<input>cat /boot/grub/menu.lst | grep ^timeout | cut -d \" \" -f2</input>
   9.234 -					<variable>GRUB_TIMEOUT</variable>
   9.235 -				</entry>
   9.236 -				<button>
   9.237 -					<label>`gettext "Change"`</label>
   9.238 -					<input file icon=\"forward\"></input>
   9.239 -					<action>$0 sed_grub_timeout</action>
   9.240 -				</button>
   9.241 -			</hbox>
   9.242 -			<hbox>
   9.243 -				<text wrap=\"false\">
   9.244 -					<label>\"`gettext "Color:"`    \"</label>
   9.245 -				</text>
   9.246 -				<entry>
   9.247 -					<input>cat /boot/grub/menu.lst | grep ^color | cut -d \" \" -f2-3</input>
   9.248 -					<variable>GRUB_COLOR</variable>
   9.249 -				</entry>
   9.250 -				<button>
   9.251 -					<label>`gettext "Change"`</label>
   9.252 -					<input file icon=\"forward\"></input>
   9.253 -					<action>$0 sed_grub_color</action>
   9.254 -				</button>
   9.255 -			</hbox>
   9.256 -			<hbox>
   9.257 -				<text wrap=\"false\">
   9.258 -					<label>\"`gettext "Configuration file:"`\"</label>
   9.259 -				</text>
   9.260 -				<button>
   9.261 -					<label>/boot/grub/menu.lst</label>
   9.262 -					<input file icon=\"accessories-text-editor\"></input>
   9.263 -					<action>leafpad /boot/grub/menu.lst</action>
   9.264 -					<action>refresh:GRUB_COLOR</action>
   9.265 -					<action>refresh:GRUB_TIMEOUT</action>
   9.266 -				</button>
   9.267 -			</hbox>
   9.268 -		</frame>
   9.269 -	</vbox>"
   9.270 -# Init script.
   9.271 -MAIN_DIALOG=${MAIN_DIALOG}"
   9.272 -	<vbox>
   9.273 -		<frame `gettext "rcS init scripts"`>
   9.274 -			<hbox>
   9.275 -				<text wrap=\"false\">
   9.276 -					<label>\"`gettext "Check filesystems:"`\"</label>
   9.277 -				</text>
   9.278 -				<entry>
   9.279 -					<input>echo $CHECK_FS</input>
   9.280 -					<variable>NEW_CHECK_FS</variable>
   9.281 -				</entry>
   9.282 -				<button>
   9.283 -					<label>Change</label>
   9.284 -					<input file icon=\"forward\"></input>
   9.285 -					<action>$0 sed_check_fs</action>
   9.286 -				</button>
   9.287 -			</hbox>
   9.288 -			<hbox>
   9.289 -				<text wrap=\"false\">
   9.290 -					<label>\"`gettext "Load modules:"`      \"</label>
   9.291 -				</text>
   9.292 -				<entry>
   9.293 -					<input>echo $LOAD_MODULES</input>
   9.294 -					<variable>NEW_MODULES</variable>
   9.295 -				</entry>
   9.296 -				<button>
   9.297 -					<label>`gettext "Change"`</label>
   9.298 -					<input file icon=\"forward\"></input>
   9.299 -					<action>$0 sed_load_modules</action>
   9.300 -				</button>
   9.301 -			</hbox>
   9.302 -			<hbox>
   9.303 -				<text wrap=\"false\">
   9.304 -					<label>\"`gettext "Run daemons:"`       \"</label>
   9.305 -				</text>
   9.306 -				<entry>
   9.307 -					<input>echo $RUN_DAEMONS</input>
   9.308 -					<variable>NEW_DAEMONS</variable>
   9.309 -				</entry>
   9.310 -				<button>
   9.311 -					<label>`gettext "Change"`</label>
   9.312 -					<input file icon=\"forward\"></input>
   9.313 -					<action>$0 sed_run_daemons</action>
   9.314 -				</button>
   9.315 -			</hbox>
   9.316 -			<hbox>
   9.317 -				<text wrap=\"false\">
   9.318 -					<label>\"`gettext "Add local commands:"`\"</label>
   9.319 -				</text>
   9.320 -				<button>
   9.321 -					<label>/etc/init.d/local.sh</label>
   9.322 -					<input file icon=\"accessories-text-editor\"></input>
   9.323 -					<action>leafpad /etc/init.d/local.sh</action>
   9.324 -				</button>
   9.325 -			</hbox>
   9.326 -		</frame>
   9.327 -	</vbox>"
   9.328 -# Slim login.
   9.329 -MAIN_DIALOG=${MAIN_DIALOG}'
   9.330 -	<vbox>
   9.331 -		<frame '`gettext "Slim settings"`'>
   9.332 -			<hbox>
   9.333 -				<text wrap="false">
   9.334 -					<label>"'`gettext "Sessions:"`'                "</label>
   9.335 -				</text>
   9.336 -				<entry>
   9.337 -					<input>cat /etc/slim.conf | grep ^session | sed s/"sessions. *"//</input>
   9.338 -					<variable>SLIM_SESSIONS</variable>
   9.339 -				</entry>
   9.340 -				<button>
   9.341 -					<label>'`gettext "Change"`'</label>
   9.342 -					<input file icon="forward"></input>
   9.343 -					<action>sed -i "s/^sessions.*/sessions            $SLIM_SESSIONS/" /etc/slim.conf</action>
   9.344 -				</button>
   9.345 -			</hbox>
   9.346 -			<hbox>
   9.347 -				<text wrap="false">
   9.348 -					<label>"'`gettext "Default user:"`'           "</label>
   9.349 -				</text>
   9.350 -				<entry>
   9.351 -					<input>cat /etc/slim.conf | grep ^default_user | sed s/"default_user. *"//</input>
   9.352 -					<variable>SLIM_DEF_USER</variable>
   9.353 -				</entry>
   9.354 -				<button>
   9.355 -					<label>'`gettext "Change"`'</label>
   9.356 -					<input file icon="forward"></input>
   9.357 -					<action>sed -i "s/^default_user.*/default_user        $SLIM_DEF_USER/" /etc/slim.conf</action>
   9.358 -				</button>
   9.359 -			</hbox>
   9.360 -			<hbox>
   9.361 -				<text wrap="false">
   9.362 -					<label>"'`gettext "Auto login (yes|no):"`' "</label>
   9.363 -				</text>
   9.364 -				<entry max_length="3">
   9.365 -					<input>cat /etc/slim.conf | grep ^auto_login | sed s/"auto_login. *"//</input>
   9.366 -					<variable>SLIM_AUTO_LOGIN</variable>
   9.367 -				</entry>
   9.368 -				<button>
   9.369 -					<label>'`gettext "Change"`'</label>
   9.370 -					<input file icon="forward"></input>
   9.371 -					<action>sed -i "s/^auto_login.*/auto_login          $SLIM_AUTO_LOGIN/" /etc/slim.conf</action>
   9.372 -				</button>
   9.373 -			</hbox>
   9.374 -			<hbox>
   9.375 -				<text wrap="false">
   9.376 -					<label>"'`gettext "Theme:"`'"</label>
   9.377 -				</text>
   9.378 -				<combobox>
   9.379 -					<variable>NEW_SLIM_THEME</variable>'
   9.380 -# List all installed Slim themes.
   9.381 -for dir in $(ls /usr/share/slim/themes)
   9.382 -do
   9.383 -	THEME_ITEMS="<item>$dir</item>"
   9.384 -	MAIN_DIALOG=${MAIN_DIALOG}${THEME_ITEMS}
   9.385 -done		
   9.386 -MAIN_DIALOG=${MAIN_DIALOG}'
   9.387 -				</combobox>	
   9.388 -				<button>
   9.389 -					<label>'`gettext "Preview"`'</label>
   9.390 -					<input file icon="video-display"></input>
   9.391 -					<action>slim -p /usr/share/slim/themes/$NEW_SLIM_THEME &</action>
   9.392 -				</button>
   9.393 -				<button>
   9.394 -					<label>'`gettext "Change"`'</label>
   9.395 -					<input file icon="forward"></input>
   9.396 -					<action>sed -i "s/^current_theme.*/current_theme       $NEW_SLIM_THEME/" /etc/slim.conf</action>
   9.397 -					<action>refresh:SLIM_THEME</action>
   9.398 -				</button>
   9.399 -			</hbox>
   9.400 -			<hbox>
   9.401 -				<text wrap="false">
   9.402 -					<label>"'`gettext "Configuration file:"`'"</label>
   9.403 -				</text>
   9.404 -				<button>
   9.405 -					<label>/etc/slim.conf</label>
   9.406 -					<input file icon="accessories-text-editor"></input>
   9.407 -					<action>leafpad /etc/slim.conf</action>
   9.408 -					<action>refresh:SLIM_SESSIONS</action>
   9.409 -					<action>refresh:SLIM_DEF_USER</action>
   9.410 -				</button>
   9.411 -			</hbox>
   9.412 -		</frame>
   9.413 -	</vbox>'
   9.414 -# Time settings.
   9.415 -MAIN_DIALOG=${MAIN_DIALOG}'	
   9.416 -	<vbox>
   9.417 -		<frame '`gettext "Date and time"`'>
   9.418 -			<hbox>
   9.419 -				<text wrap="false">
   9.420 -					<label>"'`gettext "System time:"`'   "</label>
   9.421 -				</text>
   9.422 -				<entry editable="false">
   9.423 -					<input>LC_ALL=C date</input>
   9.424 -					<variable>DATE</variable>
   9.425 -				</entry>
   9.426 -				<button>
   9.427 -					<label>'`gettext "Sync online"`'</label>
   9.428 -					<input file icon="reload"></input>
   9.429 -					<action>rdate -s tick.greyware.com</action>
   9.430 -					<action>refresh:DATE</action>
   9.431 -					<action>refresh:HWTIME</action>
   9.432 -				</button>
   9.433 -			</hbox>
   9.434 -			<hbox>
   9.435 -				<text wrap="false">
   9.436 -					<label>"'`gettext "Hardware time:"`'"</label>
   9.437 -				</text>
   9.438 -				<entry editable="false">
   9.439 -					<input>LC_ALL=C hwclock</input>
   9.440 -					<variable>HWTIME</variable>
   9.441 -				</entry>
   9.442 -				<button>
   9.443 -					<label>'`gettext "Set from system"`'</label>
   9.444 -					<input file icon="reload"></input>
   9.445 -					<action>hwclock -w -u</action>
   9.446 -					<action>refresh:HWTIME</action>
   9.447 -					<action>refresh:DATE</action>
   9.448 -				</button>
   9.449 -			</hbox>
   9.450 -			<hbox>
   9.451 -				<text wrap="true">
   9.452 -					<label>"'`gettext "Timezone:"`'       "</label>
   9.453 -				</text>
   9.454 -				<entry>
   9.455 -					<input>cat /etc/TZ</input>
   9.456 -					<variable>NEW_TZ</variable>
   9.457 -				</entry>
   9.458 -				<button>
   9.459 -					<label>'`gettext "Change"`'</label>
   9.460 -					<input file icon="forward"></input>
   9.461 -					<action>echo "$NEW_TZ" > /etc/TZ</action>
   9.462 -				</button>
   9.463 -			</hbox>
   9.464 -		</frame>
   9.465 -	</vbox>'
   9.466 -# Language settings.
   9.467 -MAIN_DIALOG=${MAIN_DIALOG}"
   9.468 -	<vbox>
   9.469 -		<tree>
   9.470 -			<width>600</width><height>210</height>
   9.471 -			<variable>LANGUAGE</variable>
   9.472 -			<label>`gettext "Language|Charmap"`</label>
   9.473 -			<input icon_column=\"0\">$0 list_locales</input>
   9.474 -			<action>$0 gen_utf8_locale</action>
   9.475 -		</tree>
   9.476 -		<hbox>
   9.477 -		<text width-chars=\"60\">
   9.478 -			<label>
   9.479 -\"`gettext "To change the system language you can double-click on the locale name."`\"
   9.480 -			</label>
   9.481 -		</text>
   9.482 -		<button>
   9.483 -			<label>`gettext "Keymap"`</label>
   9.484 -			<input file icon=\"input-keyboard\"></input>
   9.485 -			<action>tazkeymap &</action>
   9.486 -		</button>
   9.487 -	</hbox>
   9.488 -	</vbox>"
   9.489 -# Display users list through get_users.
   9.490 -MAIN_DIALOG=${MAIN_DIALOG}"
   9.491 -	<vbox>
   9.492 -		<tree>
   9.493 -			<width>600</width><height>210</height>
   9.494 -			<variable>USER</variable>
   9.495 -			<label>`gettext "Login|uid:gid|Name|Home|SHell"`</label>
   9.496 -			<input icon_column=\"0\">$0 get_users</input>
   9.497 -			<action>$0 manage_user</action>
   9.498 -			<action>refresh:USER</action>
   9.499 -		</tree>
   9.500 -		<hbox>
   9.501 -		<text width-chars=\"60\">
   9.502 -			<label>
   9.503 -\"`gettext "To change passwords or delete users you can double-click on the user name."`\"
   9.504 -			</label>
   9.505 -		</text>
   9.506 -		<button>
   9.507 -			<label>`gettext "Add newuser"`</label>
   9.508 -			<input file icon=\"gtk-add\"></input>
   9.509 -			<action>$0 add_user</action>
   9.510 -			<action>refresh:USER</action>
   9.511 -		</button>
   9.512 -	</hbox>
   9.513 -	</vbox>"
   9.514 -export MAIN_DIALOG=${MAIN_DIALOG}'	
   9.515 -	</notebook>
   9.516 -
   9.517 -	<hbox>
   9.518 -		<button>
   9.519 -			<label>'`gettext "Network"`'</label>
   9.520 -			<input file icon="netbox"></input>
   9.521 -			<action>netbox &</action>
   9.522 -		</button>
   9.523 -		<button>
   9.524 -			<label>'`gettext "Wireless"`'</label>
   9.525 -			<input file icon="network-wireless"></input>
   9.526 -			<action>wifibox &</action>
   9.527 -		</button>
   9.528 -		<button>
   9.529 -			<label>'`gettext "Packages"`'</label>
   9.530 -			<input file icon="tazpkg"></input>
   9.531 -			<action>tazpkgbox &</action>
   9.532 -		</button>
   9.533 -		<button>
   9.534 -			<label>'`gettext "Hardware"`'</label>
   9.535 -			<input file icon="computer"></input>
   9.536 -			<action>tazhw box &</action>
   9.537 -		</button>
   9.538 -		<button>
   9.539 -			<label>'`gettext "Server"`'</label>
   9.540 -			<input file icon="utilities-system-monitor"></input>
   9.541 -			<action>serverbox &</action>
   9.542 -		</button>
   9.543 -		<button>
   9.544 -			<label>'`gettext "Storage"`'</label>
   9.545 -			<input file icon="media-flash"></input>
   9.546 -			<action>mountbox &</action>
   9.547 -		</button>
   9.548 -		<button>
   9.549 -			<label>'`gettext "Exit"`'</label>
   9.550 -			<input file icon="exit"></input>
   9.551 -			<action type="exit">Exit</action>
   9.552 -		</button>
   9.553 -	</hbox>
   9.554 -
   9.555 -</vbox>
   9.556 -
   9.557 -</window>'
   9.558 -
   9.559 -# Script can be called with an arg to exec a function.
   9.560 -if [ -n "$1" ]; then
   9.561 -	$1
   9.562 -else
   9.563 -	gtkdialog --center --program=MAIN_DIALOG >/dev/null
   9.564 -fi
   9.565 -
   9.566 -exit 0
    10.1 --- a/stuff/tazctrlbox.desktop	Fri Apr 29 21:27:38 2011 +0200
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,10 +0,0 @@
    10.4 -[Desktop Entry]
    10.5 -Encoding=UTF-8
    10.6 -Name=Control Box
    10.7 -Name[fr]=Boîte de contrôle
    10.8 -Name[pt]=Painel de Controle
    10.9 -Comment=Manage your SliTaz system
   10.10 -Exec=subox tazctrlbox
   10.11 -Icon=tazctrlbox.png
   10.12 -Type=Application
   10.13 -Categories=System;Application;
    11.1 --- a/stuff/tazfile	Fri Apr 29 21:27:38 2011 +0200
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,140 +0,0 @@
    11.4 -#!/bin/sh
    11.5 -# Tazfile - Tiny autonomus zone files locator.
    11.6 -#
    11.7 -# This is a lightweight files locator for *.tazpkg files written in
    11.8 -# SHell script. It works well with Busybox ash shell and bash. Tazfile lets you
    11.9 -# create and explore a files list database.
   11.10 -#
   11.11 -# (C) 2008 SliTaz - GNU General Public License v3.
   11.12 -#
   11.13 -# Author : Pascal Bellard <pascal.bellard@slitaz.org>
   11.14 -#
   11.15 -VERSION=1.0
   11.16 -
   11.17 -####################
   11.18 -# Script variables #
   11.19 -####################
   11.20 -
   11.21 -# Initialize some variables to use words
   11.22 -# rather than numbers for functions and actions.
   11.23 -COMMAND=$1
   11.24 -TOP_DIR=`pwd`
   11.25 -TMP_DIR=/tmp/tazfile-$$-$RANDOM
   11.26 -
   11.27 -# Path to tazpkg used dir and configuration files
   11.28 -LOCALSTATE=/var/lib/tazpkg
   11.29 -INSTALLED=$LOCALSTATE/installed
   11.30 -MIRROR=$LOCALSTATE/mirror
   11.31 -FILES_LIST=$LOCALSTATE/files.list.lzma
   11.32 -DEFAULT_MIRROR="http://download.tuxfamily.org/slitaz/packages/`cat /etc/slitaz-release`/"
   11.33 -
   11.34 -# Check if the directories and files used by Tazfile
   11.35 -# exist. If not and user is root we create them.
   11.36 -if test $(id -u) = 0 ; then
   11.37 -	if [ ! -d "$INSTALLED" ]; then
   11.38 -		mkdir -p $INSTALLED
   11.39 -	fi
   11.40 -	if [ ! -f "$LOCALSTATE/mirror" ]; then
   11.41 -		echo "$DEFAULT_MIRROR" > $LOCALSTATE/mirror
   11.42 -	fi
   11.43 -fi
   11.44 -
   11.45 -####################
   11.46 -# Script functions #
   11.47 -####################
   11.48 -
   11.49 -# Print the usage.
   11.50 -usage ()
   11.51 -{
   11.52 -	echo -e "SliTaz files locator - Version: $VERSION\n
   11.53 -\033[1mUsage:\033[0m tazfile [command] [file...]\n
   11.54 -\033[1mCommands: \033[0m
   11.55 -  usage            Print this short usage.
   11.56 -  build            Build a files list to stdout from a list of packages.  
   11.57 -  recharge         Recharge your $(basename $FILES_LIST) from the mirror.
   11.58 -  search	   Search for file(s) in all (installed or not) packages.
   11.59 -
   11.60 -\033[1mExample: \033[0m
   11.61 -  $ find . -name '*.tazpkg' | tazfile build > $(basename $FILES_LIST)
   11.62 -  $ tazfile recharge
   11.63 -  $ tazfile search awk cpio "  
   11.64 -}
   11.65 -
   11.66 -# Check for packages.list to download and install packages.
   11.67 -check_for_files_list_lzma()
   11.68 -{
   11.69 -	if [ ! -f "$FILES_LIST" ]; then
   11.70 -		echo -e "
   11.71 -Unable to find the list : $FILES_LIST\n
   11.72 -You must probably run 'tazfile recharge' as root to get the latest list of 
   11.73 -files available on the mirror.\n"
   11.74 -		exit 0
   11.75 -	fi
   11.76 -}
   11.77 -
   11.78 -# Download a file trying all mirrors
   11.79 -download()
   11.80 -{
   11.81 -	for i in $(cat $MIRROR); do
   11.82 -		wget $i$@ && break
   11.83 -	done
   11.84 -}
   11.85 -
   11.86 -build_database()
   11.87 -{
   11.88 -        while read pkg; do
   11.89 -                cat $pkg | ( cd $TMP_DIR
   11.90 -                        cpio -iu > /dev/null 2>&1
   11.91 -                        . ./receipt
   11.92 -                        echo "$PACKAGE"
   11.93 -                        cat ./files.list ) | awk '
   11.94 -                            BEGIN { name="" }
   11.95 -                            {
   11.96 -                                if (name == "") name=$0;
   11.97 -                                else printf("%s: %s\n",name,$0);
   11.98 -                            }'
   11.99 -        done
  11.100 -}
  11.101 -
  11.102 -###################
  11.103 -# Tazpkg commands #
  11.104 -###################
  11.105 -
  11.106 -case "$COMMAND" in
  11.107 -	build)
  11.108 -		# Create files.list.lzma to stdout.
  11.109 -		#
  11.110 -		mkdir $TMP_DIR
  11.111 -		build_database | lzma e -si -so
  11.112 -		rm -rf $TMP_DIR
  11.113 -		;;
  11.114 -	recharge)
  11.115 -		# Recharge files.list.lzma from a mirror.
  11.116 -		#
  11.117 -		cd $LOCALSTATE
  11.118 -		echo ""
  11.119 -		mv -f $FILES_LIST $FILES_LIST.old 2> /dev/null
  11.120 -		download $(basename $FILES_LIST)
  11.121 -		;;
  11.122 -	search)
  11.123 -		# Search for a file by pattern or name in files.list.lzma.
  11.124 -		#
  11.125 -		check_for_files_list_lzma
  11.126 -		while [ -n "$2" ]; do
  11.127 -			unlzma -c $FILES_LIST | \
  11.128 -				grep -i -- "$2$" | while read line; do
  11.129 -					pkg=${line%:*}
  11.130 -					if [ -d $INSTALLED/$pkg ]; then
  11.131 -						echo -n "[already installed]  "
  11.132 -					fi
  11.133 -					echo "$line"
  11.134 -				done
  11.135 -			shift
  11.136 -		done
  11.137 -		;;
  11.138 -	usage|*)
  11.139 -		# Print a short help or give usage for an unknown or empty command.
  11.140 -		#
  11.141 -		usage
  11.142 -		;;
  11.143 -esac
    12.1 --- a/tinyutils/subox	Fri Apr 29 21:27:38 2011 +0200
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,114 +0,0 @@
    12.4 -#!/bin/sh
    12.5 -#
    12.6 -# Gtkdialog to execute program as root from a WM menu.
    12.7 -# (c) SliTaz GNU/Linux 2008-2010 - GNU gpl.
    12.8 -#
    12.9 -VERSION=20100324
   12.10 -
   12.11 -# Usage.
   12.12 -if [ -z "$1" ]; then
   12.13 -    echo "Slitaz subox version : $VERSION"
   12.14 -    echo -e "\nUsage : subox program\n"
   12.15 -    exit 0
   12.16 -fi
   12.17 -
   12.18 -# Nothing to do if we are root
   12.19 -test $(id -u) = 0 && exec $1
   12.20 -
   12.21 -# Include gettext helper script.
   12.22 -. /usr/bin/gettext.sh
   12.23 -
   12.24 -# Export package name for gettext.
   12.25 -TEXTDOMAIN='subox'
   12.26 -export TEXTDOMAIN
   12.27 -
   12.28 -# Keep command in an exported variable to be used by SU_DIALOG.
   12.29 -export SU_CMD=$1
   12.30 -
   12.31 -# Error window if the pwd is wrong.
   12.32 -export ERROR_DIALOG='
   12.33 -<window title="Subox">
   12.34 -  <vbox>
   12.35 -
   12.36 -    <text use-markup="true">
   12.37 -      <label>"
   12.38 -<b>SliTaz - Subox</b>"
   12.39 -      </label>
   12.40 -    </text>
   12.41 -    <text wrap="true" width-chars="48">
   12.42 -	<label>"'`gettext "Error: wrong password!"`'"</label>
   12.43 -    </text>
   12.44 -
   12.45 -    <hbox>
   12.46 -      <button ok></button>
   12.47 -    </hbox>
   12.48 -</vbox>
   12.49 -</window>
   12.50 -'
   12.51 -
   12.52 -# Main window and root password default entry set to 'root'.
   12.53 -SU_DIALOG='
   12.54 -<window title="Subox" skip_taskbar_hint="true">
   12.55 -<vbox>
   12.56 -
   12.57 -	<text use-markup="true">
   12.58 -		<label>"
   12.59 -<b>SliTaz - Subox</b>"
   12.60 -		</label>
   12.61 -	</text>
   12.62 -	<text wrap="true" width-chars="50">
   12.63 -		<label>"'`gettext "
   12.64 -Please enter root password (default root) to execute :"`'
   12.65 -'$@'
   12.66 -"
   12.67 -		</label>
   12.68 -	</text>
   12.69 -	
   12.70 -	<hbox>
   12.71 -		<text use-markup="true">
   12.72 -			<label>"'`gettext "<b>Admin password :</b>"`'"</label>
   12.73 -		</text>
   12.74 -		<entry visibility="false">'
   12.75 -
   12.76 -# Check if we have a saved passwd.
   12.77 -if [ -s $HOME/.config/slitaz/subox.conf ]; then
   12.78 -	PASSWD=`cat $HOME/.config/slitaz/subox.conf`
   12.79 -	[ -n "$PASSWD" ] && SU_DIALOG="$SU_DIALOG <default>$PASSWD</default>" && AUTO_SAVED_PASSWD=true
   12.80 -else 
   12.81 -AUTO_SAVED_PASSWD=false
   12.82 -fi
   12.83 -
   12.84 -export SU_DIALOG=''${SU_DIALOG}'
   12.85 -			<variable>PASSWD</variable>
   12.86 -		</entry>
   12.87 -	</hbox>
   12.88 -	
   12.89 -	<hbox>
   12.90 -		<checkbox>
   12.91 -			
   12.92 -			<label>"'`gettext "Autosave password"`'"</label>
   12.93 -			<variable>AUTOSAVE</variable>'
   12.94 -if [ $AUTO_SAVED_PASSWD = "true" ]
   12.95 -	then SU_DIALOG="$SU_DIALOG <default>true</default>"
   12.96 -	else SU_DIALOG="$SU_DIALOG <default>false</default>"
   12.97 -fi
   12.98 -
   12.99 -export SU_DIALOG=''${SU_DIALOG}'
  12.100 -			
  12.101 -		</checkbox>
  12.102 -		<button ok>
  12.103 -			<action> echo $PASSWD | su -c "$SU_CMD &" || gtkdialog --center --program=ERROR_DIALOG</action>
  12.104 -			<action>[ $AUTOSAVE == true ] && echo $PASSWD > '$HOME/.config/slitaz/subox.conf'</action>
  12.105 -			<action>[ $AUTOSAVE == true ] && chmod 0600 '$HOME/.config/slitaz/subox.conf'</action>
  12.106 -			<action>[ $AUTOSAVE == false ] && cat /dev/null > '$HOME/.config/slitaz/subox.conf'</action>
  12.107 -			<action type="closewindow">SU_DIALOG</action>
  12.108 -		</button>
  12.109 -		<button cancel></button>
  12.110 -	</hbox>
  12.111 -
  12.112 -</vbox>
  12.113 -</window>'
  12.114 -
  12.115 -gtkdialog --center --program=SU_DIALOG > /dev/null
  12.116 -
  12.117 -exit 0