slitaz-tools rev 611
tazbox: turn some constants into global
author | Claudinei Pereira <claudinei@slitaz.org> |
---|---|
date | Thu Jun 02 09:28:12 2011 -0300 (2011-06-02) |
parents | 4365931d7dd2 |
children | 16060fc78580 |
files | tazbox/tazbox |
line diff
1.1 --- a/tazbox/tazbox Thu Jun 02 18:14:26 2011 +0200 1.2 +++ b/tazbox/tazbox Thu Jun 02 09:28:12 2011 -0300 1.3 @@ -20,6 +20,11 @@ 1.4 # Icons for most windows 1.5 icon=/usr/share/pixmaps/slitaz-menu.png 1.6 1.7 +# some constants to be used inside functions 1.8 +tmp="/tmp/keymap.list" 1.9 +db="/usr/share/i18n/locales" 1.10 +zi="/usr/share/zoneinfo/" 1.11 + 1.12 # 1.13 # Functions 1.14 # 1.15 @@ -91,7 +96,6 @@ 1.16 1.17 # Generate keymap list 1.18 gen_kmap_list() { 1.19 - tmp=/tmp/keymap.list 1.20 echo > $tmp 1.21 cd /usr/share/kbd/keymaps/i386 1.22 # We first need a list to sort and then use \n for Yad list. 1.23 @@ -106,9 +110,6 @@ 1.24 # Initial Config functions 1.25 setup_main() { 1.26 gen_kmap_list 1.27 - db="/usr/share/i18n/locales" 1.28 - tmp="/tmp/keymap.list" 1.29 - zi="/usr/share/zoneinfo/" 1.30 title=$(gettext "SliTaz Initial Setup") 1.31 message=$(gettext "\n<big>Here you can set your preferences\nfor <b>locale, keymap and timezone</b></big>\n\n") 1.32 locale=$(ls -1 $db | grep ^[a-z][a-z]_[A-Z][A-Z] | tr "\n" "!") 1.33 @@ -135,7 +136,6 @@ 1.34 # Locale functions 1.35 locale_main() { 1.36 text=$(gettext "Language configuration") 1.37 - db=/usr/share/i18n/locales 1.38 for locale in $(ls -1 $db | grep ^[a-z][a-z]_[A-Z][A-Z]) 1.39 do 1.40 desc=$(grep ^title $db/$locale | cut -d '"' -f 2) 1.41 @@ -164,7 +164,6 @@ 1.42 keymap_main() { 1.43 gen_kmap_list 1.44 text=$(gettext "Keyboard configuration") 1.45 - tmp=/tmp/keymap.list 1.46 for i in $(sort $tmp) 1.47 do 1.48 keymap=$(echo $i | cut -d "|" -f 1) 1.49 @@ -194,7 +193,6 @@ 1.50 # TZ functions 1.51 tz_main() { 1.52 text=$(gettext "TimeZone Configuration") 1.53 - zi="/usr/share/zoneinfo/" 1.54 for t in $(find $zi -type f | sed s,$zi,,g) 1.55 do 1.56 echo -e "$t"