slitaz-tools rev 576
move tazctrlbox files to old stuff (replaced by TazPanel)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Apr 29 16:15:16 2011 +0200 (2011-04-29) |
parents | 7e8f98aac2f9 |
children | b6972d7bcf5e |
files | Makefile po/tazctrlbox/tazctrlbox.pot rootfs/usr/share/applications/tazctrlbox.desktop rootfs/usr/share/pixmaps/tazctrlbox.png stuff/images/tazctrlbox.png stuff/tazctrlbox stuff/tazctrlbox.desktop tinyutils/tazctrlbox |
line diff
1.1 --- a/Makefile Fri Apr 29 16:12:11 2011 +0200 1.2 +++ b/Makefile Fri Apr 29 16:15:16 2011 +0200 1.3 @@ -4,7 +4,7 @@ 1.4 PREFIX?=/usr 1.5 DOCDIR?=/usr/share/doc 1.6 DESTDIR?= 1.7 -TINYUTILS?=subox scpbox tazctrlbox 1.8 +TINYUTILS?=subox scpbox 1.9 LINGUAS?=fr pt 1.10 1.11 all:
2.1 --- a/po/tazctrlbox/tazctrlbox.pot Fri Apr 29 16:12:11 2011 +0200 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,199 +0,0 @@ 2.4 -# SOME DESCRIPTIVE TITLE. 2.5 -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 2.6 -# This file is distributed under the same license as the PACKAGE package. 2.7 -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 2.8 -# 2.9 -#, fuzzy 2.10 -msgid "" 2.11 -msgstr "" 2.12 -"Project-Id-Version: tazctrlbox\n" 2.13 -"Report-Msgid-Bugs-To: \n" 2.14 -"POT-Creation-Date: 2011-04-29 13:39+0200\n" 2.15 -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 2.16 -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 2.17 -"Language-Team: LANGUAGE <LL@li.org>\n" 2.18 -"Language: \n" 2.19 -"MIME-Version: 1.0\n" 2.20 -"Content-Type: text/plain; charset=CHARSET\n" 2.21 -"Content-Transfer-Encoding: 8bit\n" 2.22 - 2.23 -#: tinyutils/tazctrlbox:91 2.24 -msgid "Manage user: " 2.25 -msgstr "" 2.26 - 2.27 -#: tinyutils/tazctrlbox:102 2.28 -msgid "New password:" 2.29 -msgstr "" 2.30 - 2.31 -#: tinyutils/tazctrlbox:116 2.32 -msgid "Delete user" 2.33 -msgstr "" 2.34 - 2.35 -#: tinyutils/tazctrlbox:139 2.36 -msgid "" 2.37 -"\n" 2.38 -"New account information" 2.39 -msgstr "" 2.40 - 2.41 -#: tinyutils/tazctrlbox:146 2.42 -msgid "Login:" 2.43 -msgstr "" 2.44 - 2.45 -#: tinyutils/tazctrlbox:154 2.46 -msgid "Password:" 2.47 -msgstr "" 2.48 - 2.49 -#: tinyutils/tazctrlbox:207 2.50 -msgid "SliTaz Control Box" 2.51 -msgstr "" 2.52 - 2.53 -#: tinyutils/tazctrlbox:212 2.54 -msgid "<b>SliTaz Control Box</b>" 2.55 -msgstr "" 2.56 - 2.57 -#: tinyutils/tazctrlbox:219 2.58 -msgid "Boot loader|Initialization|Login manager|Time|Language|Users" 2.59 -msgstr "" 2.60 - 2.61 -#: tinyutils/tazctrlbox:224 2.62 -msgid "Grub boot loader" 2.63 -msgstr "" 2.64 - 2.65 -#: tinyutils/tazctrlbox:227 2.66 -msgid "Timeout:" 2.67 -msgstr "" 2.68 - 2.69 -#: tinyutils/tazctrlbox:234 tinyutils/tazctrlbox:248 tinyutils/tazctrlbox:294 2.70 -#: tinyutils/tazctrlbox:308 tinyutils/tazctrlbox:338 tinyutils/tazctrlbox:352 2.71 -#: tinyutils/tazctrlbox:366 tinyutils/tazctrlbox:391 tinyutils/tazctrlbox:456 2.72 -msgid "Change" 2.73 -msgstr "" 2.74 - 2.75 -#: tinyutils/tazctrlbox:241 2.76 -msgid "Color:" 2.77 -msgstr "" 2.78 - 2.79 -#: tinyutils/tazctrlbox:255 tinyutils/tazctrlbox:399 2.80 -msgid "Configuration file:" 2.81 -msgstr "" 2.82 - 2.83 -#: tinyutils/tazctrlbox:270 2.84 -msgid "rcS init scripts" 2.85 -msgstr "" 2.86 - 2.87 -#: tinyutils/tazctrlbox:273 2.88 -msgid "Check filesystems:" 2.89 -msgstr "" 2.90 - 2.91 -#: tinyutils/tazctrlbox:287 2.92 -msgid "Load modules:" 2.93 -msgstr "" 2.94 - 2.95 -#: tinyutils/tazctrlbox:301 2.96 -msgid "Run daemons:" 2.97 -msgstr "" 2.98 - 2.99 -#: tinyutils/tazctrlbox:315 2.100 -msgid "Add local commands:" 2.101 -msgstr "" 2.102 - 2.103 -#: tinyutils/tazctrlbox:328 2.104 -msgid "Slim settings" 2.105 -msgstr "" 2.106 - 2.107 -#: tinyutils/tazctrlbox:331 2.108 -msgid "Sessions:" 2.109 -msgstr "" 2.110 - 2.111 -#: tinyutils/tazctrlbox:345 2.112 -msgid "Default user:" 2.113 -msgstr "" 2.114 - 2.115 -#: tinyutils/tazctrlbox:359 2.116 -msgid "Auto login (yes|no):" 2.117 -msgstr "" 2.118 - 2.119 -#: tinyutils/tazctrlbox:373 2.120 -msgid "Theme:" 2.121 -msgstr "" 2.122 - 2.123 -#: tinyutils/tazctrlbox:386 2.124 -msgid "Preview" 2.125 -msgstr "" 2.126 - 2.127 -#: tinyutils/tazctrlbox:414 2.128 -msgid "Date and time" 2.129 -msgstr "" 2.130 - 2.131 -#: tinyutils/tazctrlbox:417 2.132 -msgid "System time:" 2.133 -msgstr "" 2.134 - 2.135 -#: tinyutils/tazctrlbox:424 2.136 -msgid "Sync online" 2.137 -msgstr "" 2.138 - 2.139 -#: tinyutils/tazctrlbox:433 2.140 -msgid "Hardware time:" 2.141 -msgstr "" 2.142 - 2.143 -#: tinyutils/tazctrlbox:440 2.144 -msgid "Set from system" 2.145 -msgstr "" 2.146 - 2.147 -#: tinyutils/tazctrlbox:449 2.148 -msgid "Timezone:" 2.149 -msgstr "" 2.150 - 2.151 -#: tinyutils/tazctrlbox:469 2.152 -msgid "Language|Charmap" 2.153 -msgstr "" 2.154 - 2.155 -#: tinyutils/tazctrlbox:476 2.156 -msgid "To change the system language you can double-click on the locale name." 2.157 -msgstr "" 2.158 - 2.159 -#: tinyutils/tazctrlbox:480 2.160 -msgid "Keymap" 2.161 -msgstr "" 2.162 - 2.163 -#: tinyutils/tazctrlbox:492 2.164 -msgid "Login|uid:gid|Name|Home|SHell" 2.165 -msgstr "" 2.166 - 2.167 -#: tinyutils/tazctrlbox:500 2.168 -msgid "" 2.169 -"To change passwords or delete users you can double-click on the user name." 2.170 -msgstr "" 2.171 - 2.172 -#: tinyutils/tazctrlbox:504 2.173 -msgid "Add newuser" 2.174 -msgstr "" 2.175 - 2.176 -#: tinyutils/tazctrlbox:516 2.177 -msgid "Network" 2.178 -msgstr "" 2.179 - 2.180 -#: tinyutils/tazctrlbox:521 2.181 -msgid "Wireless" 2.182 -msgstr "" 2.183 - 2.184 -#: tinyutils/tazctrlbox:526 2.185 -msgid "Packages" 2.186 -msgstr "" 2.187 - 2.188 -#: tinyutils/tazctrlbox:531 2.189 -msgid "Hardware" 2.190 -msgstr "" 2.191 - 2.192 -#: tinyutils/tazctrlbox:536 2.193 -msgid "Server" 2.194 -msgstr "" 2.195 - 2.196 -#: tinyutils/tazctrlbox:541 2.197 -msgid "Storage" 2.198 -msgstr "" 2.199 - 2.200 -#: tinyutils/tazctrlbox:546 2.201 -msgid "Exit" 2.202 -msgstr ""
3.1 --- a/rootfs/usr/share/applications/tazctrlbox.desktop Fri Apr 29 16:12:11 2011 +0200 3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 3.3 @@ -1,10 +0,0 @@ 3.4 -[Desktop Entry] 3.5 -Encoding=UTF-8 3.6 -Name=Control Box 3.7 -Name[fr]=Boîte de contrôle 3.8 -Name[pt]=Painel de Controle 3.9 -Comment=Manage your SliTaz system 3.10 -Exec=subox tazctrlbox 3.11 -Icon=tazctrlbox.png 3.12 -Type=Application 3.13 -Categories=System;Application;
4.1 Binary file rootfs/usr/share/pixmaps/tazctrlbox.png has changed
5.1 Binary file stuff/images/tazctrlbox.png has changed
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/stuff/tazctrlbox Fri Apr 29 16:15:16 2011 +0200 6.3 @@ -0,0 +1,563 @@ 6.4 +#!/bin/sh 6.5 +# 6.6 +# SliTaz Control Box is a tool to configure and manage a SliTaz system. 6.7 +# The script uses GTKdialog for the UI interface. Some shell functions 6.8 +# are called by argument. Individual window dialogs are put into 6.9 +# functions. 6.10 +# 6.11 +# (C) GNU gpl v3 - SliTaz GNU/Linux 2010. 6.12 +# Author: Christophe Lincoln <pankso@slitaz.org> 6.13 +# 6.14 +VERSION=1.1 6.15 + 6.16 +# Include gettext helper script. 6.17 +. /usr/bin/gettext.sh 6.18 + 6.19 +# Export package name for gettext. 6.20 +TEXTDOMAIN='tazctrlbox' 6.21 +export TEXTDOMAIN 6.22 + 6.23 +# Get init configuration. 6.24 +. /etc/rcS.conf 6.25 + 6.26 +# Tazctrlbox is only for root. 6.27 +if test $(id -u) != 0 ; then 6.28 + exec subox $0 6.29 + exit 0 6.30 +fi 6.31 + 6.32 +# By default autologin is not configured on an installed system. 6.33 +if ! grep -q 'auto_login' /etc/slim.conf; then 6.34 + echo '# Auto login default user' >> /etc/slim.conf 6.35 + echo 'auto_login no' >> /etc/slim.conf 6.36 +fi 6.37 + 6.38 +# Change Grub menu.lst timeout. 6.39 +sed_grub_timeout() 6.40 +{ 6.41 + CURRENT=`cat /boot/grub/menu.lst | grep ^timeout | cut -d " " -f2` 6.42 + sed -i s/"timeout $CURRENT"/"timeout $GRUB_TIMEOUT"/ /boot/grub/menu.lst 6.43 +} 6.44 + 6.45 +# Change Grub menu.lst timeout. 6.46 +sed_grub_color() 6.47 +{ 6.48 + CURRENT=`cat /boot/grub/menu.lst | grep ^color | cut -d " " -f2-3` 6.49 + sed -i s#"color $CURRENT"#"color $GRUB_COLOR"# /boot/grub/menu.lst 6.50 +} 6.51 + 6.52 +# Set check fs on boot. 6.53 +sed_check_fs() 6.54 +{ 6.55 + sed -i s#"CHECK_FS=\"$CHECK_FS\""#"CHECK_FS=\"$NEW_CHECK_FS\""# \ 6.56 + /etc/rcS.conf 6.57 +} 6.58 + 6.59 +# Set loaded modules on boot. 6.60 +sed_load_modules() 6.61 +{ 6.62 + sed -i s/"LOAD_MODULES=\"$LOAD_MODULES\""/"LOAD_MODULES=\"$NEW_MODULES\""/ \ 6.63 + /etc/rcS.conf 6.64 +} 6.65 + 6.66 +# Set daemons to run on boot. 6.67 +sed_run_daemons() 6.68 +{ 6.69 + sed -i s/"RUN_DAEMONS=\"$RUN_DAEMONS\""/"RUN_DAEMONS=\"$NEW_DAEMONS\""/ \ 6.70 + /etc/rcS.conf 6.71 +} 6.72 + 6.73 +# Get user list. 6.74 +get_users() 6.75 +{ 6.76 + for i in `cat /etc/passwd | cut -d ":" -f 1` 6.77 + do 6.78 + if [ -d /home/$i ]; then 6.79 + login=$i 6.80 + uid=`cat /etc/passwd | grep $i | cut -d ":" -f 3` 6.81 + gid=`cat /etc/passwd | grep $i | cut -d ":" -f 4` 6.82 + name=`cat /etc/passwd | grep $i | cut -d ":" -f 5 | sed s/,,,//` 6.83 + home=`cat /etc/passwd | grep $i | cut -d ":" -f 6` 6.84 + shell=`cat /etc/passwd | grep $i | cut -d ":" -f 7` 6.85 + echo "system-users | $login | $uid:$gid | $name | $home | $shell" 6.86 + fi 6.87 + done 6.88 +} 6.89 + 6.90 +# Remove a user or change passwd. 6.91 +manage_user() 6.92 +{ 6.93 + export MANAGE_DIALOG=" 6.94 +<window title=\"`gettext "Manage user: "`$USER\" icon-name=\"computer\"> 6.95 + <vbox> 6.96 + <vbox> 6.97 + <text wrap=\"false\" width-chars=\"34\"> 6.98 + <label>\" 6.99 +Login name: $USER 6.100 + \"</label> 6.101 + </text> 6.102 + </vbox> 6.103 + <hbox> 6.104 + <text wrap=\"false\"> 6.105 + <label>\"`gettext "New password:"`\"</label> 6.106 + </text> 6.107 + <entry invisible_char=\"*\" visibility=\"false\" max_length=\"8\"> 6.108 + <variable>PASSWD</variable> 6.109 + </entry> 6.110 + <button> 6.111 + <label>Change</label> 6.112 + <input file icon=\"forward\"></input> 6.113 + <action>echo \"$USER:$PASSWD\" | chpasswd</action> 6.114 + <action type=\"closewindow\">MANAGE_USER</action> 6.115 + </button> 6.116 + </hbox> 6.117 + <hbox> 6.118 + <button> 6.119 + <label>`gettext "Delete user"`</label> 6.120 + <input file icon=\"gtk-delete\"></input> 6.121 + <action>deluser $USER</action> 6.122 + <action type=\"closewindow\">MANAGE_USER</action> 6.123 + </button> 6.124 + <button cancel> 6.125 + <action type=\"closewindow\">MANAGE_USER</action> 6.126 + </button> 6.127 + </hbox> 6.128 + </vbox> 6.129 +</window> 6.130 +" 6.131 + gtkdialog --center --program=MANAGE_DIALOG >/dev/null 6.132 +} 6.133 + 6.134 +# Add a new user. 6.135 +add_user() 6.136 +{ 6.137 + export ADD_USER_DIALOG=' 6.138 +<window title="New user" icon-name="gtk-add"> 6.139 + <vbox> 6.140 + <vbox> 6.141 + <text wrap="false" width-chars="34"> 6.142 + <label>"'`gettext " 6.143 +New account information"`' 6.144 + "</label> 6.145 + </text> 6.146 + </vbox> 6.147 + <hbox> 6.148 + <text wrap="false"> 6.149 + <label>"'`gettext "Login:"`' "</label> 6.150 + </text> 6.151 + <entry> 6.152 + <variable>NEW_USER</variable> 6.153 + </entry> 6.154 + </hbox> 6.155 + <hbox> 6.156 + <text wrap="false"> 6.157 + <label>"'`gettext "Password:"`'"</label> 6.158 + </text> 6.159 + <entry invisible_char="*" visibility="false" max_length="8"> 6.160 + <variable>PASSWD</variable> 6.161 + </entry> 6.162 + </hbox> 6.163 + <hbox> 6.164 + <button ok> 6.165 + <action>adduser -D $NEW_USER</action> 6.166 + <action>echo "$NEW_USER:$PASSWD" | chpasswd</action> 6.167 + <action>addgroup $NEW_USER audio</action> 6.168 + <action>addgroup $NEW_USER cdrom</action> 6.169 + <action>addgroup $NEW_USER floppy</action> 6.170 + <action>addgroup $NEW_USER video</action> 6.171 + <action>rmdir /home/$NEW_USER</action> 6.172 + <action>cp -a /etc/skel /home/$NEW_USER</action> 6.173 + <action>cp /root/.xinitrc /home/$NEW_USER</action> 6.174 + <action>mkdir -p /home/$NEW_USER/.config/slitaz</action> 6.175 + <action>cp -a /etc/slitaz/applications.conf /home/$NEW_USER/.config/slitaz</action> 6.176 + <action>chown -R $NEW_USER:$NEW_USER /home/$NEW_USER</action> 6.177 + <action type="closewindow">MANAGE_USER</action> 6.178 + </button> 6.179 + <button cancel> 6.180 + <action type="closewindow">MANAGE_USER</action> 6.181 + </button> 6.182 + </hbox> 6.183 + </vbox> 6.184 +</window> 6.185 +' 6.186 + gtkdialog --center --program=ADD_USER_DIALOG >/dev/null 6.187 +} 6.188 + 6.189 +# i18n functions. 6.190 +list_locales() 6.191 +{ 6.192 + cd /usr/share/i18n/locales 6.193 + for locale in `ls -1 [a-z][a-z]_[A-Z][A-Z]` 6.194 + do 6.195 + echo "preferences-desktop-locale | $locale | UTF-8" 6.196 + done 6.197 +} 6.198 +gen_utf8_locale() 6.199 +{ 6.200 + rm -rf /usr/lib/locale/$LANGUAGE 6.201 + localedef -i $LANGUAGE -c -f UTF-8 /usr/lib/locale/$LANGUAGE 6.202 + # System configuration 6.203 + echo "LANG=$LANGUAGE" > /etc/locale.conf 6.204 + echo "LC_ALL=$LANGUAGE" >> /etc/locale.conf 6.205 +} 6.206 + 6.207 +# Main dialog with notebook. 6.208 +# 6.209 +export MAIN_DIALOG=' 6.210 +<window title="'`gettext "SliTaz Control Box"`'" icon-name="computer"> 6.211 +<vbox> 6.212 + 6.213 + <hbox> 6.214 + <text use-markup="true"> 6.215 + <label>"'`gettext "<b>SliTaz Control Box</b>"`'"</label> 6.216 + </text> 6.217 + <pixmap> 6.218 + <input file>/usr/share/pixmaps/tazctrlbox.png</input> 6.219 + </pixmap> 6.220 + </hbox> 6.221 + 6.222 + <notebook labels="'`gettext "Boot loader|Initialization|Login manager|Time|Language|Users"`'">' 6.223 + 6.224 +# GRUB. 6.225 +MAIN_DIALOG=${MAIN_DIALOG}" 6.226 + <vbox> 6.227 + <frame `gettext "Grub boot loader"`> 6.228 + <hbox> 6.229 + <text wrap=\"false\"> 6.230 + <label>\"`gettext "Timeout:"`\"</label> 6.231 + </text> 6.232 + <entry> 6.233 + <input>cat /boot/grub/menu.lst | grep ^timeout | cut -d \" \" -f2</input> 6.234 + <variable>GRUB_TIMEOUT</variable> 6.235 + </entry> 6.236 + <button> 6.237 + <label>`gettext "Change"`</label> 6.238 + <input file icon=\"forward\"></input> 6.239 + <action>$0 sed_grub_timeout</action> 6.240 + </button> 6.241 + </hbox> 6.242 + <hbox> 6.243 + <text wrap=\"false\"> 6.244 + <label>\"`gettext "Color:"` \"</label> 6.245 + </text> 6.246 + <entry> 6.247 + <input>cat /boot/grub/menu.lst | grep ^color | cut -d \" \" -f2-3</input> 6.248 + <variable>GRUB_COLOR</variable> 6.249 + </entry> 6.250 + <button> 6.251 + <label>`gettext "Change"`</label> 6.252 + <input file icon=\"forward\"></input> 6.253 + <action>$0 sed_grub_color</action> 6.254 + </button> 6.255 + </hbox> 6.256 + <hbox> 6.257 + <text wrap=\"false\"> 6.258 + <label>\"`gettext "Configuration file:"`\"</label> 6.259 + </text> 6.260 + <button> 6.261 + <label>/boot/grub/menu.lst</label> 6.262 + <input file icon=\"accessories-text-editor\"></input> 6.263 + <action>leafpad /boot/grub/menu.lst</action> 6.264 + <action>refresh:GRUB_COLOR</action> 6.265 + <action>refresh:GRUB_TIMEOUT</action> 6.266 + </button> 6.267 + </hbox> 6.268 + </frame> 6.269 + </vbox>" 6.270 +# Init script. 6.271 +MAIN_DIALOG=${MAIN_DIALOG}" 6.272 + <vbox> 6.273 + <frame `gettext "rcS init scripts"`> 6.274 + <hbox> 6.275 + <text wrap=\"false\"> 6.276 + <label>\"`gettext "Check filesystems:"`\"</label> 6.277 + </text> 6.278 + <entry> 6.279 + <input>echo $CHECK_FS</input> 6.280 + <variable>NEW_CHECK_FS</variable> 6.281 + </entry> 6.282 + <button> 6.283 + <label>Change</label> 6.284 + <input file icon=\"forward\"></input> 6.285 + <action>$0 sed_check_fs</action> 6.286 + </button> 6.287 + </hbox> 6.288 + <hbox> 6.289 + <text wrap=\"false\"> 6.290 + <label>\"`gettext "Load modules:"` \"</label> 6.291 + </text> 6.292 + <entry> 6.293 + <input>echo $LOAD_MODULES</input> 6.294 + <variable>NEW_MODULES</variable> 6.295 + </entry> 6.296 + <button> 6.297 + <label>`gettext "Change"`</label> 6.298 + <input file icon=\"forward\"></input> 6.299 + <action>$0 sed_load_modules</action> 6.300 + </button> 6.301 + </hbox> 6.302 + <hbox> 6.303 + <text wrap=\"false\"> 6.304 + <label>\"`gettext "Run daemons:"` \"</label> 6.305 + </text> 6.306 + <entry> 6.307 + <input>echo $RUN_DAEMONS</input> 6.308 + <variable>NEW_DAEMONS</variable> 6.309 + </entry> 6.310 + <button> 6.311 + <label>`gettext "Change"`</label> 6.312 + <input file icon=\"forward\"></input> 6.313 + <action>$0 sed_run_daemons</action> 6.314 + </button> 6.315 + </hbox> 6.316 + <hbox> 6.317 + <text wrap=\"false\"> 6.318 + <label>\"`gettext "Add local commands:"`\"</label> 6.319 + </text> 6.320 + <button> 6.321 + <label>/etc/init.d/local.sh</label> 6.322 + <input file icon=\"accessories-text-editor\"></input> 6.323 + <action>leafpad /etc/init.d/local.sh</action> 6.324 + </button> 6.325 + </hbox> 6.326 + </frame> 6.327 + </vbox>" 6.328 +# Slim login. 6.329 +MAIN_DIALOG=${MAIN_DIALOG}' 6.330 + <vbox> 6.331 + <frame '`gettext "Slim settings"`'> 6.332 + <hbox> 6.333 + <text wrap="false"> 6.334 + <label>"'`gettext "Sessions:"`' "</label> 6.335 + </text> 6.336 + <entry> 6.337 + <input>cat /etc/slim.conf | grep ^session | sed s/"sessions. *"//</input> 6.338 + <variable>SLIM_SESSIONS</variable> 6.339 + </entry> 6.340 + <button> 6.341 + <label>'`gettext "Change"`'</label> 6.342 + <input file icon="forward"></input> 6.343 + <action>sed -i "s/^sessions.*/sessions $SLIM_SESSIONS/" /etc/slim.conf</action> 6.344 + </button> 6.345 + </hbox> 6.346 + <hbox> 6.347 + <text wrap="false"> 6.348 + <label>"'`gettext "Default user:"`' "</label> 6.349 + </text> 6.350 + <entry> 6.351 + <input>cat /etc/slim.conf | grep ^default_user | sed s/"default_user. *"//</input> 6.352 + <variable>SLIM_DEF_USER</variable> 6.353 + </entry> 6.354 + <button> 6.355 + <label>'`gettext "Change"`'</label> 6.356 + <input file icon="forward"></input> 6.357 + <action>sed -i "s/^default_user.*/default_user $SLIM_DEF_USER/" /etc/slim.conf</action> 6.358 + </button> 6.359 + </hbox> 6.360 + <hbox> 6.361 + <text wrap="false"> 6.362 + <label>"'`gettext "Auto login (yes|no):"`' "</label> 6.363 + </text> 6.364 + <entry max_length="3"> 6.365 + <input>cat /etc/slim.conf | grep ^auto_login | sed s/"auto_login. *"//</input> 6.366 + <variable>SLIM_AUTO_LOGIN</variable> 6.367 + </entry> 6.368 + <button> 6.369 + <label>'`gettext "Change"`'</label> 6.370 + <input file icon="forward"></input> 6.371 + <action>sed -i "s/^auto_login.*/auto_login $SLIM_AUTO_LOGIN/" /etc/slim.conf</action> 6.372 + </button> 6.373 + </hbox> 6.374 + <hbox> 6.375 + <text wrap="false"> 6.376 + <label>"'`gettext "Theme:"`'"</label> 6.377 + </text> 6.378 + <combobox> 6.379 + <variable>NEW_SLIM_THEME</variable>' 6.380 +# List all installed Slim themes. 6.381 +for dir in $(ls /usr/share/slim/themes) 6.382 +do 6.383 + THEME_ITEMS="<item>$dir</item>" 6.384 + MAIN_DIALOG=${MAIN_DIALOG}${THEME_ITEMS} 6.385 +done 6.386 +MAIN_DIALOG=${MAIN_DIALOG}' 6.387 + </combobox> 6.388 + <button> 6.389 + <label>'`gettext "Preview"`'</label> 6.390 + <input file icon="video-display"></input> 6.391 + <action>slim -p /usr/share/slim/themes/$NEW_SLIM_THEME &</action> 6.392 + </button> 6.393 + <button> 6.394 + <label>'`gettext "Change"`'</label> 6.395 + <input file icon="forward"></input> 6.396 + <action>sed -i "s/^current_theme.*/current_theme $NEW_SLIM_THEME/" /etc/slim.conf</action> 6.397 + <action>refresh:SLIM_THEME</action> 6.398 + </button> 6.399 + </hbox> 6.400 + <hbox> 6.401 + <text wrap="false"> 6.402 + <label>"'`gettext "Configuration file:"`'"</label> 6.403 + </text> 6.404 + <button> 6.405 + <label>/etc/slim.conf</label> 6.406 + <input file icon="accessories-text-editor"></input> 6.407 + <action>leafpad /etc/slim.conf</action> 6.408 + <action>refresh:SLIM_SESSIONS</action> 6.409 + <action>refresh:SLIM_DEF_USER</action> 6.410 + </button> 6.411 + </hbox> 6.412 + </frame> 6.413 + </vbox>' 6.414 +# Time settings. 6.415 +MAIN_DIALOG=${MAIN_DIALOG}' 6.416 + <vbox> 6.417 + <frame '`gettext "Date and time"`'> 6.418 + <hbox> 6.419 + <text wrap="false"> 6.420 + <label>"'`gettext "System time:"`' "</label> 6.421 + </text> 6.422 + <entry editable="false"> 6.423 + <input>LC_ALL=C date</input> 6.424 + <variable>DATE</variable> 6.425 + </entry> 6.426 + <button> 6.427 + <label>'`gettext "Sync online"`'</label> 6.428 + <input file icon="reload"></input> 6.429 + <action>rdate -s tick.greyware.com</action> 6.430 + <action>refresh:DATE</action> 6.431 + <action>refresh:HWTIME</action> 6.432 + </button> 6.433 + </hbox> 6.434 + <hbox> 6.435 + <text wrap="false"> 6.436 + <label>"'`gettext "Hardware time:"`'"</label> 6.437 + </text> 6.438 + <entry editable="false"> 6.439 + <input>LC_ALL=C hwclock</input> 6.440 + <variable>HWTIME</variable> 6.441 + </entry> 6.442 + <button> 6.443 + <label>'`gettext "Set from system"`'</label> 6.444 + <input file icon="reload"></input> 6.445 + <action>hwclock -w -u</action> 6.446 + <action>refresh:HWTIME</action> 6.447 + <action>refresh:DATE</action> 6.448 + </button> 6.449 + </hbox> 6.450 + <hbox> 6.451 + <text wrap="true"> 6.452 + <label>"'`gettext "Timezone:"`' "</label> 6.453 + </text> 6.454 + <entry> 6.455 + <input>cat /etc/TZ</input> 6.456 + <variable>NEW_TZ</variable> 6.457 + </entry> 6.458 + <button> 6.459 + <label>'`gettext "Change"`'</label> 6.460 + <input file icon="forward"></input> 6.461 + <action>echo "$NEW_TZ" > /etc/TZ</action> 6.462 + </button> 6.463 + </hbox> 6.464 + </frame> 6.465 + </vbox>' 6.466 +# Language settings. 6.467 +MAIN_DIALOG=${MAIN_DIALOG}" 6.468 + <vbox> 6.469 + <tree> 6.470 + <width>600</width><height>210</height> 6.471 + <variable>LANGUAGE</variable> 6.472 + <label>`gettext "Language|Charmap"`</label> 6.473 + <input icon_column=\"0\">$0 list_locales</input> 6.474 + <action>$0 gen_utf8_locale</action> 6.475 + </tree> 6.476 + <hbox> 6.477 + <text width-chars=\"60\"> 6.478 + <label> 6.479 +\"`gettext "To change the system language you can double-click on the locale name."`\" 6.480 + </label> 6.481 + </text> 6.482 + <button> 6.483 + <label>`gettext "Keymap"`</label> 6.484 + <input file icon=\"input-keyboard\"></input> 6.485 + <action>tazkeymap &</action> 6.486 + </button> 6.487 + </hbox> 6.488 + </vbox>" 6.489 +# Display users list through get_users. 6.490 +MAIN_DIALOG=${MAIN_DIALOG}" 6.491 + <vbox> 6.492 + <tree> 6.493 + <width>600</width><height>210</height> 6.494 + <variable>USER</variable> 6.495 + <label>`gettext "Login|uid:gid|Name|Home|SHell"`</label> 6.496 + <input icon_column=\"0\">$0 get_users</input> 6.497 + <action>$0 manage_user</action> 6.498 + <action>refresh:USER</action> 6.499 + </tree> 6.500 + <hbox> 6.501 + <text width-chars=\"60\"> 6.502 + <label> 6.503 +\"`gettext "To change passwords or delete users you can double-click on the user name."`\" 6.504 + </label> 6.505 + </text> 6.506 + <button> 6.507 + <label>`gettext "Add newuser"`</label> 6.508 + <input file icon=\"gtk-add\"></input> 6.509 + <action>$0 add_user</action> 6.510 + <action>refresh:USER</action> 6.511 + </button> 6.512 + </hbox> 6.513 + </vbox>" 6.514 +export MAIN_DIALOG=${MAIN_DIALOG}' 6.515 + </notebook> 6.516 + 6.517 + <hbox> 6.518 + <button> 6.519 + <label>'`gettext "Network"`'</label> 6.520 + <input file icon="netbox"></input> 6.521 + <action>netbox &</action> 6.522 + </button> 6.523 + <button> 6.524 + <label>'`gettext "Wireless"`'</label> 6.525 + <input file icon="network-wireless"></input> 6.526 + <action>wifibox &</action> 6.527 + </button> 6.528 + <button> 6.529 + <label>'`gettext "Packages"`'</label> 6.530 + <input file icon="tazpkg"></input> 6.531 + <action>tazpkgbox &</action> 6.532 + </button> 6.533 + <button> 6.534 + <label>'`gettext "Hardware"`'</label> 6.535 + <input file icon="computer"></input> 6.536 + <action>tazhw box &</action> 6.537 + </button> 6.538 + <button> 6.539 + <label>'`gettext "Server"`'</label> 6.540 + <input file icon="utilities-system-monitor"></input> 6.541 + <action>serverbox &</action> 6.542 + </button> 6.543 + <button> 6.544 + <label>'`gettext "Storage"`'</label> 6.545 + <input file icon="media-flash"></input> 6.546 + <action>mountbox &</action> 6.547 + </button> 6.548 + <button> 6.549 + <label>'`gettext "Exit"`'</label> 6.550 + <input file icon="exit"></input> 6.551 + <action type="exit">Exit</action> 6.552 + </button> 6.553 + </hbox> 6.554 + 6.555 +</vbox> 6.556 + 6.557 +</window>' 6.558 + 6.559 +# Script can be called with an arg to exec a function. 6.560 +if [ -n "$1" ]; then 6.561 + $1 6.562 +else 6.563 + gtkdialog --center --program=MAIN_DIALOG >/dev/null 6.564 +fi 6.565 + 6.566 +exit 0
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/stuff/tazctrlbox.desktop Fri Apr 29 16:15:16 2011 +0200 7.3 @@ -0,0 +1,10 @@ 7.4 +[Desktop Entry] 7.5 +Encoding=UTF-8 7.6 +Name=Control Box 7.7 +Name[fr]=Boîte de contrôle 7.8 +Name[pt]=Painel de Controle 7.9 +Comment=Manage your SliTaz system 7.10 +Exec=subox tazctrlbox 7.11 +Icon=tazctrlbox.png 7.12 +Type=Application 7.13 +Categories=System;Application;
8.1 --- a/tinyutils/tazctrlbox Fri Apr 29 16:12:11 2011 +0200 8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 8.3 @@ -1,563 +0,0 @@ 8.4 -#!/bin/sh 8.5 -# 8.6 -# SliTaz Control Box is a tool to configure and manage a SliTaz system. 8.7 -# The script uses GTKdialog for the UI interface. Some shell functions 8.8 -# are called by argument. Individual window dialogs are put into 8.9 -# functions. 8.10 -# 8.11 -# (C) GNU gpl v3 - SliTaz GNU/Linux 2010. 8.12 -# Author: Christophe Lincoln <pankso@slitaz.org> 8.13 -# 8.14 -VERSION=1.1 8.15 - 8.16 -# Include gettext helper script. 8.17 -. /usr/bin/gettext.sh 8.18 - 8.19 -# Export package name for gettext. 8.20 -TEXTDOMAIN='tazctrlbox' 8.21 -export TEXTDOMAIN 8.22 - 8.23 -# Get init configuration. 8.24 -. /etc/rcS.conf 8.25 - 8.26 -# Tazctrlbox is only for root. 8.27 -if test $(id -u) != 0 ; then 8.28 - exec subox $0 8.29 - exit 0 8.30 -fi 8.31 - 8.32 -# By default autologin is not configured on an installed system. 8.33 -if ! grep -q 'auto_login' /etc/slim.conf; then 8.34 - echo '# Auto login default user' >> /etc/slim.conf 8.35 - echo 'auto_login no' >> /etc/slim.conf 8.36 -fi 8.37 - 8.38 -# Change Grub menu.lst timeout. 8.39 -sed_grub_timeout() 8.40 -{ 8.41 - CURRENT=`cat /boot/grub/menu.lst | grep ^timeout | cut -d " " -f2` 8.42 - sed -i s/"timeout $CURRENT"/"timeout $GRUB_TIMEOUT"/ /boot/grub/menu.lst 8.43 -} 8.44 - 8.45 -# Change Grub menu.lst timeout. 8.46 -sed_grub_color() 8.47 -{ 8.48 - CURRENT=`cat /boot/grub/menu.lst | grep ^color | cut -d " " -f2-3` 8.49 - sed -i s#"color $CURRENT"#"color $GRUB_COLOR"# /boot/grub/menu.lst 8.50 -} 8.51 - 8.52 -# Set check fs on boot. 8.53 -sed_check_fs() 8.54 -{ 8.55 - sed -i s#"CHECK_FS=\"$CHECK_FS\""#"CHECK_FS=\"$NEW_CHECK_FS\""# \ 8.56 - /etc/rcS.conf 8.57 -} 8.58 - 8.59 -# Set loaded modules on boot. 8.60 -sed_load_modules() 8.61 -{ 8.62 - sed -i s/"LOAD_MODULES=\"$LOAD_MODULES\""/"LOAD_MODULES=\"$NEW_MODULES\""/ \ 8.63 - /etc/rcS.conf 8.64 -} 8.65 - 8.66 -# Set daemons to run on boot. 8.67 -sed_run_daemons() 8.68 -{ 8.69 - sed -i s/"RUN_DAEMONS=\"$RUN_DAEMONS\""/"RUN_DAEMONS=\"$NEW_DAEMONS\""/ \ 8.70 - /etc/rcS.conf 8.71 -} 8.72 - 8.73 -# Get user list. 8.74 -get_users() 8.75 -{ 8.76 - for i in `cat /etc/passwd | cut -d ":" -f 1` 8.77 - do 8.78 - if [ -d /home/$i ]; then 8.79 - login=$i 8.80 - uid=`cat /etc/passwd | grep $i | cut -d ":" -f 3` 8.81 - gid=`cat /etc/passwd | grep $i | cut -d ":" -f 4` 8.82 - name=`cat /etc/passwd | grep $i | cut -d ":" -f 5 | sed s/,,,//` 8.83 - home=`cat /etc/passwd | grep $i | cut -d ":" -f 6` 8.84 - shell=`cat /etc/passwd | grep $i | cut -d ":" -f 7` 8.85 - echo "system-users | $login | $uid:$gid | $name | $home | $shell" 8.86 - fi 8.87 - done 8.88 -} 8.89 - 8.90 -# Remove a user or change passwd. 8.91 -manage_user() 8.92 -{ 8.93 - export MANAGE_DIALOG=" 8.94 -<window title=\"`gettext "Manage user: "`$USER\" icon-name=\"computer\"> 8.95 - <vbox> 8.96 - <vbox> 8.97 - <text wrap=\"false\" width-chars=\"34\"> 8.98 - <label>\" 8.99 -Login name: $USER 8.100 - \"</label> 8.101 - </text> 8.102 - </vbox> 8.103 - <hbox> 8.104 - <text wrap=\"false\"> 8.105 - <label>\"`gettext "New password:"`\"</label> 8.106 - </text> 8.107 - <entry invisible_char=\"*\" visibility=\"false\" max_length=\"8\"> 8.108 - <variable>PASSWD</variable> 8.109 - </entry> 8.110 - <button> 8.111 - <label>Change</label> 8.112 - <input file icon=\"forward\"></input> 8.113 - <action>echo \"$USER:$PASSWD\" | chpasswd</action> 8.114 - <action type=\"closewindow\">MANAGE_USER</action> 8.115 - </button> 8.116 - </hbox> 8.117 - <hbox> 8.118 - <button> 8.119 - <label>`gettext "Delete user"`</label> 8.120 - <input file icon=\"gtk-delete\"></input> 8.121 - <action>deluser $USER</action> 8.122 - <action type=\"closewindow\">MANAGE_USER</action> 8.123 - </button> 8.124 - <button cancel> 8.125 - <action type=\"closewindow\">MANAGE_USER</action> 8.126 - </button> 8.127 - </hbox> 8.128 - </vbox> 8.129 -</window> 8.130 -" 8.131 - gtkdialog --center --program=MANAGE_DIALOG >/dev/null 8.132 -} 8.133 - 8.134 -# Add a new user. 8.135 -add_user() 8.136 -{ 8.137 - export ADD_USER_DIALOG=' 8.138 -<window title="New user" icon-name="gtk-add"> 8.139 - <vbox> 8.140 - <vbox> 8.141 - <text wrap="false" width-chars="34"> 8.142 - <label>"'`gettext " 8.143 -New account information"`' 8.144 - "</label> 8.145 - </text> 8.146 - </vbox> 8.147 - <hbox> 8.148 - <text wrap="false"> 8.149 - <label>"'`gettext "Login:"`' "</label> 8.150 - </text> 8.151 - <entry> 8.152 - <variable>NEW_USER</variable> 8.153 - </entry> 8.154 - </hbox> 8.155 - <hbox> 8.156 - <text wrap="false"> 8.157 - <label>"'`gettext "Password:"`'"</label> 8.158 - </text> 8.159 - <entry invisible_char="*" visibility="false" max_length="8"> 8.160 - <variable>PASSWD</variable> 8.161 - </entry> 8.162 - </hbox> 8.163 - <hbox> 8.164 - <button ok> 8.165 - <action>adduser -D $NEW_USER</action> 8.166 - <action>echo "$NEW_USER:$PASSWD" | chpasswd</action> 8.167 - <action>addgroup $NEW_USER audio</action> 8.168 - <action>addgroup $NEW_USER cdrom</action> 8.169 - <action>addgroup $NEW_USER floppy</action> 8.170 - <action>addgroup $NEW_USER video</action> 8.171 - <action>rmdir /home/$NEW_USER</action> 8.172 - <action>cp -a /etc/skel /home/$NEW_USER</action> 8.173 - <action>cp /root/.xinitrc /home/$NEW_USER</action> 8.174 - <action>mkdir -p /home/$NEW_USER/.config/slitaz</action> 8.175 - <action>cp -a /etc/slitaz/applications.conf /home/$NEW_USER/.config/slitaz</action> 8.176 - <action>chown -R $NEW_USER:$NEW_USER /home/$NEW_USER</action> 8.177 - <action type="closewindow">MANAGE_USER</action> 8.178 - </button> 8.179 - <button cancel> 8.180 - <action type="closewindow">MANAGE_USER</action> 8.181 - </button> 8.182 - </hbox> 8.183 - </vbox> 8.184 -</window> 8.185 -' 8.186 - gtkdialog --center --program=ADD_USER_DIALOG >/dev/null 8.187 -} 8.188 - 8.189 -# i18n functions. 8.190 -list_locales() 8.191 -{ 8.192 - cd /usr/share/i18n/locales 8.193 - for locale in `ls -1 [a-z][a-z]_[A-Z][A-Z]` 8.194 - do 8.195 - echo "preferences-desktop-locale | $locale | UTF-8" 8.196 - done 8.197 -} 8.198 -gen_utf8_locale() 8.199 -{ 8.200 - rm -rf /usr/lib/locale/$LANGUAGE 8.201 - localedef -i $LANGUAGE -c -f UTF-8 /usr/lib/locale/$LANGUAGE 8.202 - # System configuration 8.203 - echo "LANG=$LANGUAGE" > /etc/locale.conf 8.204 - echo "LC_ALL=$LANGUAGE" >> /etc/locale.conf 8.205 -} 8.206 - 8.207 -# Main dialog with notebook. 8.208 -# 8.209 -export MAIN_DIALOG=' 8.210 -<window title="'`gettext "SliTaz Control Box"`'" icon-name="computer"> 8.211 -<vbox> 8.212 - 8.213 - <hbox> 8.214 - <text use-markup="true"> 8.215 - <label>"'`gettext "<b>SliTaz Control Box</b>"`'"</label> 8.216 - </text> 8.217 - <pixmap> 8.218 - <input file>/usr/share/pixmaps/tazctrlbox.png</input> 8.219 - </pixmap> 8.220 - </hbox> 8.221 - 8.222 - <notebook labels="'`gettext "Boot loader|Initialization|Login manager|Time|Language|Users"`'">' 8.223 - 8.224 -# GRUB. 8.225 -MAIN_DIALOG=${MAIN_DIALOG}" 8.226 - <vbox> 8.227 - <frame `gettext "Grub boot loader"`> 8.228 - <hbox> 8.229 - <text wrap=\"false\"> 8.230 - <label>\"`gettext "Timeout:"`\"</label> 8.231 - </text> 8.232 - <entry> 8.233 - <input>cat /boot/grub/menu.lst | grep ^timeout | cut -d \" \" -f2</input> 8.234 - <variable>GRUB_TIMEOUT</variable> 8.235 - </entry> 8.236 - <button> 8.237 - <label>`gettext "Change"`</label> 8.238 - <input file icon=\"forward\"></input> 8.239 - <action>$0 sed_grub_timeout</action> 8.240 - </button> 8.241 - </hbox> 8.242 - <hbox> 8.243 - <text wrap=\"false\"> 8.244 - <label>\"`gettext "Color:"` \"</label> 8.245 - </text> 8.246 - <entry> 8.247 - <input>cat /boot/grub/menu.lst | grep ^color | cut -d \" \" -f2-3</input> 8.248 - <variable>GRUB_COLOR</variable> 8.249 - </entry> 8.250 - <button> 8.251 - <label>`gettext "Change"`</label> 8.252 - <input file icon=\"forward\"></input> 8.253 - <action>$0 sed_grub_color</action> 8.254 - </button> 8.255 - </hbox> 8.256 - <hbox> 8.257 - <text wrap=\"false\"> 8.258 - <label>\"`gettext "Configuration file:"`\"</label> 8.259 - </text> 8.260 - <button> 8.261 - <label>/boot/grub/menu.lst</label> 8.262 - <input file icon=\"accessories-text-editor\"></input> 8.263 - <action>leafpad /boot/grub/menu.lst</action> 8.264 - <action>refresh:GRUB_COLOR</action> 8.265 - <action>refresh:GRUB_TIMEOUT</action> 8.266 - </button> 8.267 - </hbox> 8.268 - </frame> 8.269 - </vbox>" 8.270 -# Init script. 8.271 -MAIN_DIALOG=${MAIN_DIALOG}" 8.272 - <vbox> 8.273 - <frame `gettext "rcS init scripts"`> 8.274 - <hbox> 8.275 - <text wrap=\"false\"> 8.276 - <label>\"`gettext "Check filesystems:"`\"</label> 8.277 - </text> 8.278 - <entry> 8.279 - <input>echo $CHECK_FS</input> 8.280 - <variable>NEW_CHECK_FS</variable> 8.281 - </entry> 8.282 - <button> 8.283 - <label>Change</label> 8.284 - <input file icon=\"forward\"></input> 8.285 - <action>$0 sed_check_fs</action> 8.286 - </button> 8.287 - </hbox> 8.288 - <hbox> 8.289 - <text wrap=\"false\"> 8.290 - <label>\"`gettext "Load modules:"` \"</label> 8.291 - </text> 8.292 - <entry> 8.293 - <input>echo $LOAD_MODULES</input> 8.294 - <variable>NEW_MODULES</variable> 8.295 - </entry> 8.296 - <button> 8.297 - <label>`gettext "Change"`</label> 8.298 - <input file icon=\"forward\"></input> 8.299 - <action>$0 sed_load_modules</action> 8.300 - </button> 8.301 - </hbox> 8.302 - <hbox> 8.303 - <text wrap=\"false\"> 8.304 - <label>\"`gettext "Run daemons:"` \"</label> 8.305 - </text> 8.306 - <entry> 8.307 - <input>echo $RUN_DAEMONS</input> 8.308 - <variable>NEW_DAEMONS</variable> 8.309 - </entry> 8.310 - <button> 8.311 - <label>`gettext "Change"`</label> 8.312 - <input file icon=\"forward\"></input> 8.313 - <action>$0 sed_run_daemons</action> 8.314 - </button> 8.315 - </hbox> 8.316 - <hbox> 8.317 - <text wrap=\"false\"> 8.318 - <label>\"`gettext "Add local commands:"`\"</label> 8.319 - </text> 8.320 - <button> 8.321 - <label>/etc/init.d/local.sh</label> 8.322 - <input file icon=\"accessories-text-editor\"></input> 8.323 - <action>leafpad /etc/init.d/local.sh</action> 8.324 - </button> 8.325 - </hbox> 8.326 - </frame> 8.327 - </vbox>" 8.328 -# Slim login. 8.329 -MAIN_DIALOG=${MAIN_DIALOG}' 8.330 - <vbox> 8.331 - <frame '`gettext "Slim settings"`'> 8.332 - <hbox> 8.333 - <text wrap="false"> 8.334 - <label>"'`gettext "Sessions:"`' "</label> 8.335 - </text> 8.336 - <entry> 8.337 - <input>cat /etc/slim.conf | grep ^session | sed s/"sessions. *"//</input> 8.338 - <variable>SLIM_SESSIONS</variable> 8.339 - </entry> 8.340 - <button> 8.341 - <label>'`gettext "Change"`'</label> 8.342 - <input file icon="forward"></input> 8.343 - <action>sed -i "s/^sessions.*/sessions $SLIM_SESSIONS/" /etc/slim.conf</action> 8.344 - </button> 8.345 - </hbox> 8.346 - <hbox> 8.347 - <text wrap="false"> 8.348 - <label>"'`gettext "Default user:"`' "</label> 8.349 - </text> 8.350 - <entry> 8.351 - <input>cat /etc/slim.conf | grep ^default_user | sed s/"default_user. *"//</input> 8.352 - <variable>SLIM_DEF_USER</variable> 8.353 - </entry> 8.354 - <button> 8.355 - <label>'`gettext "Change"`'</label> 8.356 - <input file icon="forward"></input> 8.357 - <action>sed -i "s/^default_user.*/default_user $SLIM_DEF_USER/" /etc/slim.conf</action> 8.358 - </button> 8.359 - </hbox> 8.360 - <hbox> 8.361 - <text wrap="false"> 8.362 - <label>"'`gettext "Auto login (yes|no):"`' "</label> 8.363 - </text> 8.364 - <entry max_length="3"> 8.365 - <input>cat /etc/slim.conf | grep ^auto_login | sed s/"auto_login. *"//</input> 8.366 - <variable>SLIM_AUTO_LOGIN</variable> 8.367 - </entry> 8.368 - <button> 8.369 - <label>'`gettext "Change"`'</label> 8.370 - <input file icon="forward"></input> 8.371 - <action>sed -i "s/^auto_login.*/auto_login $SLIM_AUTO_LOGIN/" /etc/slim.conf</action> 8.372 - </button> 8.373 - </hbox> 8.374 - <hbox> 8.375 - <text wrap="false"> 8.376 - <label>"'`gettext "Theme:"`'"</label> 8.377 - </text> 8.378 - <combobox> 8.379 - <variable>NEW_SLIM_THEME</variable>' 8.380 -# List all installed Slim themes. 8.381 -for dir in $(ls /usr/share/slim/themes) 8.382 -do 8.383 - THEME_ITEMS="<item>$dir</item>" 8.384 - MAIN_DIALOG=${MAIN_DIALOG}${THEME_ITEMS} 8.385 -done 8.386 -MAIN_DIALOG=${MAIN_DIALOG}' 8.387 - </combobox> 8.388 - <button> 8.389 - <label>'`gettext "Preview"`'</label> 8.390 - <input file icon="video-display"></input> 8.391 - <action>slim -p /usr/share/slim/themes/$NEW_SLIM_THEME &</action> 8.392 - </button> 8.393 - <button> 8.394 - <label>'`gettext "Change"`'</label> 8.395 - <input file icon="forward"></input> 8.396 - <action>sed -i "s/^current_theme.*/current_theme $NEW_SLIM_THEME/" /etc/slim.conf</action> 8.397 - <action>refresh:SLIM_THEME</action> 8.398 - </button> 8.399 - </hbox> 8.400 - <hbox> 8.401 - <text wrap="false"> 8.402 - <label>"'`gettext "Configuration file:"`'"</label> 8.403 - </text> 8.404 - <button> 8.405 - <label>/etc/slim.conf</label> 8.406 - <input file icon="accessories-text-editor"></input> 8.407 - <action>leafpad /etc/slim.conf</action> 8.408 - <action>refresh:SLIM_SESSIONS</action> 8.409 - <action>refresh:SLIM_DEF_USER</action> 8.410 - </button> 8.411 - </hbox> 8.412 - </frame> 8.413 - </vbox>' 8.414 -# Time settings. 8.415 -MAIN_DIALOG=${MAIN_DIALOG}' 8.416 - <vbox> 8.417 - <frame '`gettext "Date and time"`'> 8.418 - <hbox> 8.419 - <text wrap="false"> 8.420 - <label>"'`gettext "System time:"`' "</label> 8.421 - </text> 8.422 - <entry editable="false"> 8.423 - <input>LC_ALL=C date</input> 8.424 - <variable>DATE</variable> 8.425 - </entry> 8.426 - <button> 8.427 - <label>'`gettext "Sync online"`'</label> 8.428 - <input file icon="reload"></input> 8.429 - <action>rdate -s tick.greyware.com</action> 8.430 - <action>refresh:DATE</action> 8.431 - <action>refresh:HWTIME</action> 8.432 - </button> 8.433 - </hbox> 8.434 - <hbox> 8.435 - <text wrap="false"> 8.436 - <label>"'`gettext "Hardware time:"`'"</label> 8.437 - </text> 8.438 - <entry editable="false"> 8.439 - <input>LC_ALL=C hwclock</input> 8.440 - <variable>HWTIME</variable> 8.441 - </entry> 8.442 - <button> 8.443 - <label>'`gettext "Set from system"`'</label> 8.444 - <input file icon="reload"></input> 8.445 - <action>hwclock -w -u</action> 8.446 - <action>refresh:HWTIME</action> 8.447 - <action>refresh:DATE</action> 8.448 - </button> 8.449 - </hbox> 8.450 - <hbox> 8.451 - <text wrap="true"> 8.452 - <label>"'`gettext "Timezone:"`' "</label> 8.453 - </text> 8.454 - <entry> 8.455 - <input>cat /etc/TZ</input> 8.456 - <variable>NEW_TZ</variable> 8.457 - </entry> 8.458 - <button> 8.459 - <label>'`gettext "Change"`'</label> 8.460 - <input file icon="forward"></input> 8.461 - <action>echo "$NEW_TZ" > /etc/TZ</action> 8.462 - </button> 8.463 - </hbox> 8.464 - </frame> 8.465 - </vbox>' 8.466 -# Language settings. 8.467 -MAIN_DIALOG=${MAIN_DIALOG}" 8.468 - <vbox> 8.469 - <tree> 8.470 - <width>600</width><height>210</height> 8.471 - <variable>LANGUAGE</variable> 8.472 - <label>`gettext "Language|Charmap"`</label> 8.473 - <input icon_column=\"0\">$0 list_locales</input> 8.474 - <action>$0 gen_utf8_locale</action> 8.475 - </tree> 8.476 - <hbox> 8.477 - <text width-chars=\"60\"> 8.478 - <label> 8.479 -\"`gettext "To change the system language you can double-click on the locale name."`\" 8.480 - </label> 8.481 - </text> 8.482 - <button> 8.483 - <label>`gettext "Keymap"`</label> 8.484 - <input file icon=\"input-keyboard\"></input> 8.485 - <action>tazkeymap &</action> 8.486 - </button> 8.487 - </hbox> 8.488 - </vbox>" 8.489 -# Display users list through get_users. 8.490 -MAIN_DIALOG=${MAIN_DIALOG}" 8.491 - <vbox> 8.492 - <tree> 8.493 - <width>600</width><height>210</height> 8.494 - <variable>USER</variable> 8.495 - <label>`gettext "Login|uid:gid|Name|Home|SHell"`</label> 8.496 - <input icon_column=\"0\">$0 get_users</input> 8.497 - <action>$0 manage_user</action> 8.498 - <action>refresh:USER</action> 8.499 - </tree> 8.500 - <hbox> 8.501 - <text width-chars=\"60\"> 8.502 - <label> 8.503 -\"`gettext "To change passwords or delete users you can double-click on the user name."`\" 8.504 - </label> 8.505 - </text> 8.506 - <button> 8.507 - <label>`gettext "Add newuser"`</label> 8.508 - <input file icon=\"gtk-add\"></input> 8.509 - <action>$0 add_user</action> 8.510 - <action>refresh:USER</action> 8.511 - </button> 8.512 - </hbox> 8.513 - </vbox>" 8.514 -export MAIN_DIALOG=${MAIN_DIALOG}' 8.515 - </notebook> 8.516 - 8.517 - <hbox> 8.518 - <button> 8.519 - <label>'`gettext "Network"`'</label> 8.520 - <input file icon="netbox"></input> 8.521 - <action>netbox &</action> 8.522 - </button> 8.523 - <button> 8.524 - <label>'`gettext "Wireless"`'</label> 8.525 - <input file icon="network-wireless"></input> 8.526 - <action>wifibox &</action> 8.527 - </button> 8.528 - <button> 8.529 - <label>'`gettext "Packages"`'</label> 8.530 - <input file icon="tazpkg"></input> 8.531 - <action>tazpkgbox &</action> 8.532 - </button> 8.533 - <button> 8.534 - <label>'`gettext "Hardware"`'</label> 8.535 - <input file icon="computer"></input> 8.536 - <action>tazhw box &</action> 8.537 - </button> 8.538 - <button> 8.539 - <label>'`gettext "Server"`'</label> 8.540 - <input file icon="utilities-system-monitor"></input> 8.541 - <action>serverbox &</action> 8.542 - </button> 8.543 - <button> 8.544 - <label>'`gettext "Storage"`'</label> 8.545 - <input file icon="media-flash"></input> 8.546 - <action>mountbox &</action> 8.547 - </button> 8.548 - <button> 8.549 - <label>'`gettext "Exit"`'</label> 8.550 - <input file icon="exit"></input> 8.551 - <action type="exit">Exit</action> 8.552 - </button> 8.553 - </hbox> 8.554 - 8.555 -</vbox> 8.556 - 8.557 -</window>' 8.558 - 8.559 -# Script can be called with an arg to exec a function. 8.560 -if [ -n "$1" ]; then 8.561 - $1 8.562 -else 8.563 - gtkdialog --center --program=MAIN_DIALOG >/dev/null 8.564 -fi 8.565 - 8.566 -exit 0