slitaz-tools rev 604
tazbox: Add TZ configuration box (Good job Claudinei!)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Wed Jun 01 19:29:46 2011 +0200 (2011-06-01) |
parents | 1c5312d54ce0 |
children | a8769e3a5554 |
files | tazbox/tazbox |
line diff
1.1 --- a/tazbox/tazbox Wed Jun 01 19:29:02 2011 +0200 1.2 +++ b/tazbox/tazbox Wed Jun 01 19:29:46 2011 +0200 1.3 @@ -37,6 +37,7 @@ 1.4 out-dl $(gettext "Pipe Wget output into a GTK window") 1.5 locale $(gettext "Configure system language (root)") 1.6 keymap $(gettext "Configure system keymap (root)") 1.7 + tz $(gettext "Configure system timezone (root)") 1.8 1.9 EOT 1.10 } 1.11 @@ -154,6 +155,31 @@ 1.12 [ "$keymap" ] && tazkeymap init $keymap 1.13 } 1.14 1.15 +# TZ functions 1.16 +tz_main() { 1.17 + text=$(gettext "TimeZone Configuration") 1.18 + zi="/usr/share/zoneinfo/" 1.19 + for t in $(find $zi -type f | sed s,$zi,,g) 1.20 + do 1.21 + echo -e "$t" 1.22 + done | \ 1.23 + yad --list --title="SliTaz TZ" --window-icon=$icon \ 1.24 + --width=500 --height=380 --separator="" \ 1.25 + --center --sticky --on-top \ 1.26 + --image=preferences-desktop-locale --image-on-top \ 1.27 + --text="<b>$text</b>" --print-column=1 \ 1.28 + --column $(gettext "Name") 1.29 +} 1.30 + 1.31 +tz() { 1.32 + timezone=$(tz_main) 1.33 + case $? in 1.34 + 1) exit 0 ;; 1.35 + *) continue ;; 1.36 + esac 1.37 + [ "$timezone" ] && echo $timezone > /etc/TZ 1.38 +} 1.39 + 1.40 # 1.41 # Commands 1.42 # 1.43 @@ -213,6 +239,8 @@ 1.44 locale ;; 1.45 keymap) 1.46 keymap ;; 1.47 + tz) 1.48 + tz ;; 1.49 boot) 1.50 # This command is used at first boot to configure system. 1.51 Xorg -br -quiet -nolisten tcp :1 &