quicksetup 95 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840
  1. #!/bin/sh
  2. #(c) Copyright Barry Kauler Oct. 2011, http://bkhome.org
  3. #License: Oct. 2011, GPL3 (refer /usr/share/doc/legal)
  4. #A GUI when start desktop first time, to replace the text-mode dialogs (locale, keyboard-layout, timezone)
  5. #inspired by shinobar's countrywizard.qs (firstrun), but a complete rewrite.
  6. #replaces the old single-purpose scripts: chooselocale timezone-set (now symlinks)
  7. #propose first startup, run 'quickcountry, which is symlink.
  8. #111019 first version.
  9. #1110120 call shinobar's 'keymap-set' script. FLAG_CHANGED improved.
  10. #111020 'countrywizard', 'xrandrshell' now symlinks to 'quicksetup'.
  11. #111022 even though LANG=en_US.UTF-8, localedef still creates /usr/lib/locale/en_US.utf8. use UTF8=.utf8
  12. #111025 thanks to thunor, fix for window dimensions.
  13. #111026 added button for dead mouse.
  14. #111027 fix Xorg.0.log records 'intel' driver loading twice.
  15. #111027 tweaked text messages very slightly.
  16. #111027 first boot, /etc/localtime does not exist, so must set timezone.
  17. #111103 other entries in Etc dir.
  18. #111107 changed 'comboboxtext' to 'combobox' tag, but does not support 'default' tag.
  19. #111111 revert to 'comboboxtext' due to heavy cpu usage, but not 'default' -- do not get the double-popup problem.
  20. #111113 upgraded gtk to 2.24.8, fixed slowness. go back to 'combobox'.
  21. #111113 fix timezone-set cli app.
  22. #120209 scripts fixdesk and fixmenus translate files to new language (as specified in /usr/share/sss/menu_strings and desk_strings).
  23. #120209 added call to fixscripts, to translate language in scripts (as specified in /usr/share/sss/script_strings).
  24. #120213 when locale change, inform if langpack PET needed.
  25. #120215 offer to translate initrd.
  26. #120215 rc.country calls 'chooselocale cli quiet', to run localedef without asking any questions or popups.
  27. #120216 insert /PUPPYKEYMAP into initrd. moved SET_KEYBOARD before SET_LOCALE processing.
  28. #120216 call 'lang2initrd'
  29. #120224 load console font. (code based on that in 'init')
  30. #120226 redraw desktop drive icons when resolution changes (or may change, in the case of running xorgwizard).
  31. #120227 set hostname, but only if ethernet auto-connected at 1st boot.
  32. #120228 L18L: enabling adding locale without utf8 using regexp.
  33. #120301 no, don't load console font here. seems to get dropped on exit from X. (instead, do it in xwin. now have /sbin/load_consolefont)
  34. #120305 check if langpack available in noarch repo.
  35. #120311 change persistence logic for 120227.
  36. #120313 hardcode translations for popup if user changes locale.
  37. #120313 restrict network frame to only be in main quicksetup window.
  38. #120315 dutch (nl) hardcode translation for locale-change popup. added pt, es, it.
  39. #120328 have rewritten rc.country, try to make chooselocale compatible. 120330 bugfix.
  40. #120331 added Polish (pl) hardcoded translation.
  41. #120401 change logic to call lang2initrd.
  42. #120402 expand locale help window.
  43. #120524 Please wait... msg after click ok button.
  44. #120625 always display network frame, remove set-hostname button, added firewall and ntp checkboxes.
  45. #120627 support kbd pkg.
  46. #120708 'quickarm' symlink to 'quicksetup', for booting on arm boards. see also /etc/rc.d/BOOTCONSTRAINED and /usr/sbin/delayedrun.
  47. #120714 revert 120708. instead, read BOOT_BOARD to determine type of board booting off. support raspberry pi audio settings.
  48. #120717 remove XPID=""
  49. #120901 /usr/share/zoneinfo layout has changed (ubuntu precise).
  50. #130131 xrandr may have more than one frequency on a line, ex: 1360x768 59.8 60.0
  51. #130202 130131 not enough. xrandr was not setting chosen vertical frequency.
  52. #130203 fix insertion of fontsize in xml.
  53. #130501 pupdesk.flg is created in rc.sysinit, for PUPMODE=5. further fixup.
  54. #130506 detect current xorg driver broken, use same code as in /usr/sbin/report-video.
  55. #130509 need to creat pupdesk.flg before bring up gui window, with $XDRIVERSUCCESS stored in it, for xorgwizard-cli.
  56. #130509 also save $XDRIVERSUCCESS in /var/local/quicksetup-pupmode5-autodriver, also for xorgwizard-cli.
  57. #130511 hostname-set now may return value 2.
  58. #130513 pupdesk.flg code in rc.sysinit moved to init script in initrd, so different handling here.
  59. #130701 network frame now always displayed. added checkbox for run apps as spot.
  60. #131121 fix the xrandr resolution and refresh rates, displays all now, 01micko.
  61. #131121 fix numerous calls to sed and replace many cut calls with bash, KRG
  62. #131230 zigbert: gui (gtkdialog) improvements.
  63. [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@}
  64. export TEXTDOMAIN=quicksetup
  65. export OUTPUT_CHARSET=UTF-8
  66. . gettext.sh
  67. . /etc/DISTRO_SPECS
  68. . /etc/rc.d/PUPSTATE
  69. . /etc/rc.d/BOOTCONFIG
  70. . /etc/clock
  71. . /etc/rc.d/BOOTCONSTRAINED #120714
  72. PARAM1=""
  73. [ $1 ] && PARAM1="$1"
  74. PARAM2=""
  75. [ $2 ] && PARAM2="$2"
  76. TABCHAR="`echo -n -e '\t'`"
  77. [ "$PARAM1" = "composeonly" ] && unset DISPLAY
  78. [ "$PARAM1" = "cli" ] && unset DISPLAY
  79. MYBASE=$(basename $0)
  80. WINICON="gtk-preferences"; HELPICON="gtk-index" #gtk-info
  81. SET_LOCALE=""; SET_TIMEZONE=""; SET_KEYBOARD=""; SET_X=""; SET_COUNTRY=""; SET_XRES=""; SET_XWIZARD=""; SET_NETWORK=""
  82. WINTITLE=$(gettext "Quick Setup")
  83. COUNTRYFRAMETITLE=$(gettext 'Country')
  84. XFRAMETITLE=$(gettext 'Graphics')
  85. BACKTITLE=$(gettext '<b>Quick setup</b>. All these settings (and many more) are available from the Setup and Desktop menu. Please set these to suit yourself, then click <b>Ok</b>')
  86. ICON="puppy_config"
  87. #specific-purpose utilities...
  88. case $MYBASE in
  89. chooselocale)
  90. WINTITLE=$(gettext "Choose Locale")
  91. BACKTITLE=$(gettext 'Set font, money and language for your location')
  92. ICON="country"
  93. COUNTRYFRAMETITLE=$(gettext 'Language and Country')
  94. SET_LOCALE="yes"
  95. ;;
  96. timezone-set)
  97. WINTITLE=$(gettext "Choose Timezone")
  98. BACKTITLE=$(gettext 'Set time and date for your location')
  99. ICON="country"
  100. COUNTRYFRAMETITLE=$(gettext 'Timezone')
  101. SET_TIMEZONE="yes"
  102. ;;
  103. chooselayout)
  104. WINTITLE=$(gettext "Choose keyboard layout")
  105. BACKTITLE=$(gettext 'Choose keyboard layout for your country, or whatever keyboard you are using')
  106. ICON="country"
  107. COUNTRYFRAMETITLE=$(gettext 'Keyboard Layout')
  108. SET_KEYBOARD="yes"
  109. ;;
  110. countrywizard|quickcountry)
  111. WINTITLE=$(gettext "Country Setup")
  112. BACKTITLE=$(gettext 'Country settings is required for correct keyboard layout, time zone, language, currency, decimal separator, calendar... Please set these to suit your country and language')
  113. ICON="country"
  114. COUNTRYFRAMETITLE=$(gettext 'Country Settings')
  115. SET_LOCALE="yes"
  116. SET_TIMEZONE="yes"
  117. SET_KEYBOARD="yes"
  118. ;;
  119. xrandrshell)
  120. WINTITLE=$(gettext "Change Resolution")
  121. BACKTITLE=$(gettext 'These are available resolutions that the <b>xrandr</b> utility can change the screen to. Please choose the one that you would like to test.')
  122. ICON="graphics"
  123. SET_XRES="yes"
  124. XFRAMETITLE=$(gettext 'Screen Resolution')
  125. ;;
  126. *) #quicksetup
  127. case $BOOT_BOARD in
  128. raspi) SET_LOCALE="yes"; SET_TIMEZONE="yes"; SET_KEYBOARD="yes"; SET_NETWORK="yes"; SET_RP_AUDIO="yes"; SET_RP_VIDEO="yes" ;; #120714 Raspberry Pi
  129. *) SET_LOCALE="yes"; SET_TIMEZONE="yes"; SET_KEYBOARD="yes"; SET_XRES="yes"; SET_XWIZARD="yes"; SET_NETWORK="yes" ;; #normal quicksetup.
  130. esac
  131. ;;
  132. esac
  133. [ "$SET_LOCALE" -o "$SET_TIMEZONE" -o "$SET_KEYBOARD" ] && SET_COUNTRY="yes"
  134. [ "$SET_XRES" -o "$SET_XWIZARD" ] && SET_X="yes"
  135. XPID=0
  136. if [ $DISPLAY ];then
  137. if [ "$PARAM1" != "nosplash" ];then
  138. WELCOMEMSG=$(printf "$(gettext 'Welcome to %s!')" "$DISTRO_NAME $DISTRO_VERSION")
  139. /usr/lib/gtkdialog/box_splash -placement center -close never -fontsize large -icon_width 60 -icon /usr/share/pixmaps/puppy/puppy.svg -text "$WELCOMEMSG" &
  140. XPID=$!
  141. fi
  142. fi
  143. M_close="`gettext 'Close'`"
  144. #help dialogs
  145. help (){
  146. case "$1" in
  147. keyboard)
  148. HEADING="`gettext 'Keyboard Layout'`"
  149. echo "$(gettext 'Computer keyboards have different layouts, depending on the country and language.
  150. <b>Note:</b> After making a choice here, clicking the <b>OK</b> button will update the layout in X (graphical desktop) but not the console (when X not running) -- that requires a reboot.
  151. <b>Technical</b>
  152. The choice made here is saved in /etc/keymap. The value specifies a console layout, from the directory /lib/keymaps. When X starts, the startup script /usr/bin/xwin translates that to the equivalent for X, from directory /etc/X11/xkb/symbols -- note, if no match is found, X falls back to using <b>us</b> layout -- please report if that happens to you.')" > /tmp/box_help
  153. ;;
  154. numlock)
  155. HEADING="`gettext 'Keyboard Numlock'`"
  156. echo "$(gettext 'Most keyboards have a group of keys on the right side of the keyboard that are labeled <b>0</b> to <b>9</b>. These are intended for when heavy entry of numbers is required. They are dual-purpose, that is can also serve as arrow-keys, Home, End, PgUp, PgDn -- and the latter is usually the default. That is, numlock defaults to off.
  157. If the checkbox is ticked, numlock will be on when X starts.
  158. <b>Technical</b>
  159. The file /root/Startup/numlockx specifies whether numlock is on or off. if the file attribute is executable, then it will execute when X starts. The file contains either <b>numlockx on</b> or <b>numlockx off</b>, and may be edited directly if desired.')" > /tmp/box_help
  160. ;;
  161. timezone)
  162. HEADING="`gettext 'Time Zone'`"
  163. echo "`gettext 'This needs to be set to ensure that Puppy knows the correct time and date.
  164. If you cannot find an entry for your location, choose one of the <b>GMT</b> entries. Finding the correct entry is best, as it automatically applies DST (Daylight Saving Time), whereas the GMT entries are fixed offsets from the GMT (UTC) reference.
  165. <b>Technical</b>
  166. After making a choice, /etc/localtime will point to the appropriate timezone file in /usr/share/zoneinfo.'`" > /tmp/box_help
  167. ;;
  168. utc)
  169. HEADING="`gettext 'UTC'`"
  170. echo "`gettext 'All computers have a hardware clock that runs continuously from a battery, even when the computer is turned off. This clock can be set either to the local time or to UTC.
  171. <b>UTC/GMT</b>
  172. UTC is Coordinated Universal Time, which is basically the same as GMT, Greenwich Mean Time. The latter is the time at the Royal Observatory in Greenwich, London -- this is a time that does not have daylight saving or summer time as does the rest of the UK. It is said to simplify things if the computer hardware clock is set to UTC.
  173. <b>Local time</b>
  174. By default, Puppy Linux assumes that the hardware clock is set to local time, as this is what MS DOS and Windows systems normally use. If you were to change the hardware clock to UTC, you would also have to ensure that all operating systems recognise that, else they will show the wrong time/date.'`" > /tmp/box_help
  175. ;;
  176. locale)
  177. HEADING="`gettext 'Locale'`"
  178. echo "$(gettext "The locale setting provides money, date and font localization for your country.
  179. The format is, for example, <b>en_US</b> where <b>en</b> designates the language and <b>US</b> designates the country in which it is spoken and written.
  180. When you choose a non-English locale, you will also need a langpack PET package to provide full translation for applications in Puppy. You will receive more information about this after choosing the locale. Currently, we have these langpacks, with the (Forum) names of the maintainers shown:
  181. <i>Danish (da): maans
  182. Dutch (nl): Bert
  183. French (fr): esmourguit
  184. German (de): L18L
  185. Greek (el): kounelii
  186. Italian (it): vicmz (temporary)
  187. Polish (pl): robwoj44
  188. Portuguese (pt): vicmz
  189. Russian (ru): rodin.s
  190. Spanish (es): vicmz</i>")
  191. $(gettext 'Currently installed langpack:') <b>${INSTLANGPACK}</b>
  192. $(gettext "Note: Even if no langpack is available for your language and country, choosing the correct locale does provide some useful localization. However, all the applications, menus and documentation will be in English.")
  193. $(gettext "<b>Technical</b>
  194. The chosen locale file is generated in /usr/lib/locale (if not already) and LANG variable set in /etc/profile.")" > /tmp/box_help
  195. ;;
  196. utf8)
  197. HEADING="`gettext 'UTF-8'`"
  198. echo "`gettext 'UTF-8 is a Unicode standard in which international characters are represented in 8, 16 or more bits, and plain ASCII (8th bit = 0) text files are valid UTF-8 encoding. UTF-8 has become the defacto standard in Linux. The reason is, basically, that UTF-8 encoded files can be used anywhere in the world and do not need a particular <b>character set</b> translation.
  199. <b>Note 1:</b> Many Puppy Linux users do not use UTF-8 as there is a slight speed penalty running applications -- all English users are ok running without UTF-8.
  200. <b>Note 2:</b> Non-unicode rendering is achieved by 8-bit character sets, such as ISO-8859-1 for normal Latin1 English, or ISO-8859-2 for Eastern European Latin2 languages.
  201. Basically, if your language is not a <b>Latin</b> derivative, such as all Asian languages, then you will need UTF-8. Most non-English Linux users enable UTF-8, even for Latin-derivative languages, <b>so recommend tick the box</b>!'`" > /tmp/box_help
  202. ;;
  203. ntp)
  204. HEADING="`gettext 'NTP'`"
  205. echo "$(gettext "This will synchronise the local time and date to an NTP server on the Internet. You do not need to do this, as computers normally have their date and time set by a battery-backed hardware clock. However, some tiny computers, such as some ARM boards (for example the Raspberry Pi) do not have a hardware clock, so you either have to set the time/date manually at every bootup, or enable NTP. Note, if you enable NTP now, you can change the settings any time in the future -- see the 'Psync' entry in the 'Desktop' menu.")" > /tmp/box_help
  206. ;;
  207. firewall)
  208. HEADING="`gettext 'Firewall'`"
  209. echo "$(gettext "It is always recommended that the firewall be enabled when connected to a network, unless it is a local trusted network. Note that you can run the Firewall Wizard any time in the future if you want to change the settings -- see the 'Setup' menu.")" > /tmp/box_help
  210. ;;
  211. net)
  212. HEADING="`gettext 'Network'`"
  213. echo "$(gettext "Your computer has been assigned a unique name, known as the 'hostname', by which it identifies itself on a network.") $(eval_gettext "It is currently named '\${HOSTNAME}', however you might wish to change that to a name that is more meaningful to yourself, such as 'johnsmithpc'.") $(gettext "The hostname can have letters and numbers, no spaces.")" > /tmp/box_help
  214. ;;
  215. xorg)
  216. HEADING="`gettext 'Xorg Wizards'`"
  217. echo "$(gettext 'If you tick a checkbox, you are flagging your wish to run the Wizard, and it will happen after you click the <b>OK</b> button.
  218. <b>Xorg Video Wizard</b>
  219. This is a text-mode application (keyboard-driven, no mouse, and requires exiting from X (the graphical desktop) to run), that enables you to set the screen resolution, refresh frequency, correct mouse/touchpad, and find a correct hardware-specific driver. Note, the <b>vesa</b> driver is generic, for any video hardware, but is slow. In some cases there is more than one hardware-specific driver and you have to choose the best one -- for example:')
  220. <i>Intel: i810 intel
  221. nVidia: nv nouveau</i>
  222. $(gettext '<b>Video Upgrade Wizard</b>
  223. What this offers depends on the particular build of Puppy Linux. It may offer upgrade PETs for the commercial nVidia and ATI Xorg drivers. In the case of Wary Puppy, there is an offer to upgrade Xorg from version 7.3 to 7.6. Some builds of Puppy do not offer any upgrades via this Wizard, but may have upgrade PETs available elswhere, such as via the Puppy Package Manager or the Puppy Forum.
  224. <b>Note 1:</b> If you need to run either of these Wizards later on, they are available via the <b>setup</b> icon on the desktop, or the <b>Setup</b> category in the menu.
  225. <b>Note 2:</b> The <b>Xorg Video Wizard</b> via the <b>setup</b> icon is a full graphical application, with many more options than the text-mode version, such as finetuning screen dimensions and adjusting brightness. You might want to run that afterward to further finetune your X configuration.')" > /tmp/box_help
  226. ;;
  227. resolution)
  228. HEADING="`gettext 'Screen Resolution'`"
  229. echo "`gettext '<b>Screen resolution</b>
  230. The choices are in the format, for example, <b>1024x768</b>, which means 1024 pixels (dots) horizontally and 768 pixels vertically.
  231. <b>Refresh frequency</b>
  232. Also listed is the vertical refresh frequency, for example <b>1024x768 60.0</b> means that the screen is refreshing (redrawing) 60 times per second. For older cathode-ray-tube monitors, a value of at least 75 is required to minimize flicker. For modern LCD screens, 60 is satisfactory, and even preferred in most cases.
  233. <b>Warning 1</b>
  234. After testing a resolution, you will be given the opportunity to make it permanent if you wish. <b>IF THE NEW RESOLUTION MESSES UP THE SCREEN, WAIT 60 SECONDS OR PRESS CTRL-ALT-BACKSPACE</b>
  235. <b>Warning 2</b>
  236. This resolution selection box uses the <b>xrandr</b> utility to set the resolution, and is intended for testing only, not for a permanent change, as this does not really change the default resolution, instead it switches resolutions after X has started, which causes a delay and flicker at startup and may have other undesirable side-effects. With some X drivers/hardware it may not work at all. Instead, run the Video Wizard to choose a permanent resolution.'`" > /tmp/box_help
  237. ;;
  238. esac
  239. /usr/lib/gtkdialog/box_help "$HEADING" dialog-info.svg &
  240. }
  241. export -f help
  242. ###Network###
  243. #120227 hostname set but only if network connection already available on 1st boot...
  244. #120311 change the logic, allow this frame to persist...
  245. NETWORK_XML=""
  246. if [ "$SET_NETWORK" ];then
  247. SET_NETWORK=""
  248. if [ ! -f /var/local/quicksetup-network-check-flag1 ];then
  249. touch /var/local/quicksetup-network-check-flag2
  250. IFCONFIG="`ifconfig | grep '^[pwe]' | grep -v 'wmaster'`" #test network interface up only.
  251. if [ "$IFCONFIG" ];then
  252. touch /var/local/quicksetup-network-check-flag1
  253. fi
  254. fi
  255. fi
  256. # check connectivity for state of firewall checkbox
  257. if wget -q --spider http://distro.ibiblio.org ;then # returns other than 0 we're not connected
  258. ONLINE='true'
  259. FWTT=$(gettext "Tick checkbox to activate the firewall (recommended)")
  260. else
  261. ONLINE='false'
  262. FWTT=$(gettext "Firewall can not be activated until you are connected")
  263. fi
  264. if [ "$MYBASE" = "quicksetup" ];then #120313 only allow in main quicksetup window.
  265. #130701 removed this condition, always display network frame...
  266. SET_NETWORK="yes"
  267. HOSTNAME="`cat /etc/hostname`" #do not use $HOSTNAME, as hostname-set may have just been run.
  268. #120625 firewall checkbox...
  269. DEFAULT_FIREWALL='false'
  270. #[ "`lsmod | grep '^iptable'`" != "" ] && DEFAULT_FIREWALL='true' # a bad test
  271. [ `iptables -L -n |wc -l` -gt 10 ] && DEFAULT_FIREWALL='true' # not much better!
  272. #120625 get time/date off internet...
  273. CHKBOXNTP=""
  274. if [ "`cat /root/.packages/woof-installed-packages /root/.packages/user-installed-packages | grep '^[Pp]sync'`" != "" ];then
  275. DEFAULT_NTP='false'
  276. #[ -x /root/Startup/timesync.sh ] && DEFAULT_NTP='true' #created by psync package.
  277. [ -f /tmp/settertime ] && DEFAULT_NTP='true' #created by psync package.
  278. CHKBOXNTP='
  279. <hbox tooltip-text="'$(gettext "Set this computer's time and date from an Internet NTP server")'">
  280. <checkbox xalign="0" space-expand="true" space-fill="true">
  281. <label>'$(gettext "Set time/date from the Internet")'</label>
  282. <variable>CHECK_NTP</variable>
  283. <default>'${DEFAULT_NTP}'</default>
  284. </checkbox>
  285. <button>
  286. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  287. <action>help ntp</action>
  288. </button>
  289. </hbox>'
  290. fi
  291. #130701...
  292. SPOT_XML=''
  293. HOMEUSER="`whoami`"
  294. if [ "$HOMEUSER" = "root" ];then
  295. SPOT_XML='
  296. <hbox tooltip-text="'$(gettext 'Tick this if interested in running Internet applications as non-root user spot, for extra security')'" space-expand="false" space-fill="false">
  297. <hbox space-expand="true" space-fill="true">
  298. <button space-expand="false" space-fill="false">
  299. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  300. <action>basichtmlviewer /usr/share/doc/root.htm & </action>
  301. </button>
  302. <text space-expand="true" space-fill="true"><label>""</label></text>
  303. </hbox>
  304. <checkbox space-expand="false" space-fill="false">
  305. <label>'$(gettext 'Run Internet apps as spot')'</label>
  306. <variable>CHECK_SPOT</variable>
  307. <default>false</default>
  308. </checkbox>
  309. </hbox>'
  310. fi
  311. NETWORK_XML='
  312. <frame '$(gettext 'Network')'>
  313. <hbox space-expand="true" space-fill="true">
  314. <vbox space-expand="false" space-fill="false">
  315. <hbox tooltip-text="'${FWTT}'" space-expand="false" space-fill="false">
  316. <checkbox xalign="0" space-expand="true" space-fill="true">
  317. <label>'$(gettext "Firewall enabled")'</label>
  318. <variable>CHECK_FIREWALL</variable>
  319. <default>'${DEFAULT_FIREWALL}'</default>
  320. <sensitive>'${ONLINE}'</sensitive>
  321. </checkbox>
  322. <button space-expand="false" space-fill="false">
  323. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  324. <action>help firewall</action>
  325. </button>
  326. </hbox>
  327. '${CHKBOXNTP}'
  328. </vbox>
  329. <text space-expand="true" space-fill="true"><label>""</label></text>
  330. '"`/usr/lib/gtkdialog/xml_pixmap network_connect.svg icon`"'
  331. <text space-expand="true" space-fill="true"><label>""</label></text>
  332. <vbox space-expand="false" space-fill="false">
  333. '${SPOT_XML}'
  334. <hbox space-expand="false" space-fill="false">
  335. <button space-expand="false" space-fill="false">
  336. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  337. <action>help net</action>
  338. </button>
  339. <text space-expand="false" space-fill="false"><label>'$(gettext 'Hostname:')'</label></text>
  340. <entry tooltip-text="'$(gettext 'Type your computer name to identify in the network. Alpha-numeric without spaces.')'" width-chars="15" space-expand="false" space-fill="false">
  341. <input>echo -n "'$HOSTNAME'"</input>
  342. <variable>ENTRY_HOSTNAME</variable>
  343. </entry>
  344. </hbox>
  345. </vbox>
  346. </hbox>
  347. </frame>'
  348. #fi
  349. fi
  350. ###Country localization###
  351. if [ "$SET_COUNTRY" ];then
  352. #120402
  353. INSTLANGPACK="`grep '^langpack_' /root/.packages/woof-installed-packages | cut -f 2 -d '|'`"
  354. [ ! "$INSTLANGPACK" ] && [ -f /root/.packages/user-installed-packages ] && INSTLANGPACK="`grep '^langpack_' /root/.packages/user-installed-packages | cut -f 2 -d '|'`"
  355. [ ! "$INSTLANGPACK" ] && INSTLANGPACK="none"
  356. ###Choose locale###
  357. LOCALEXML=""
  358. if [ "$SET_LOCALE" ];then
  359. CURRLANG="`grep '^LANG=' /etc/profile | tr -d "'" | tr -d '"' | cut -f 2 -d '='`" #111022
  360. [ ! "$CURRLANG" ] && CURRLANG="en_US" #precaution
  361. UTF8=''
  362. if [ "`echo -n "$CURRLANG" | grep 'utf8'`" != "" ];then #111022 get rid of old name.
  363. rm -rf /usr/lib/locale/$CURRLANG
  364. UTF8='.UTF-8'
  365. fi
  366. [ "`echo -n "$CURRLANG" | grep 'UTF\-8'`" != "" ] && UTF8='.UTF-8'
  367. BASELANG="`basename $CURRLANG .utf8`"
  368. BASELANG="`basename $BASELANG .UTF-8`"
  369. #does the locale need to have UTF-8 enabled?...
  370. UTF_FLAG="no"
  371. grep -q "^${BASELANG}[_. ].*ISO-8859-" /usr/share/i18n/SUPPORTED
  372. [ $? -ne 0 ] && UTF_FLAG="yes" #actually, alternate code below to determine this.
  373. if [ "$PARAM1" != "composeonly" ];then #param passed to chooselocale by 3builddistro in Woof.
  374. #want to default to utf8, but localedef crash problem in 64MB PC...
  375. if [ "$UTF8" = "" ];then
  376. [ ! -d /usr/lib/locale/en_US ] && localedef -f ISO-8859-1 -i en_US --no-archive en_US >/dev/null
  377. else
  378. #warning: free output varies different versions of busybox (also early version do not accept params)...
  379. RAMK=`free | tr -s ' ' | grep -o 'Mem:.*' | cut -f 2 -d ' '`
  380. if [ $RAMK -gt 100000 ];then
  381. #111022 no, i seem to have been lead up the garden path, the dir must remain as 'en_US.utf8'...
  382. [ ! -d /usr/lib/locale/en_US.utf8 ] && localedef -f UTF-8 -i en_US --no-archive en_US.utf8 >/dev/null #110409 111022
  383. else
  384. [ ! -d /usr/lib/locale/en_US ] && localedef -f ISO-8859-1 -i en_US --no-archive en_US >/dev/null
  385. UTF8=''
  386. fi
  387. fi
  388. fi
  389. #build language table...
  390. LANGUAGEDESCR='
  391. aa:Afar
  392. ab:Abkhazian
  393. af:Africaans
  394. am:Amharic
  395. an:Aragonese
  396. ar:Arabic
  397. az:Azeri
  398. be:Belarusian
  399. bg:Bulgarian
  400. bn:Bengali
  401. br:Breton
  402. bs:Bosnian
  403. ca:Catalan
  404. cs:Czech
  405. cy:Welsh
  406. da:Danish
  407. de:German
  408. dv:Divehi
  409. dz:Dzongkha
  410. el:Greek
  411. en:English
  412. eo:Esperanto
  413. es:Spanish
  414. et:Estonian
  415. eu:Basque
  416. fa:Persian
  417. fi:Finnish
  418. fo:Faeroese
  419. fr:French
  420. ga:Irish
  421. gd:Scots_Gaelic
  422. gl:Galician
  423. gu:Gujarati
  424. gv:Manx_Gaelic
  425. he:Hebrew
  426. hi:Hindi
  427. hr:Croatian
  428. hu:Hungarian
  429. hy:Armenian
  430. id:Indonesian
  431. is:Icelandic
  432. it:Italian
  433. iw:Hebrew
  434. ja:Japanese
  435. ka:Georgian
  436. kk:Kazakh
  437. kl:Greenlandic
  438. km:Khmer
  439. kn:Kannada
  440. kok:Konkani
  441. ko:Korean
  442. ku:Kurdish
  443. kw:Cornish
  444. ky:Kyrgyz
  445. lg:Luganda
  446. lo:Lao
  447. lt:Lithuanian
  448. lv:Latvian
  449. mg:Malagasy
  450. mi:Maori
  451. mk:Macedonian
  452. ml:Malayalam
  453. mn:Mongolian
  454. mr:Marathi
  455. ms:Malay
  456. mt:Maltese
  457. ne:Nepali
  458. nl:Dutch
  459. nb:Norgwegian
  460. nn:Norwegian_Nynorsk
  461. no:Norwegian_Bokm
  462. oc:Occitan
  463. om:Oromo
  464. or:Oriya
  465. pa:Pashto
  466. pa:Punjabi
  467. pl:Polish
  468. pt:Portuguese
  469. quz:Quechua
  470. ro:Romania
  471. rs:Serbian
  472. ru:Russian
  473. rw:Kinyarwanda
  474. sa:Sanskrit
  475. se:Sami
  476. sma:Sami
  477. smj:Sami
  478. smn:Sami
  479. sms:Sami
  480. sl:Slovenian
  481. sq:Albanian
  482. sr:Srpski
  483. sv:Swedish
  484. sw:Swahili
  485. syr:Syriac
  486. ta:Tamil
  487. te:Telugu
  488. th:Thai
  489. tl:Tagalog
  490. tr:Turkish
  491. tt:Tatar
  492. uk:Ukrainian
  493. ur:Urdu
  494. uz:Uzbek
  495. vi:Vietnamese
  496. wa:Walloon
  497. xh:Xhosa
  498. yi:Yiddish
  499. zh:Chinese
  500. zu:Zulu'
  501. REGIONDESCR='
  502. AA:ArabicCountries
  503. AE:UAE
  504. AL:Yugoslavia
  505. AR:Argentina
  506. AT:Austria
  507. AU:Australia
  508. BE:Belgium
  509. BG:Bularia
  510. BH:Bahrain
  511. BN:Brunei
  512. BO:Bolvia
  513. BR:Brazil
  514. BZ:Belize
  515. CA:Canada
  516. CH:Switzerland
  517. CL:Chile
  518. CN:PeoplesRepublicChina
  519. CO:Columbia
  520. CR:CostaRica
  521. CY:Cyprus
  522. CZ:CzechRepublic
  523. DE:Germany
  524. DK:Denmark
  525. DO:DominicanRepublic
  526. DO:Dominican
  527. DZ:Algeria
  528. EC:Ecuador
  529. EC:Ecuador
  530. EE:Estonia
  531. EG:Egypt
  532. ES:Spain
  533. FI:Finland
  534. FR:France
  535. GB:GreatBritain
  536. GR:Greece
  537. GT:Guatemalia
  538. HK:HongKong
  539. HN:Honduras
  540. HR:Croatia
  541. HU:Hungary
  542. ID:Indonesia
  543. IE:Ireland
  544. IL:Israel
  545. IN:India
  546. IQ:Iraq
  547. IS:Iceland
  548. IT:Italy
  549. JM:Jamaica
  550. JO:Jordan
  551. JP:Japan
  552. KR:Korea
  553. KW:Kuwait
  554. KZ:Kazakhstan
  555. LB:Lebanon
  556. LI:Liechtenstein
  557. LU:Luxembourg
  558. LY:Libya
  559. MA:Morocco
  560. MC:Monaco
  561. MK:Macedonia
  562. MO:Macau
  563. MY:Malaysia
  564. MX:Mexico
  565. MX:Mexico
  566. NI:Nicaragua
  567. NI:Nicaragua
  568. NL:Netherlands
  569. NO:Norway
  570. NZ:NewZealand
  571. OM:Oman
  572. PA:Panama
  573. PE:Peru
  574. PE:Peru
  575. PH:Philippines
  576. PL:Poland
  577. PR:PuertoRico
  578. PT:Portugal
  579. PY:Paraguay
  580. QA:Qatar
  581. RO:Romania
  582. RU:Russia
  583. SA:SaudiArabia
  584. SE:Sweden
  585. SG:Singapore
  586. SK:Slovakia
  587. SV:ElSalvador
  588. SY:Syria
  589. TH:Thailand
  590. TN:Tunisia
  591. TR:Turkey
  592. TW:Taiwan
  593. TT:Trinidad
  594. US:USA
  595. UY:Uruguay
  596. VE:Venezuela
  597. YE:Yemen
  598. YU:Yugoslavia
  599. ZA:SouthAfrica
  600. ZA:SouthAfrica'
  601. #need sanity check, as format of these files has changed...
  602. SANITYFLAG='pass'
  603. [ -f /usr/share/i18n/dialog_table_x ] || SANITYFLAG='fail' #111113 precaution.
  604. [ -s /usr/share/i18n/dialog_table_cli ] && [ `cat /usr/share/i18n/dialog_table_cli | wc -l` -le 1 ] && SANITYFLAG='fail'
  605. [ -s /usr/share/i18n/dialog_table_x ] && [ `cat /usr/share/i18n/dialog_table_x | wc -l` -le 1 ] && SANITYFLAG='fail'
  606. if [ "$PARAM1" = "composeonly" -o "$SANITYFLAG" = "fail" ];then
  607. #CHOICES_CLI=""; ON=""; OFF=""; CHOICES_X="" #120717 remove XPID="";
  608. rm -f /tmp/quicksetup_language_x;rm -f /tmp/quicksetup_language_cli
  609. for ONELOCALE in `ls -1 /usr/share/i18n/locales | grep -v -E 'i18n|iso|translit|POSIX'`
  610. do
  611. STATUS="off"
  612. [ "$ONELOCALE" = "$BASELANG" ] && STATUS="on"
  613. LANGUAGE="${ONELOCALE%%_*}"
  614. REGION=`echo -n "${ONELOCALE#*_}" | cut -f 1 -d '.' | cut -f 1 -d '@'`
  615. lPATTERN="^${LANGUAGE}:"
  616. LANGUAGE=`echo "$LANGUAGEDESCR" | tr ' ' '\n' | grep "$lPATTERN" | head -n 1 | cut -f 2 -d ':'`
  617. rPATTERN="^${REGION}:"
  618. REGION=`echo "$REGIONDESCR" | tr ' ' '\n' | grep "$rPATTERN" | head -n 1 | cut -f 2 -d ':'`
  619. [ "$LANGUAGE" -a "$REGION" ] && LANGUAGE="${LANGUAGE}, "
  620. DESCR="${LANGUAGE}${REGION}"
  621. if [ "$STATUS" = "on" ];then
  622. echo "$ONELOCALE \"${DESCR}\" on" >>/tmp/quicksetup_language_x
  623. FIRSTLINE_CLI="$ONELOCALE \"${DESCR}\" "
  624. touch /tmp/quicksetup_language_cli
  625. sed -i '1 i\\'"$FIRSTLINE_CLI" /tmp/quicksetup_language_cli
  626. else
  627. echo "$ONELOCALE \"${DESCR}\" off" >>/tmp/quicksetup_language_x
  628. echo "$ONELOCALE \"${DESCR}\" " >>/tmp/quicksetup_language_cli
  629. fi
  630. done
  631. cat /tmp/quicksetup_language_x >/usr/share/i18n/dialog_table_x
  632. [ $? = 0 ] && rm /tmp/quicksetup_language_x
  633. cat /tmp/quicksetup_language_cli >/usr/share/i18n/dialog_table_cli
  634. [ $? = 0 ] && rm /tmp/quicksetup_language_cli
  635. [ "$PARAM1" = "composeonly" ] && exit
  636. fi
  637. #tables already exist, but may need to reselect 'on' item...
  638. onPTN="s%^${BASELANG} \"(.*)\" off$%${BASELANG} \"\1\" on%"
  639. sed -i -e 's% on$% off%' -r -e "$onPTN" /usr/share/i18n/dialog_table_x
  640. DEFAULTXML=""
  641. DEFAULT=`grep ' on$' /usr/share/i18n/dialog_table_x | sed -e 's% on$%%' -e 's%"%%g' -e "s% % ${TABCHAR}%"`
  642. [ "$DEFAULT" ] && DEFAULTXML="<item>${DEFAULT}</item>" #111107 combobox does not support default tag.
  643. ITEMS=`sed -e 's% on$%%' -e 's% off$%%' -e 's%"%%g' -e "s% % ${TABCHAR}%" -e 's%^%<item>%' -e 's%$%</item>%' /usr/share/i18n/dialog_table_x`
  644. DEFAULT_UTF8='false'
  645. [ "$UTF8" ] && DEFAULT_UTF8='true'
  646. CHECKUTF8XML='
  647. <hbox tooltip-text="'$(gettext 'Tick checkbox to support UTF-8 encoding')'" space-expand="true" space-fill="true">
  648. <checkbox space-expand="false" space-fill="false">
  649. <label>'$(gettext 'UTF-8 encoding')'</label>
  650. <variable>CHECK_UTF8</variable>
  651. <default>'${DEFAULT_UTF8}'</default>
  652. </checkbox>
  653. <text space-expand="true" space-fill="true"><label>""</label></text>
  654. <button space-expand="false" space-fill="false">
  655. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  656. <action>help utf8</action>
  657. </button>
  658. </hbox>'
  659. LOCALEXML='
  660. <vbox space-expand="false" space-fill="false">
  661. <hbox tooltip-text="'$(gettext "Main Language")'" space-expand="true" space-fill="true">
  662. '"`/usr/lib/gtkdialog/xml_pixmap country_language.svg icon`"'
  663. <text width-request="10" space-expand="false" space-fill="false"><label>""</label></text>
  664. <vbox space-expand="true" space-fill="true">'
  665. [ "$(grep -E "countrywizard|quickcountry" <<< "$MYBASE")" ] && LOCALEXML=$LOCALEXML'<text use-markup="true" xalign="0" yalign="1" height-request="20" space-expand="true" space-fill="true"><label>"<b>'$(gettext "Main language")'</b>"</label></text>'
  666. LOCALEXML=$LOCALEXML'
  667. <hbox tooltip-text="'$(gettext "Choose main language")'" space-expand="true" space-fill="true">
  668. <combobox space-expand="true" space-fill="true">
  669. '${DEFAULTXML}'
  670. '${ITEMS}'
  671. <variable>COMBO_LOCALE</variable>
  672. </combobox>
  673. <button space-expand="false" space-fill="false">
  674. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  675. <action>help locale</action>
  676. </button>
  677. </hbox>
  678. '${CHECKUTF8XML}'
  679. </vbox>
  680. </hbox>
  681. </vbox>'
  682. fi #end SET_LOCALE
  683. ###Choose timezone###
  684. TIMEZONEXML=""
  685. if [ "$SET_TIMEZONE" ];then
  686. if [ -e /etc/localtime ];then
  687. CZONE="`readlink /etc/localtime 2>/dev/null`"
  688. [ "$CZONE" = "" ] && rm -f /etc/localtime
  689. fi
  690. if [ -e /etc/localtime ];then
  691. CZONE="`readlink /etc/localtime`"
  692. DEF_TIMEZONE="`readlink /etc/localtime | sed -e 's%/usr/share/zoneinfo/%%'`"
  693. else
  694. CZONE='/usr/share/zoneinfo/Australia/Perth'
  695. DEF_TIMEZONE='Australia/Perth'
  696. fi
  697. DEF_TIMEZONE=`echo -n "$DEF_TIMEZONE" | sed -e 's%Etc/%%'`
  698. xDEF_TIMEZONE="`echo -n "$DEF_TIMEZONE" | sed 's%GMT%GMT\\\\%'`" #the sign needs a \ in front. ex: GMT\+8
  699. #120901 fix for new layout in ubuntu precise...
  700. ZONEINFO="`find /usr/share/zoneinfo -mindepth 2 -type f -o -type l | grep -v -E 'UTC|Greenwich|UCT|Universal|Zulu|posix|right' | sed -e 's%/usr/share/zoneinfo/%%' -e 's%Etc/%%' | tr ' ' '_' | sort | tr '\n' ' '`"
  701. if [ ! -f /var/local/quicksetup-timezone-table-x -o ! -f /var/local/quicksetup-timezone-table-cli ];then
  702. rm -f /var/local/quicksetup-timezone-table-x
  703. rm -f /var/local/quicksetup-timezone-table-cli
  704. ZONECHOICES_CLI=""
  705. for ONEZONE in $ZONEINFO
  706. do
  707. ONEDESCR="."
  708. [ "$ONEZONE" = "GMT" ] && continue
  709. [ "$ONEZONE" = "GMT-0" ] && continue
  710. case $ONEZONE in
  711. GMT+0) ONEDESCR='(London, Dublin, Edinburgh, Lisbon, Reykjavik, Casablanca)';;
  712. GMT-1) ONEDESCR='(Azores, Cape Verdes)';;
  713. GMT+1) ONEDESCR='(Paris, Berlin, Amsterdam, Brussels, Madrid, Stockholm Oslo)';;
  714. GMT-2) ONEDESCR='(mid-Atlantic)';;
  715. GMT+2) ONEDESCR='(Athens, Helsinki, Istanbul, Jerusalem, Harare)';;
  716. GMT-3) ONEDESCR='(Brasilia, Buenos Aires, Georgetown)';;
  717. GMT+3) ONEDESCR='(Kuwait, Nairobi, Riyadh, Moscow)';;
  718. GMT-4) ONEDESCR='(Caracas, La Paz, Canada)';;
  719. GMT+4) ONEDESCR='(Abu Dhabi, Muscat, Tblisi, Volgograd, Kabul)';;
  720. GMT-5) ONEDESCR='(Bogota, Lima, New York)';;
  721. GMT+5) ONEDESCR='(Islamabad, Karachi)';;
  722. GMT+5:30) ONEDESCR='(India)';;
  723. GMT-6) ONEDESCR='(Mexico City, Saskatchewan)';;
  724. GMT+6) ONEDESCR='(Almaty, Dhaka)';;
  725. GMT+6:30) ONEDESCR='(Cocos Islands)';;
  726. GMT-7) ONEDESCR='(Alberta, Montana, Arizona)';;
  727. GMT+7) ONEDESCR='(Bangkok, Jakarta)';;
  728. GMT-8) ONEDESCR='(Los Angeles)';;
  729. GMT+8) ONEDESCR='(Perth, Singapore, Hongkong)';;
  730. GMT-9) ONEDESCR='(Alaska)';;
  731. GMT+9) ONEDESCR='(Tokyo)';;
  732. GMT+9:30) ONEDESCR='(Darwin, Adelaide)';;
  733. GMT-10) ONEDESCR='(Alaska, Hawaii)';;
  734. GMT+10) ONEDESCR='(Guam)';;
  735. GMT+10:30) ONEDESCR='(Lord Howe Island)';;
  736. GMT-11) ONEDESCR='(Samoa)';;
  737. GMT+11) ONEDESCR='(Magadan, Soloman Is.)';;
  738. GMT-12) ONEDESCR='(Eniwetok)';;
  739. GMT+12) ONEDESCR='(Wellington, Fiji, Marshall Islands)';;
  740. GMT+13) ONEDESCR='(Rawaki Islands)';;
  741. GMT+14) ONEDESCR='(Line Islands)';;
  742. esac
  743. echo -n "${ONEZONE} \"${ONEDESCR}\" " >> /var/local/quicksetup-timezone-table-cli #111113
  744. if [ "$DEF_TIMEZONE" = "${ONEZONE}" ];then
  745. echo "${ONEZONE} \"${ONEDESCR}\" on" >> /var/local/quicksetup-timezone-table-x
  746. else
  747. echo "${ONEZONE} \"${ONEDESCR}\" off" >> /var/local/quicksetup-timezone-table-x
  748. fi
  749. done
  750. fi
  751. ZONECHOICES_CLI="`cat /var/local/quicksetup-timezone-table-cli`" #111113
  752. #table already exist, but may need to reselect 'on' item...
  753. onPTN="s%^${xDEF_TIMEZONE} \"(.*)\" off$%${DEF_TIMEZONE} \"\1\" on%"
  754. sed -i -e 's% on$% off%' -r -e "$onPTN" /var/local/quicksetup-timezone-table-x
  755. DEFAULTXML=""
  756. DEFAULT=`grep ' on$' /var/local/quicksetup-timezone-table-x | sed -e 's% on$%%' -e 's%"%%g' -e "s% %${TABCHAR}%"`
  757. [ "$DEFAULT" ] && DEFAULTXML="<item>${DEFAULT}</item>" #111107 combobox does not support default tag.
  758. ITEMS=`sed -e 's% on$%%' -e 's% off$%%' -e 's%"%%g' -e "s% %${TABCHAR}%" -e 's%^%<item>%' -e 's%$%</item>%' /var/local/quicksetup-timezone-table-x`
  759. DEFAULT_UTC="false"
  760. [ "$HWCLOCKTIME" = "utc" ] && DEFAULT_UTC="true" #see /etc/clock
  761. CHECKUTCXML='
  762. <hbox tooltip-text="'$(gettext 'Tick checkbox if hardware clock is set to UTC, untick if hardware clock set to local time')'" space-expand="true" space-fill="true">
  763. <checkbox space-expand="false" space-fill="false">
  764. <label>'$(gettext 'Hardware clock set to UTC')'</label>
  765. <variable>CHECK_UTC</variable>
  766. <default>'${DEFAULT_UTC}'</default>
  767. </checkbox>
  768. <text space-expand="true" space-fill="true"><label>""</label></text>
  769. <button space-expand="false" space-fill="false">
  770. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  771. <action>help utc</action>
  772. </button>
  773. </hbox>'
  774. TIMEZONEXML='
  775. <vbox space-expand="false" space-fill="false">
  776. <hbox tooltip-text="'$(gettext "Time Zone")'" space-expand="true" space-fill="true">
  777. '"`/usr/lib/gtkdialog/xml_pixmap country_timezone.svg icon`"'
  778. <text width-request="10" space-expand="false" space-fill="false"><label>""</label></text>
  779. <vbox space-expand="true" space-fill="true">'
  780. [ "$(grep -E "countrywizard|quickcountry" <<< "$MYBASE")" ] && TIMEZONEXML=$TIMEZONEXML'<hseparator></hseparator><text use-markup="true" xalign="0" yalign="1" height-request="30" space-expand="true" space-fill="true"><label>"<b>'$(gettext "Time zone")'</b>"</label></text>'
  781. TIMEZONEXML=$TIMEZONEXML'
  782. <hbox tooltip-text="'$(gettext "Choose time zone")'" space-expand="true" space-fill="true">
  783. <combobox space-expand="true" space-fill="true">
  784. '${DEFAULTXML}'
  785. '${ITEMS}'
  786. <variable>COMBO_TIMEZONE</variable>
  787. </combobox>
  788. <button space-expand="false" space-fill="false">
  789. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  790. <action>help timezone</action>
  791. </button>
  792. </hbox>
  793. '${CHECKUTCXML}'
  794. </vbox>
  795. </hbox>
  796. </vbox>'
  797. fi #end SET_TIMEZONE
  798. ###keyboard layout###
  799. KEYBOARDXML=""
  800. if [ "$SET_KEYBOARD" ];then
  801. #120627
  802. KMAPPATH='/lib/keymaps'
  803. [ -d /usr/share/kbd/keymaps/i386 ] && KMAPPATH='/usr/share/kbd/keymaps/i386'
  804. [ -d /usr/share/keymaps/i386 ] && KMAPPATH='/usr/share/keymaps/i386' #debian, gentoo. note, debian files have extension .kmap.gz, gentoo have .map.gz
  805. KEXT=''
  806. [ -f ${KMAPPATH}/qwerty/us.map ] && KEXT='.map'
  807. [ -f ${KMAPPATH}/qwerty/us.map.gz ] && KEXT='.map'
  808. [ -f ${KMAPPATH}/qwerty/us.kmap ] && KEXT='.kmap'
  809. [ -f ${KMAPPATH}/qwerty/us.kmap.gz ] && KEXT='.kmap'
  810. DEF_KMAP="us"
  811. [ -f /etc/keymap ] && DEF_KMAP="`cat /etc/keymap | sed -e 's/\..*//'`"
  812. [ ! "$DEF_KMAP" ] && DEF_KMAP="us" #precaution.
  813. if [ ! -f /var/local/quickset-keyboard-list ];then
  814. echo -n "" > /var/local/quickset-keyboard-list
  815. case $KMAPPATH in #120627
  816. /lib/keymaps) KMAPFILES="`find /lib/keymaps -mindepth 1 -maxdepth 1 -name '*.gz' | sort`" ;; #ex: us.gz
  817. *) KMAPFILES="`find ${KMAPPATH}/[^i]* -name '*.map' -o -name '*.kmap' -o -name '*.map.gz' -o -name '*.kmap.gz' -not -name 'defkeymap*' | sort`" ;;
  818. esac
  819. for AFILE in $KMAPFILES
  820. do
  821. AKMAP="`basename $AFILE .gz`" #us, fr, br, etc.
  822. AKMAP="`basename $AKMAP .kmap`" #120627
  823. AKMAP="`basename $AKMAP .map`" #120627
  824. case $AKMAP in
  825. us*) ACNTRY="(USA)";;
  826. fr*) ACNTRY="(France)";;
  827. it*) ACNTRY="(Italy)";;
  828. ba*) ACNTRY="(Bashkir)";;
  829. be*) ACNTRY="(Belgium)";;
  830. bg*) ACNTRY="(Bulgaria)";;
  831. br*) ACNTRY="(Brazil)";;
  832. by*) ACNTRY="(Byelorussian)";;
  833. cf*) ACNTRY="(French-Canadian)";;
  834. croat*) ACNTRY="(Croatia)";;
  835. cz*) ACNTRY="(Czech)";;
  836. de) ACNTRY="(Germany)";;
  837. de_*) ACNTRY="(Germany)";;
  838. de-*) ACNTRY="(Germany)";;
  839. dk*) ACNTRY="(Denmark)";;
  840. es*) ACNTRY="(Spain)";;
  841. fi*) ACNTRY="(Finland)";;
  842. hu*) ACNTRY="(Hungary)";;
  843. ka*) ACNTRY="(Kazakhstan)";;
  844. ky*) ACNTRY="(Kyrgyzstan)";;
  845. et*) ACNTRY="(Estonia)";;
  846. lt*) ACNTRY="(Lithuania)";;
  847. mk*) ACNTRY="(Macedonia)";;
  848. sr*) ACNTRY="(Serbia)";;
  849. tr*) ACNTRY="(Turkey)";;
  850. tt*) ACNTRY="(Tatar)";;
  851. sg*) ACNTRY="(Sango)";;
  852. ua*) ACNTRY="(Ukraine)";;
  853. gr*) ACNTRY="(Greece)";;
  854. il*) ACNTRY="(Israel)";;
  855. is*) ACNTRY="(Iceland)";;
  856. jp*) ACNTRY="(Japan)";;
  857. pc*) ACNTRY="(Japanese/English)";;
  858. la*) ACNTRY="(Latin_America)";;
  859. nl*) ACNTRY="(Netherlands)";;
  860. no*) ACNTRY="(Norway)";;
  861. pl*) ACNTRY="(Poland)";;
  862. pt*) ACNTRY="(Portugal)";;
  863. ro*) ACNTRY="(Romania)";;
  864. ru*) ACNTRY="(Russia)";;
  865. se*) ACNTRY="(Sweden)";;
  866. sv*) ACNTRY="(Sweden)";;
  867. sk*) ACNTRY="(Slovakia)";;
  868. sl*) ACNTRY="(Slovenia)";;
  869. uk*) ACNTRY="(UK)";;
  870. wangbe*) ACNTRY="(Belgium)";;
  871. azerty) ACNTRY="(Tandon)";;
  872. dvorak-r) ACNTRY="(Right_single-handed)";;
  873. dvorak-l) ACNTRY="(Left_single-handed)";;
  874. *) ACNTRY="-";;
  875. esac
  876. if [ "$DEF_KMAP" = "$AKMAP" ];then
  877. echo "$AKMAP \"${ACNTRY}\" on" >> /var/local/quickset-keyboard-list
  878. else
  879. echo "$AKMAP \"${ACNTRY}\" off" >> /var/local/quickset-keyboard-list
  880. fi
  881. done
  882. fi
  883. #table already exist, but may need to reselect 'on' item...
  884. onPTN="s%^${DEF_KMAP} \"(.*)\" off$%${DEF_KMAP} \"\1\" on%"
  885. sed -i -e 's% on$% off%' -r -e "$onPTN" /var/local/quickset-keyboard-list
  886. DEFAULTXML=""
  887. DEFAULT=`grep ' on$' /var/local/quickset-keyboard-list | sed -e 's% on$%%' -e 's%"%%g' -e "s% % ${TABCHAR}%"`
  888. [ "$DEFAULT" ] && DEFAULTXML="<item>${DEFAULT}</item>" #111107 combobox does not support default tag.
  889. ITEMS=`sed -e 's% on$%%' -e 's% off$%%' -e 's%"%%g' -e "s% % ${TABCHAR}%" -e 's%^%<item>%' -e 's%$%</item>%' /var/local/quickset-keyboard-list`
  890. DEFAULT_NUMLOCK="false"
  891. CHECKNUMLOCKXML=""
  892. if which numlockx >/dev/null;then
  893. [ -x /root/Startup/numlockx ] && [ "`grep '^numlockx on' /root/Startup/numlockx`" != "" ] && DEFAULT_NUMLOCK="true"
  894. CHECKNUMLOCKXML='
  895. <hbox tooltip-text="'$(gettext 'Tick checkbox to turn on keyboard numlock')'" space-expand="true" space-fill="true">
  896. <checkbox space-expand="false" space-fill="false">
  897. <label>'$(gettext 'Keyboard numlock')'</label>
  898. <variable>CHECK_NUMLOCK</variable>
  899. <default>'${DEFAULT_NUMLOCK}'</default>
  900. </checkbox>
  901. <text space-expand="true" space-fill="true"><label>""</label></text>
  902. <button space-expand="false" space-fill="false">
  903. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  904. <action>help numlock</action>
  905. </button>
  906. </hbox>'
  907. fi
  908. KEYBOARDXML='
  909. <vbox space-expand="false" space-fill="false">
  910. <hbox tooltip-text="'$(gettext "Keyboard Layout")'" space-expand="true" space-fill="true">
  911. '"`/usr/lib/gtkdialog/xml_pixmap country_keyboard.svg icon`"'
  912. <text width-request="10" space-expand="false" space-fill="false"><label>""</label></text>
  913. <vbox space-expand="true" space-fill="true">'
  914. [ "$(grep -E "countrywizard|quickcountry" <<< "$MYBASE")" ] && KEYBOARDXML=$KEYBOARDXML'<hseparator></hseparator><text use-markup="true" xalign="0" yalign="1" height-request="30" space-expand="true" space-fill="true"><label>"<b>'$(gettext "Keyboard Layout")'</b>"</label></text>'
  915. KEYBOARDXML=$KEYBOARDXML'<hbox tooltip-text="'$(gettext "Choose keyboard layout")'" space-expand="true" space-fill="true">
  916. <combobox space-expand="true" space-fill="true">
  917. '${DEFAULTXML}'
  918. '${ITEMS}'
  919. <variable>COMBO_KEYBOARD</variable>
  920. </combobox>
  921. <button space-expand="false" space-fill="false">
  922. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  923. <action>help keyboard</action>
  924. </button>
  925. </hbox>
  926. '${CHECKNUMLOCKXML}'
  927. </vbox>
  928. </hbox>
  929. </vbox>'
  930. fi #end SET_KEYBOARD
  931. COUNTRYXML='
  932. <vbox>
  933. <frame '${COUNTRYFRAMETITLE}'>
  934. '${LOCALEXML}'
  935. '${TIMEZONEXML}'
  936. '${KEYBOARDXML}'
  937. </frame>
  938. </vbox>'
  939. fi #end SET_COUNTRY
  940. ###setup x###
  941. if [ "$SET_X" ];then
  942. #try keep this message short, so renders in one line...
  943. M_xy="`gettext 'If the Wizard fails to set desired resolution, try this:'`" #used in SET_XRES, but maybe changed in SET_XWIZARD.
  944. if [ "$SET_XWIZARD" ];then
  945. #note, quicksetup gets launched from /usr/sbin/delayedrun, but only for xorg, not xvesa.
  946. #put up a button to launch xorgwizard...
  947. if [ -f /var/log/Xorg.0.log ];then #log file created when X starts.
  948. XDRIVERSUCCESS=''
  949. LOADED="$(grep 'Loading .*/xorg/modules/drivers/.*_drv.so' /var/log/Xorg.0.log | rev | cut -f 1 -d '/' | rev | cut -f 1 -d '_' | tr '\n' ' ')"
  950. for ALOADED in $LOADED
  951. do
  952. aPTN="UnloadModule: \"$ALOADED\""
  953. bPTN="LoadModule: \"$ALOADED\""
  954. #Xorg loaded noauveau, then tried to load it again, failed, then unloaded, so count them...
  955. CNTload=`grep "$bPTN" /var/log/Xorg.0.log | wc -l`
  956. CNTunload=`grep "$aPTN" /var/log/Xorg.0.log | wc -l`
  957. [ $CNTload -eq 0 ] && continue
  958. [ $CNTunload -ge $CNTload ] && continue
  959. XDRIVERSUCCESS="$ALOADED"
  960. break
  961. done
  962. if [ "$XDRIVERSUCCESS" ];then #precaution.
  963. #130509 record this for xorgwizard-cli...
  964. if [ $PUPMODE -eq 5 ];then
  965. if [ "$DISTRO_XORG_AUTO" = "yes" ];then #see /etc/DISTRO_SPECS
  966. echo -n "$XDRIVERSUCCESS" > /var/local/quicksetup-pupmode5-autodriver
  967. fi
  968. fi
  969. M_xdrv1=$(gettext 'The generic <b>vesa</b> video driver is currently being used. It is recommended that you run the Video Wizard to try and load a hardware-specific driver. Failing that, try the Video Upgrade Wizard.')
  970. M_xdrv2=$(gettext 'The')
  971. M_xdrv3=$(gettext 'video driver is currently being used. Good, but if you need to adjust screen resolution or displacement, run the Video Wizard.')
  972. TT_xorg1=$(gettext 'Run the Xorg Video Wizard')
  973. TT_xorg2=$(gettext 'Xorg Video Wizard')
  974. B_xwiz=$(gettext 'Video Wizard')
  975. B_xup=$(gettext 'Upgrade Wizard')
  976. TT_xup1=$(gettext 'Run the Video Upgrade Wizard')
  977. TT_xup2=$(gettext 'Video Upgrade Wizard')
  978. if [ "$XDRIVERSUCCESS" = "vesa" ];then
  979. M_xy="`gettext 'If the Wizards fail to set desired resolution, try this:'`" #used in SET_XRES.
  980. XMSGXML="<text use-markup=\"true\"><label>\"${M_xdrv1}\"</label></text>"
  981. XWIZARDXML='
  982. <hbox space-expand="true" space-fill="true">
  983. '"`/usr/lib/gtkdialog/xml_pixmap graphics.svg icon`"'
  984. <text space-expand="true" space-fill="true"><label>""</label></text>
  985. <vbox>
  986. <hbox tooltip-text="'${TT_xorg2}'">
  987. <checkbox tooltip-text="'${TT_xorg1}'">
  988. <variable>CHECK_XORGWIZARD</variable>
  989. <label>'${B_xwiz}'</label>
  990. <action>if true disable:CHECK_XUPGRADE</action>
  991. <action>if false enable:CHECK_XUPGRADE</action>
  992. </checkbox>
  993. </hbox>
  994. <hbox tooltip-text="'${TT_xup2}'">
  995. <checkbox tooltip-text="'${TT_xup1}'">
  996. <variable>CHECK_XUPGRADE</variable>
  997. <label>'${B_xup}'</label>
  998. <action>if true disable:CHECK_XORGWIZARD</action>
  999. <action>if false enable:CHECK_XORGWIZARD</action>
  1000. </checkbox>
  1001. <button>
  1002. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  1003. <action>help xorg</action>
  1004. </button>
  1005. </hbox>
  1006. </vbox>
  1007. </hbox>'
  1008. else
  1009. XMSGXML="<text use-markup=\"true\"><label>\"${M_xdrv2} <b>${XDRIVERSUCCESS}</b> ${M_xdrv3}\"</label></text>"
  1010. XWIZARDXML='
  1011. <hbox space-expand="true" space-fill="true">
  1012. '"`/usr/lib/gtkdialog/xml_pixmap graphics.svg icon`"'
  1013. <text space-expand="true" space-fill="true"><label>""</label></text>
  1014. <vbox>
  1015. <hbox tooltip-text="'${TT_xorg2}'">
  1016. <checkbox tooltip-text="'${TT_xorg1}'">
  1017. <variable>CHECK_XORGWIZARD</variable>
  1018. <label>'${B_xwiz}'</label>
  1019. </checkbox>
  1020. <button>
  1021. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  1022. <action>help xorg</action>
  1023. </button>
  1024. </hbox>
  1025. </vbox>
  1026. </hbox>'
  1027. fi
  1028. fi
  1029. fi
  1030. fi #end SET_XWIZARD
  1031. if [ "$SET_XRES" ];then
  1032. #a combobox to choose resolution...
  1033. FLAG_XYRES="enabled"
  1034. #shinobar...
  1035. NVIDIABUTTON=""
  1036. if which nvidia-settings &>/dev/null && NRATE=$(nvidia-settings -q RefreshRate | grep '[0-9]') ; then
  1037. NVIDIABUTTON="<button tooltip-text=\"$(gettext 'Launch the NVIDIA X Server Settings.')\" icon_size=\"2\" ><input file>/usr/local/video_upgrade/nvidia48x32.png</input><label>$(gettext 'NVIDIA')</label><action>EXIT:NVIDIA</action></button>"
  1038. FLAG_XYRES="disabled"
  1039. fi
  1040. XRANDR="`xrandr -q`"
  1041. DEF_XYRES="`echo "$XRANDR" | tr -s ' ' | grep '^ [0-9]' | grep '\*' | cut -f 2 -d ' ' | head -n 1`" #130202 'head -n 1' workaround for dual monitors. (see also .xinitrc)
  1042. DEF_VFREQ="$(echo "$XRANDR" | tr -s ' ' | grep '^ [0-9]' | grep '\*' | cut -f 3 -d ' ' | cut -f 1 -d '*' | head -n 1)" #130202 get freq also.
  1043. xXYRESES="$(echo "$XRANDR"| tr -s ' ' | grep '^ [0-9]'|while read p
  1044. do
  1045. echo $p | awk '{print $1,$2}'
  1046. e=`echo $p | awk '{print $3}'`
  1047. if [ "$e" != "" ];then
  1048. [ "$e" = "+" ] && continue
  1049. echo $p | awk '{print $1,$3}'
  1050. fi
  1051. f=`echo $p | awk '{print $4}'`
  1052. if [ "$f" != "" ];then
  1053. [ "$f" = "+" ] && continue
  1054. echo $p | awk '{print $1,$4}'
  1055. fi
  1056. g=`echo $p | awk '{print $5}'`
  1057. if [ "$g" != "" ];then
  1058. [ "$g" = "+" ] && continue
  1059. echo $p | awk '{print $1,$5}'
  1060. fi
  1061. done)" #131121 #131124 sort out "+" ..is it necessary to go beyond $5?
  1062. LIST_XYRESES=""
  1063. [ "$xXYRESES" ] && LIST_XYRESES="$(echo "$xXYRESES" | sed -e 's%$% "" off%')"
  1064. echo "$LIST_XYRESES" > /var/local/quickset-xrandr-list
  1065. RESLINE=`grep -n ${DEF_XYRES} /var/local/quickset-xrandr-list|grep "\*"` #get the line number of default
  1066. RESLINE=${RESLINE%%:*}
  1067. sed -i -e 's% on$% off%' -e ""$RESLINE"s%off$%on%" /var/local/quickset-xrandr-list
  1068. DEFAULTXML=""
  1069. DEFAULT=`grep ' on$' /var/local/quickset-xrandr-list | sed -e 's% on$%%' -e 's%"%%g' -e "s% % ${TABCHAR}%"`
  1070. [ "$DEFAULT" ] && DEFAULTXML="<item>${DEFAULT}</item>" #111107 combobox does not support default tag.
  1071. ITEMS=`sed -e 's% on$%%' -e 's% off$%%' -e 's%"%%g' -e "s% % ${TABCHAR}%" -e 's%^%<item>%' -e 's%$%</item>%' /var/local/quickset-xrandr-list`
  1072. [ "$SET_XWIZARD" ] && XRANDRWARNXML="<text><label>${M_xy}</label></text>"
  1073. XYRESXML='
  1074. <vbox space-expand="false" space-fill="false">
  1075. '${XRANDRWARNXML}'
  1076. <hbox tooltip-text="'$(gettext 'Xrandr Screen Resolution')'">
  1077. <combobox tooltip-text="'$(gettext 'Set screen resolution with xrandr')'">
  1078. '${DEFAULTXML}'
  1079. '${ITEMS}'
  1080. <variable>COMBO_XYRES</variable>
  1081. <visible>'${FLAG_XYRES}'</visible>
  1082. </combobox>
  1083. <button>
  1084. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  1085. <action>help resolution</action>
  1086. </button>
  1087. </hbox>
  1088. </vbox>'
  1089. fi #end SET_XRES
  1090. XXML='
  1091. <vbox>
  1092. <frame '${XFRAMETITLE}'>
  1093. '${XWIZARDXML}'
  1094. '${NVIDIABUTTON}'
  1095. '${XMSGXML}'
  1096. '${XYRESXML}'
  1097. </frame>
  1098. </vbox>'
  1099. fi
  1100. #120714 alternate audio/video frame for arm board... create $XXML...
  1101. if [ "$SET_RP_AUDIO" -o "$SET_RP_VIDEO" ];then
  1102. if [ "$SET_RP_AUDIO" ];then
  1103. RP_DEF_AUDIO='0'; RP_AUDIO_0_DEF='false'; RP_AUDIO_1_DEF='false'; RP_AUDIO_2_DEF='false'
  1104. if [ -f /etc/init.d/11alsa_raspi ];then
  1105. RP_DEF_AUDIO="`grep 'amixer cset numid' /etc/init.d/11alsa_raspi | rev | cut -f 1 -d ' ' | rev`" #0=auto, 1=analog, 2=hdmi.
  1106. else #precaution. script should be provided by 'z_raspi_fixes_hack' pet.
  1107. echo '#!/bin/sh
  1108. case $1 in
  1109. start)
  1110. amixer cset numid=3 0
  1111. ;;
  1112. esac' > /etc/init.d/11alsa_raspi
  1113. chmod 755 /etc/init.d/11alsa_raspi
  1114. fi
  1115. case $RP_DEF_AUDIO in
  1116. 1) RP_AUDIO_1_DEF='true' ;;
  1117. 2) RP_AUDIO_2_DEF='true' ;;
  1118. *) RP_AUDIO_0_DEF='true' ;;
  1119. esac
  1120. RP_AUDIOXML="<frame $(gettext 'Raspberry Pi Audio Settings')>
  1121. <radiobutton active=\"${RP_AUDIO_0_DEF}\"><label>$(gettext 'Automatic output routing')</label><variable>RP_AUDIO_0_RAD</variable></radiobutton>
  1122. <radiobutton active=\"${RP_AUDIO_1_DEF}\"><label>$(gettext 'Output to round analog socket')</label><variable>RP_AUDIO_1_RAD</variable></radiobutton>
  1123. <radiobutton active=\"${RP_AUDIO_2_DEF}\"><label>$(gettext 'Output to HDMI TV/monitor')</label><variable>RP_AUDIO_2_RAD</variable></radiobutton>
  1124. </frame>"
  1125. fi
  1126. if [ "$SET_RP_VIDEO" ];then
  1127. RP_VIDEOXML="<frame Raspberry Pi Video Settings>
  1128. <text><label>No fancy GUI here yet! Please edit file 'config.txt' in partition #1 then reboot.</label></text>
  1129. </frame>"
  1130. fi
  1131. XXML="<vbox>
  1132. ${RP_AUDIOXML}
  1133. ${RP_VIDEOXML}
  1134. </vbox>"
  1135. fi
  1136. ####main window####
  1137. ###################
  1138. [ $XPID -ne 0 ] && kill $XPID 2> /dev/null
  1139. BACKTITLEXML=""
  1140. [ "$BACKTITLE" ] && BACKTITLEXML="`/usr/lib/gtkdialog/xml_info fixed "$ICON.svg" 60 "$(gettext "${BACKTITLE}")"`"
  1141. [ "$MYBASE" = "quicksetup" ] && MOUSEXML='
  1142. <button space-expand="false" space-fill="false">
  1143. '"`/usr/lib/gtkdialog/xml_button-icon mouse.svg`"'
  1144. <action>mousecheck nowait</action>
  1145. </button>
  1146. <text xalign="0" use-markup="true" space-expand="true" space-fill="true"><label>"<span color='"'red'"'><b>'$(gettext 'Dead mouse?')'</b></span> '$(gettext '<b>TAB</b> key to select this button then press <b>ENTER</b> key.')'"</label></text>
  1147. '
  1148. WINWIDTH=""
  1149. WINWIDTHPARAM=""
  1150. B_cancel=$(gettext "Cancel")
  1151. export QUICKSETUP_DIALOG='
  1152. <window title="'${WINTITLE}'" window_position="1" icon-name="'${WINICON}'" '${WINWIDTHPARAM}'>
  1153. <vbox space-expand="true" space-fill="true">
  1154. '${BACKTITLEXML}'
  1155. <hbox space-expand="true" space-fill="true">
  1156. '${COUNTRYXML}'
  1157. '${XXML}'
  1158. </hbox>
  1159. '${NETWORK_XML}'
  1160. <hbox space-expand="false" space-fill="false">
  1161. '${MOUSEXML}'
  1162. <text space-expand="true" space-fill="true"><label>""</label></text>
  1163. <button space-expand="false" space-fill="false">
  1164. <label>'$(gettext "Ok")'</label>
  1165. '"`/usr/lib/gtkdialog/xml_button-icon ok`"'
  1166. <action>exit:OK</action>
  1167. </button>
  1168. '"`/usr/lib/gtkdialog/xml_scalegrip`"'
  1169. </hbox>
  1170. </vbox>
  1171. </window>'
  1172. ###display main window###
  1173. wPID=0
  1174. if [ $DISPLAY ];then
  1175. if [ -s /initrd/tmp/RWPART ];then #see init script in initrd, only exists if PUPMODE=5.
  1176. pdFLG=0
  1177. pdDEV="$(cat /initrd/tmp/RWPART | cut -f 1 -d '|')"
  1178. pdFS="$(cat /initrd/tmp/RWPART | cut -f 2 -d '|')"
  1179. pdMNTPT="$(cat /proc/mounts | grep "/dev/${pdDEV} " | cut -f 2 -d ' ')"
  1180. if [ ! "$pdMNTPT" ];then
  1181. mkdir -p /mnt/$pdDEV
  1182. mount -t $pdFS /dev/$pdDEV /mnt/$pdDEV
  1183. pdFLG=1
  1184. pdMNTPT="/mnt/${pdDEV}"
  1185. fi
  1186. [ -f ${pdMNTPT}/pupdesk.flg ] && echo -n "$XDRIVERSUCCESS" > ${pdMNTPT}/pupdesk.flg #init script (in initrd) will read this.
  1187. if [ $pdFLG -eq 1 ];then
  1188. sync
  1189. umount $pdMNTPT
  1190. fi
  1191. fi
  1192. #note: this mechanism of using pupdesk.flg to force run of xorgwizard at next boot, if user unable
  1193. #to click OK button below, is only for PUPMODE=5. When puppy has a save-file, /root/.XLOADED is used
  1194. #to manage forced reboot, see /usr/bin/xwin.
  1195. #note also, there is a totally different file on the "home" partition, fsckme.flg, that forces a
  1196. #f.s. check if a forced reboot/shutdown (such as power failure).
  1197. . /usr/lib/gtkdialog/xml_info gtk #build bg_pixmap for gtk-theme
  1198. RETVALS="`gtkdialog -p QUICKSETUP_DIALOG`"
  1199. eval "$RETVALS"
  1200. [ "$EXIT" != "OK" -a "$EXIT" != "NVIDIA" ] && exit
  1201. #130513 modify...
  1202. if [ -s /initrd/tmp/RWPART ];then #see init script in initrd.
  1203. pdFLG=0
  1204. pdDEV="$(cat /initrd/tmp/RWPART | cut -f 1 -d '|')"
  1205. pdFS="$(cat /initrd/tmp/RWPART | cut -f 2 -d '|')"
  1206. pdMNTPT="$(cat /proc/mounts | grep "/dev/${pdDEV} " | cut -f 2 -d ' ')"
  1207. if [ ! "$pdMNTPT" ];then
  1208. mkdir -p /mnt/$pdDEV
  1209. mount -t $pdFS /dev/$pdDEV /mnt/$pdDEV
  1210. pdFLG=1
  1211. pdMNTPT="/mnt/${pdDEV}"
  1212. fi
  1213. [ -f ${pdMNTPT}/pupdesk.flg ] && rm -f ${pdMNTPT}/pupdesk.flg
  1214. if [ $pdFLG -eq 1 ];then
  1215. sync
  1216. umount $pdMNTPT
  1217. fi
  1218. fi
  1219. #get rid of this, as causes xorgwizard to run at next boot (see /root/.profile)...
  1220. [ -f /root/.xorgwizard-reenter ] && rm -f /root/.xorgwizard-reenter
  1221. /usr/lib/gtkdialog/box_splash -close never -fontsize large -text "$(gettext 'Processing, please wait...')" & #120524
  1222. wPID=$!
  1223. else
  1224. #replace the old single-purpose text-mode scripts...
  1225. case $MYBASE in
  1226. chooselocale)
  1227. CHOICES="`cat /usr/share/i18n/dialog_table_cli | tr '\n' ' '`"
  1228. if [ "$PARAM2" = "quiet" ];then #120215 rc.country calls 'chooselocale cli quiet'
  1229. COMBO_LOCALE=${BASELANG} #LANG already chosen. ex: de_DE (.UTF-8 part is specified by UTF8)
  1230. else
  1231. echo "#!/bin/sh
  1232. dialog --aspect 10 --title \"Country setup\" --menu \"The locale setting provides money, date and font localization for your country. The current choice is ${BASELANG}. Make a choice to suit your country...\" 0 0 0 ${CHOICES} 2>/tmp/chooselocale-choice
  1233. exit \$?" > /tmp/dialog-chooselocale
  1234. chmod 777 /tmp/dialog-chooselocale
  1235. /tmp/dialog-chooselocale
  1236. [ $? -ne 0 ] && exit
  1237. COMBO_LOCALE="`cat /tmp/chooselocale-choice | head -n 1`"
  1238. fi
  1239. CHECK_UTF8="$DEFAULT_UTF8" #dialog box does not have a UTF-8 checkbox.
  1240. ;;
  1241. timezone-set)
  1242. ZONEDLG="dialog --aspect 10 --title \"Puppy timezone selector\" --default-item $DEF_TIMEZONE --menu \"Please choose your timezone. If a city/region/country in your timezone is not listed, choose a GMT<number>\" 0 0 0 ${ZONECHOICES_CLI}"
  1243. eval $ZONEDLG 2>/tmp/zoneretval
  1244. [ $? -ne 0 ] && exit
  1245. COMBO_TIMEZONE="`cat /tmp/zoneretval`"
  1246. CHECK_UTC="$DEFAULT_UTC" #dialog box does not have a UTC checkbox.
  1247. ;;
  1248. *)
  1249. exit
  1250. ;;
  1251. esac
  1252. fi
  1253. ####process choices####
  1254. FLAG_CHANGED=""
  1255. if [ "$EXIT" = "NVIDIA" ];then
  1256. nvidia-settings
  1257. fi
  1258. if [ "$SET_KEYBOARD" ];then
  1259. #two variables COMBO_KEYBOARD and CHECK_NUMLOCK
  1260. NEW_KMAP="`echo -n "$COMBO_KEYBOARD" | cut -f 1 -d ' ' | cut -f 1 -d "$TABCHAR"`"
  1261. FONTMAP=""; CODEPAGE=""
  1262. if [ "$DEF_KMAP" != "$NEW_KMAP" ];then
  1263. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Keyboard Layout'):yes|" #111020 no need to restart X.
  1264. case $NEW_KMAP in #note, same code in /etc/rc.d/rc.country, init, and input-wizard.
  1265. de*|be*|br*|dk*|es*|fi*|fr*|it*|no*|se*|sv*|pt*)
  1266. modprobe nls_cp850
  1267. CODEPAGE="850"
  1268. ;;
  1269. cz*|hu*|pl*|ro*|sk*|croat*|slovene*)
  1270. modprobe nls_cp852
  1271. modprobe nls_iso8859-2
  1272. CODEPAGE="852"
  1273. ;;
  1274. esac
  1275. echo -n "${NEW_KMAP}${KEXT}" > /etc/keymap #120627
  1276. echo -n "$CODEPAGE" > /etc/codepage
  1277. keymap-set --load #111020 script by shinobar.
  1278. #120224 fontmap will be handled in locale code below.
  1279. fi
  1280. if [ "$DEFAULT_NUMLOCK" != "$CHECK_NUMLOCK" ];then
  1281. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Keyboard numlock'):yes|"
  1282. STATUS_NUMLOCK=off
  1283. [ "$CHECK_NUMLOCK" = "true" ] && STATUS_NUMLOCK=on
  1284. echo -e "#!/bin/sh\nnumlockx ${STATUS_NUMLOCK}" > /root/Startup/numlockx
  1285. chmod 755 /root/Startup/numlockx
  1286. numlockx ${STATUS_NUMLOCK} #do it now.
  1287. fi
  1288. fi #end SET_KEYBOARD
  1289. if [ "$SET_LOCALE" ];then
  1290. #two variables, COMBO_LOCALE and CHECK_UTF8
  1291. LANGCHOICE="`echo -n "$COMBO_LOCALE" | cut -f 1 -d ' ' | cut -f 1 -d '@'`" #nl_BE@euro, need to chop.
  1292. UTF8=""
  1293. [ "$CHECK_UTF8" = "true" ] && UTF8='.UTF-8'
  1294. #120215 rc.country calls 'chooselocale cli quiet'
  1295. [ "$PARAM2" = "quiet" ] && CURRLANG=en_US #so as to force below code block to run...
  1296. if [ "$LANGCHOICE" != "" -a "${LANGCHOICE}${UTF8}" != "$CURRLANG" ];then
  1297. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Main Language'):restart|"
  1298. # creates locale files in /usr/lib/locale...
  1299. OLDLANGLINE="LANG=$CURRLANG"
  1300. NEWLANGLINE="LANG=${LANGCHOICE}"
  1301. xUTF8="$UTF8"
  1302. if [ "$UTF8" != "" ];then #111022
  1303. NEWLANGLINE="LANG=${LANGCHOICE}"'.UTF-8'
  1304. xUTF8='.utf8'
  1305. fi
  1306. if [ "`locale -a | grep "${LANGCHOICE}${xUTF8}$"`" = "" ];then #120228 L18L bugfix.
  1307. if [ "$UTF8" = "" ];then
  1308. lcPATTERN='^'"${LANGCHOICE}"' '
  1309. CHARMAP="`grep "$lcPATTERN" /usr/share/i18n/SUPPORTED | head -n 1 | cut -f 2 -d ' '`"
  1310. if [ "$CHARMAP" != "" ];then #make sure have it...
  1311. cPATTERN="$CHARMAP"'\.gz'
  1312. [ "`ls -1 /usr/share/i18n/charmaps | grep '.gz$'`" = "" ] && cPATTERN="$CHARMAP"'$'
  1313. [ "`ls -1 /usr/share/i18n/charmaps | grep "$cPATTERN"`" = "" ] && CHARMAP=""
  1314. fi
  1315. if [ "$CHARMAP" != "" ];then
  1316. localedef -f $CHARMAP -i $LANGCHOICE --no-archive ${LANGCHOICE} > /dev/null
  1317. NEWLANGLINE="LANG=${LANGCHOICE}"
  1318. UTF8="" #120209
  1319. else
  1320. #no match, i think forced to use utf8... 111022 change name back to .utf8...
  1321. localedef -f UTF-8 -i $LANGCHOICE --no-archive ${LANGCHOICE}.utf8 > /dev/null
  1322. NEWLANGLINE="LANG=${LANGCHOICE}.UTF-8"
  1323. UTF8='.UTF-8'
  1324. fi
  1325. else
  1326. localedef -f UTF-8 -i $LANGCHOICE --no-archive ${LANGCHOICE}.utf8 > /dev/null #111022
  1327. NEWLANGLINE="LANG=${LANGCHOICE}.UTF-8"
  1328. fi
  1329. fi
  1330. NEWLANG="`echo -n "$NEWLANGLINE" | cut -f 2 -d '='`" #ex: de_DE.UTF-8
  1331. if [ "$OLDLANGLINE" != "$NEWLANGLINE" ];then
  1332. langPATTERN="s%^LANG=.*%${NEWLANGLINE}%" #111022
  1333. sed -i -e "$langPATTERN" /etc/profile
  1334. #120328 code moved up, to be compatible for chooselocale call from rc.country...
  1335. #120224 load console font... (code based on that in 'init')
  1336. #120301 don't load console font here. seems to get dropped on exit from X. (instead, do it in xwin. now have /sbin/load_consolefont)
  1337. case $NEWLANG in
  1338. en*)
  1339. #er, no, really want to unload all console fonts.
  1340. echo -n "" > /etc/fontmap #well, next boot, no font will be loaded.
  1341. ;;
  1342. ar*|iw*) #L18L no Greek
  1343. echo -n 'LatArCyrHeb-16.psfu' > /etc/fontmap
  1344. ;;
  1345. *) #L18L All European languages; new default ?!
  1346. echo -n 'LatGrkCyr-8x16.psfu' > /etc/fontmap
  1347. ;;
  1348. esac
  1349. fi
  1350. if [ "$PARAM2" = "quiet" ];then #120215 refer to /etc/rc.d/rc.country.
  1351. #scripts fixdesk and fixmenus translate files to new language (as specified in /usr/share/sss/menu_strings and desk_strings).
  1352. #so need to call them here...
  1353. #note, these are also called in /etc/rc.d/rc.update, and further down.
  1354. LANG=${NEWLANG} fixscripts
  1355. LANG=${NEWLANG} fixdesk
  1356. LANG=${NEWLANG} fixmenus
  1357. exit
  1358. fi
  1359. [ "$MYBASE" = "chooselocale" ] && [ "$PARAM1" = "cli" ] && exit #refer rc.country.
  1360. if [ "$OLDLANGLINE" != "$NEWLANGLINE" ];then
  1361. #120213 need language-pack...
  1362. LANG1=${LANGCHOICE%_*} #"`echo -n $LANGCHOICE | cut -f 1 -d '_'`" #ex: de
  1363. LANG12=${LANGCHOICE%.*} #"`echo -n $LANGCHOICE | cut -f 1 -d '.'`" #ex: de_DE
  1364. l1PTN="|langpack_${LANG1}|"
  1365. l12PTN="|langpack_${LANG12}|"
  1366. if [ "$LANG1" != "en" ];then
  1367. LANGFLAG='no'
  1368. [ "`grep "$l12PTN" /root/.packages/woof-installed-packages`" != "" ] && LANGFLAG='yes'
  1369. [ "`grep "$l12PTN" /root/.packages/user-installed-packages`" != "" ] && LANGFLAG='yes'
  1370. [ "`grep "$l1PTN" /root/.packages/woof-installed-packages`" != "" ] && LANGFLAG='yes'
  1371. [ "`grep "$l1PTN" /root/.packages/user-installed-packages`" != "" ] && LANGFLAG='yes'
  1372. if [ "$LANGFLAG" = "no" ];then
  1373. #check if a langpack available...
  1374. case $NEWLANG in #120313 hardcode translations... 120315
  1375. fr*) #French, esmourguit
  1376. AVAILMSG1="Il y a un paquet \Zb${AVAILPACK}\ZB dans le répertoire \Zbnoarch\ZB, catégorie \ZbSetup\ZB. Après être connecté à Internet, cliquer sur l'icône du bureau \Zbinstall\ZB pour lancer le Gestionnaire des Paquets, puis choisir le répertoire et la catégorie.
  1377. Remarque: Avant de télécharger le paquet, vous devrez établir une connexion Internet et utiliser le Gestionnaire des Paquets en anglais. Si vous ne comprenez pas l'anglais, l'alternative consiste à lancer avec un autre système d'exploitation, d'aller sur le site http://distro.ibiblio.org/quirky/pet_packages-noarch et télécharger le Langpack. Redémarrez Puppy, cliquez sur l'icône des partitions du bureau pour monter la partition (où est téléchargé le Langpack) et cliquez sur le fichier pour l'installer."
  1378. AVAILMSG2="Les Langpacks officiels sont disponibles dans \Zbnoarch\ZB, mais il n'y en a pas pour votre langue. Peut-être y en a-t'il un en développement dans le forum (attention, certaines anciennes versions de Puppy possèdent des Langpacks incompatibles). Peut-être voulez-vous aider et/ou créer un Langpack - cliquez sur le menu -> Aide -> HOWTO internationalisation (vous devrez connaitre bien l'anglais)."
  1379. AVAILTITLE="Langpack nécessaire"
  1380. AVAILMSG3="La locale sera changée en ${LANGCHOICE}, mais vous devez installer un Langpack pour avoir Puppy dans votre langue. Vous avez besoin du paquet \Zblangpack_${LANG12}\ZB ou \Zblangpack_${LANG1}\ZB. Ce n'est pas encore automatisé, vous devrez donc télécharger et installer le paquet vous même. Vous pourrez le faire à n'importe quel moment plus tard. Les Langpacks bénéficiant d'un soutien officiel sont disponibles dans le Gestionnaire des Paquets (cliquez sur l'icône du bureau \Zbinstall\ZB ), et dans le répertoire \Zbnoarch\ZB."
  1381. ;;
  1382. de*) #German, L18L
  1383. AVAILMSG1="Es gibt ein passendes Sprachpaket \Zb${AVAILPACK}\ZB in der Kategorie \ZbSetup\ZB des PET-Repositoriums \Zbnoarch\ZB. Bei vorhandener Internetverbindung ein Klick auf das Symbol \Zbinstall\ZB auf dem Desktop und dann ein Klick auf Puppy Package Manager startet diesen. Im Paketmanager dann Kategorie Setup und Repo: puppy-noarch wählen.
  1384. Hinweis: Vor dem Herunterladen des Sprachpakets muß eine Internetverbindung hergestellt sein und der Puppy-Paket-Manager auf Englisch benutzt werden. Falls man glaubt, dies nicht auf Englisch hinzukriegen, kann man alternativ mit einem anderen Betriebssystem das langpack, Sprachpaket, herunterladen von http://distro.ibiblio.org/quirky/pet_packages-noarch. Dann Puppy hochfahren, ein Klick auf das Partitions-Symbol auf dem Desktop hängt die Partition ein, auf die das Sprachpaket heruntergeladen wurde und ein Klick auf das Sprachpaket-PET installiert es dann."
  1385. AVAILMSG2="Offizielle langpacks, Sprachpakete, sind im Repositorium \Zbnoarch\ZB vefügbar, jedoch keines für deutsch. Vielleicht ist eines in Entwicklung im Puppy Forum (aber Achtung: einige ältere Puppy-Versionen haben inkompatible langpacks, Sprachpakete.). Oder \"Do It Yourself\": klick Menü -> Hilfe -> HOWTO Internationalization (you will of course need a good knowledge of English; und deshalb bleibt dieser Satz unübersetzt)."
  1386. AVAILTITLE="Sprachpaket erforderlich"
  1387. AVAILMSG3="Die locale wird geändert in ${LANGCHOICE}, aber es muß ein Sprachpaket installiert werden, um Puppy auf deutsch laufen zu lassen. Ein PET-Paket namens \Zblangpack_${LANG12}\ZB oder \Zblangpack_${LANG1}\ZB wird gebraucht. Wir habe dies noch nicht automatisiert, sodaß man das Paket noch selbst herunterladen und installieren muß, das ist auch irgendwann in der Zukunft noch möglich. Offiziell unterstützte langpacks, Sprachpakete, sind im Puppy Package Manager (Klick auf das Symbol \Zbinstall\ZB auf dem Desktop), im Repo: \Zbpuppy-noarch\ZB zu finden."
  1388. ;;
  1389. es*) #Spanish, vicmz
  1390. AVAILMSG1="Hay un paquete \Zb${AVAILPACK}\ZB apropiado en el respositorio de PETs \Zbnoarch\ZB, en la categoría \ZbConfiguración\ZB. Después de tener una conexión a Internet, pulse el ícono \Zbinstalar\ZB del escritorio para abrir el Administrador de Paquetes, luego elija el repositorio y la categoría.
  1391. Nota: Antes de descargar el paquete de idioma, tendrá que hacer una conexión a Internet y usar el Administrador de Paquetes (Puppy Package Manager) en inglés. Si piensa que no sabe leer inglés lo suficiente, una alternativa es usar otro sistema operativo, ir a http://distro.ibiblio.org/quirky/pet_packages-noarch y descargar el paquete de idioma. Entonces, inicie Puppy, haga clic en el ícono de partición (donde descargó el paquete de idioma), y haga clic en el PET de paquete de idioma para instalarlo."
  1392. AVAILMSG2="Hay paquetes de idioma oficiales disponibles en el repositorio \Zbnoarch\ZB, sin embargo no hay uno para su idioma. Tal vez haya uno en desarrollo en el Foro de Puppy (cuidado, algunas versiones más antiguas de Puppy tienen paquetes incompatibles). Ó, tal vez usted pueda ofrecerse como voluntario para ayudar y crear un paquete de idioma (haga clic en Menu -> Help -> HOWTO Internationalization, por supuesto usted necesitará un buen conocimiento de inglés)."
  1393. AVAILTITLE="Se necesita un paquete de idioma"
  1394. AVAILMSG3="El idioma se cambiará a ${LANGCHOICE}, pero usted necesita instalar un paquete de idioma para traducir Puppy a su lengua. Usted necesita un paquete PET llamado \Zblangpack_${LANG12}\ZB o \Zblangpack_${LANG1}\ZB. No hemos automatizado esto aún, así que tendrá que descargar e instalar el paquete. Puede hacer esto en cualquier momento en el futuro. Hay paquetes de idioma con soporte oficial disponibles usando el Administrador de Paquetes (Puppy Package Manager) (haga clic en el ícono \Zbinstalar\ZB del escritorio), en el repositorio \Zbnoarch\ZB. "
  1395. ;;
  1396. it*) #Italian, vicmz
  1397. AVAILMSG1="C'è un pacchetto \Zb${AVAILPACK}\ZB idoneo nel repository di PET \Zbnoarch\ZB, nella categoria \ZbImpostazioni\ZB. Una volta ottenuto una connessione a Internet, fare clic sull'icona \Zbinstallare\ZB sul desktop per eseguire l'Amministratore di Pacchetti, quindi scegli il repository e la categoria.
  1398. Nota: Prima di scaricare il pacchetto di lingua, si dovrà effettuare una connessione a Internet e utilizzare l'Amministratore di Pacchetti (Puppy Package Manager) in lingua inglese. Se pensi che non puoi leggere l'inglese a sufficienza, un'alternativa è quella di eseguire un altro sistema operativo, andare a http://distro.ibiblio.org/quirky/pet_packages-noarch e scaricare il pacchetto di lingua. Poi, avvia Puppy, clicca sull'icona di partizione sul desktop per montare la partizione (dove ai scaricato il pacchetto di lingua), quindi clicca sul PET del pacchetto di lingua per installarlo."
  1399. AVAILMSG2="Pacchetti di lingua ufficiali sono disponibili nel repository \Zbnoarch\ZB, ma non ce n'è uno per tua lingua. Forse ce n'è uno in fase di sviluppo nel Forum Puppy (attenzione, alcune vecchie versioni di Puppy hanno pacchetti di lingua incompatibili). O, forse potrebbe volontari per aiutare e creare un pacchetto di lingua -- fare clic sul Menu -> Help -> HOWTO Internationalization (ovviamente hai bisogno di una buona conoscenza della lingua inglese)."
  1400. AVAILTITLE="È necessario un pacchetto di lingua"
  1401. AVAILMSG3="La lingua sarà cambiata in ${LANGCHOICE}, però hai bisogno d'installare un pacchetto di lingua per tradurre Puppy nella tua lingua. Hai bisogno di un pacchetto PET chiamato \Zblangpack_${LANG12}\ZB o \Zblangpack_${LANG1}\ZB. Non abbiamo ancora automatizzato questa azione, quindi dovrete scaricare e installare il pacchetto. Puoi fare ne in qualsiasi momento in futuro. Pacchetti di lingua ufficialmente supportati sono disponibili eseguendo l'Amministratori di Pacchetti (Puppy Package Manager) (clicca l'icona \Zbinstallare\ZB sul desktop), nel repository \Zbnoarch\ZB."
  1402. ;;
  1403. nl*) #Netherlands (Dutch), FlyingDutchman 120701 fix...
  1404. AVAILMSG1="Er is een geschikt \Zb${AVAILPACK}\ZB pakket in de \Zbnoarch\ZB PET repository, in de \ZbSetup\ZB categorie. Klik op het \Zbinstall\ZB pictogram op het bureaublad om de Puppy Package Manager te starten en kies vervolgens de repository en categorie.
  1405. Opmerking: Voor het downloaden van het taalpakket is een werkende internetverbinding nodig. Tevens moet de Puppy Package Manager in het Engels worden gebruikt. Als u Engels hiervoor onvoldoende beheerst is het ook mogelijk om vanuit een ander besturingssysteem naar http://distro.ibiblio.org/quirky/pet_packages-noarch te gaan en het taalpakket (langpack_nl) te downloaden. Start daarna Puppy op, klik op het pictogram van de partitie waarop het taalpakket is opgeslagen en klik vervolgens op de taalpakket PET om het te installeren."
  1406. AVAILMSG2="Er zijn officiële taalpakketten beschikbaar in de \Zbnoarch\ZB repository maar helaas is er geen taalpakket gevonden voor uw taal. Wellicht wordt er aan een vertaling gewerkt in het Puppy Forum (pas op, sommige oudere Puppy versies gebruiken taalpakketten die niet uitwisselbaar zijn). Of misschien wilt u helpen bij het creëren van een taalpakket -- Klik Menu -> Help -> HOWTO Internationalization (U hebt hiervoor uiteraard een goede kennis van het Engels voor nodig)."
  1407. AVAILTITLE="Taalpakket nodig"
  1408. AVAILMSG3="De standaard taal wordt gewijzigd naar ${LANGCHOICE}, maar u moet een taalpakket installeren om Puppy in uw taal te vertalen. U hebt daarvoor een PET pakket nodig met de naam \Zblangpack_${LANG12}\ZB of \Zblangpack_${LANG1}\ZB. We hebben dit nog niet geautomatiseerd dus u zult dit zelf moeten downloaden en installeren. U kunt dit op elk gewenst moment doen. Officeel ondersteunde taalpakketten zijn beschikbaar door het de Puppy Package Manager te starten (klik op het \Zbinstall\ZB pictogram op het bureaublad), in de \Zbnoarch\ZB repository."
  1409. ;;
  1410. pl*) #120331 Polish, robwoj44 (Robert)
  1411. AVAILMSG1="Jest odpowiedni pakiet \Zb${AVAILPACK}\ZB w repozytorium \Zbnoarch\ZB PET, w kategorii \ZbSetup\ZB. Po uzyskaniu połączenia z Internetem, kliknij ikonę \Zbinstall\ZB na pulpicie by uruchomić Puppy Package Manager, potem wybierz repozytorium i kategorię.
  1412. Uwaga: Przed pobraniem pakietu językowego, trzeba mieć połączenie z Internetem i użyć Puppy Manager Pakietów po angielsku. Jeśli myślisz że nie zrozumiesz po angielsku dostatecznie, alternatywą jest uruchomienie innego systemu operacyjnego, wejście na http://distro.ibiblio.org/quirky/pet_packages-noarch i pobranie pakietu językowego. Następnie, rozruch Puppy, kliknięcie ikony partycji na pulpicie by zamontować partycję (tą gdzie ściągnąłeś pakiet językowy), potem kliknięcie na pakiecie językowym PET by go zainstalować."
  1413. AVAILMSG2="Oficjalne pakiety językowe są dostępne w repozytorium \Zbnoarch\ZB, jednak gdy nie ma dla twojego języka. Możliwe że jest jakiś w przygotowaniu na Forum Puppy (uważaj, niektóre starsze wersje Puppy mają niekompatybilne pakiety językowe). Albo, możesz dobrowolnie pomóc i stworzyć pakiet językowy -- kliknij Menu -> Help -> HOWTO Internationalization (oczywiście będziesz potrzebował dobrej znajomości angielskiego)."
  1414. AVAILTITLE="Pakiet językowy potrzebny"
  1415. AVAILMSG3="Ustawienia regionalne będą zmienione na ${LANGCHOICE}, ale musisz zainstalować pakiet językowy by przetłumaczyć Puppy na swój język. Potrzebujesz pakietu PET nazwanego \Zblangpack_${LANG12}\ZB lub \Zblangpack_${LANG1}\ZB. Jeszcze nie zautomatyzowaliśmy tego, zatem musisz pobrać i zainstalować pakiet. Możesz to zrobić w każdym czasie w przyszłości. Oficjalnie obsługiwane pakiety językowe są dostępne przez uruchomienie Puppy Package Manager (kliknij ikonę \Zbinstall\ZB na pulpicie), w repozytorium \Zbnoarch\ZB."
  1416. ;;
  1417. pt*) #Portuguese, vicmz
  1418. AVAILMSG1="Há um pacote \Zb${AVAILPACK}\ZB apropriado no respositório de PETs \Zbnoarch\ZB, na categoria \ZbConfiguração\ZB. Após ter uma conexão a Internet, clique o ícone \Zbinstalar\ZB da Área de Trabalho para abrir o Administrador de Pacotes, então escolha o repositório e a categoria.
  1419. Nota: Antes de transferir o pacote de língua, você terá que fazer uma conexão a Internet e usar o Administrador de Pacotes (Puppy Package Manager) em inglês. Se pensar que não sabe ler inglês o bastante, uma alternativa é usar outro sistema operativo, ir para http://distro.ibiblio.org/quirky/pet_packages-noarch e descarregar o pacote de língua. Então, inicie Puppy, clique no ícone de partição (onde descarregou o pacote de língua), e clique no PET do pacote de língua para instalá-lo."
  1420. AVAILMSG2="Há pacotes de língua oficiais disponíveis no repositório \Zbnoarch\ZB, porém não há um para sua língua. Talvez há um em desenvolvimento no Fórum de Puppy (atenção, algumas versões mais antigas de Puppy têm pacotes incompatíveis). Ou, talvez você possa se oferecer como voluntário para ajudar e criar um pacote de língua (clique no Menu -> Help -> HOWTO Internationalization, certamente você precisará um bom conhecimento de inglês)."
  1421. AVAILTITLE="Precisa-se de um pacote de língua"
  1422. AVAILMSG3="A língua será mudada para ${LANGCHOICE}, mas você precisa instalar um pacote de língua para traduzir Puppy em sua língua. Você precisa um pacote PET chamado de \Zblangpack_${LANG12}\ZB ou \Zblangpack_${LANG1}\ZB. Nós não temos automatizado isto ainda, asim que você terá que descarregar e instalar o pacote. Você pode fazer isto em qualquer momento no futuro. Há pacotes com suporte oficial disponíveis usando o Administrador de Pacotes (Puppy Package Manager) (clique no ícone \Zbinstalar\ZB na Área de Trabalho), no repositório \Zbnoarch\ZB. "
  1423. ;;
  1424. ru*) #Russian, rodin.s
  1425. AVAILMSG1="Есть подходящий пакет \\Zb${AVAILPACK}\\ZB в \\Zbnoarch\\ZB PET-репозитарии, в категории \\ZbSetup\\ZB. После того, как у вас появится подключение к Интернет нажмите значок \\Zbinstall\\ZB на рабочем столе для запуска Менеджера пакетов Puppy, затем выберите репозитарий и категорию.
  1426. Примечание: Перед загрузкой пакета локализации вы должны будете настроить подключение к Интернет и использовать Менеджер пакетов Puppy на английском. Если вы думаете, что не знаете английский достаточно хорошо, альтернатива - это запуск другой операционной системы, зайдете на http://distro.ibiblio.org/quirky/pet_packages-noarch и загрузите пакет локализации. После этого загрузите Puppy, нажмите на значок раздела на рабочем столе для монтирования раздела (на который вы загрузили пакет локализации), затем кликните на сам PET-пакет лангпака для его установки."
  1427. AVAILMSG2="Официальные пакеты локализации доступны в \\Zbnoarch\\ZB-репозитарии, однако для вашего языка нет пакета. Возможно пакет для вашего языка в разработке на форуме Puppy (будте осторожны, пакеты для старых версий Puppy не подходят). Или, возможно, вы захотите помочь и создать пакет -- Кликните Меню -> Справка -> HOWTO Internationalization (конечно же вам будет нужно хорошее знание английского языка)."
  1428. AVAILTITLE="Нужен пакет локализации"
  1429. AVAILMSG3="Локаль будет изменена на ${LANGCHOICE}, но вам нужно установить языковой пакет для перевода Puppy на ваш язык. Вам нужен PET-пакет с названием \\Zblangpack_${LANG12}\\ZB или \\Zblangpack_${LANG1}\\ZB. Этот процесс ещё не автоматизирован, так, что вам нужно загрузить и установить пакет. Вы можете сделать это в любое время в будущем. Официально поддерживаемые пакеты локализации доступны в Менеджере пакетов Puppy (кликните значок \\Zbinstall\\ZB на рабочем столе), в репозитарии \\Zbnoarch\\ZB."
  1430. ;;
  1431. es*) #Spanish,
  1432. AVAILMSG1="Hay un paquete \\Zb${AVAILPACK}\\ZB apropiado en el repositorio de PETs \\Zbnoarch\\ZB, en la categoría \\ZbConfiguración\\ZB. Después de tener una conexión a Internet, pulse el ícono \\Zbinstalar\\ZB del escritorio para abrir el Administrador de Paquetes, luego elija el repositorio y la categoría.
  1433. Nota: Antes de descargar el paquete de idioma, tendrá que hacer una conexión a Internet y usar el Administrador de Paquetes (Package Manager) en inglés. Si piensa que no sabe leer inglés lo suficiente, una alternativa es usar otro sistema operativo, ir a http://distro.ibiblio.org/quirky/pet_packages-noarch y descargar el paquete de idioma. Entonces, inicie Puppy, haga clic en el ícono de partición (donde descargó el paquete de idioma), y haga clic en el PET de paquete de idioma para instalarlo."
  1434. AVAILMSG2="Hay paquetes de idioma oficiales disponibles en el repositorio \\Zbnoarch\\ZB, sin embargo no hay uno para su idioma. Tal vez haya uno en desarrollo en el Foro de Puppy (cuidado, algunas versiones más antiguas de Puppy tienen paquetes incompatibles). Ó, tal vez usted pueda ofrecerse como voluntario para ayudar y crear un paquete de idioma (haga clic en Menú -> Ayuda -> CÓMO Internacionalizar, por supuesto usted necesitará un buen conocimiento de inglés)."
  1435. AVAILTITLE="Se necesita un paquete de idioma"
  1436. AVAILMSG3="El idioma se cambiará a ${LANGCHOICE}, pero usted necesita instalar un paquete de idioma para traducir Puppy a su lengua. Usted necesita un paquete PET llamado \\Zblangpack_${LANG12}\\ZB o \\Zblangpack_${LANG1}\\ZB. No hemos automatizado esto aún, así que tendrá que descargar e instalar el paquete. Puede hacer esto en cualquier momento en el futuro. Hay paquetes de idioma con soporte oficial disponibles usando el Administrador de Paquetes (haga clic en el ícono \\Zbinstalar\\ZB del escritorio), en el repositorio \\Zbnoarch\\ZB."
  1437. ;;
  1438. *)
  1439. AVAILMSG1="There is a suitable \Zb${AVAILPACK}\ZB package in the \Zbnoarch\ZB PET repository, in the \ZbSetup\ZB category. After you have an Internet connection, click the \Zbinstall\ZB icon on the desktop to run the Puppy Package Manager, then choose the repository and category.
  1440. Note: Before downloading the langpack, you will have to make an Internet connection and use the Puppy Package Manager in English. If you think that you cannot read English sufficiently, an alternative is to run another operating system, go to http://distro.ibiblio.org/quirky/pet_packages-noarch and download the langpack. Then, boot Puppy, click the partition icon on the desktop to mount the partition (where you downloaded the langpack to), then click on the langpack PET to install it."
  1441. AVAILMSG2="Official langpacks are available in the \Zbnoarch\ZB repository, however there is not one for your language. Perhaps there is one under development in the Puppy Forum (be careful, some older versions of Puppy have incompatible langpacks). Or, perhaps you might volunteer to help out and create a langpack -- click the Menu -> Help -> HOWTO Internationalization (you will of course need a good knowledge of English)."
  1442. AVAILTITLE="Language pack needed"
  1443. AVAILMSG3="The locale will be changed to ${LANGCHOICE}, but you need to install a language pack to translate Puppy to your language. You need a PET package named \Zblangpack_${LANG12}\ZB or \Zblangpack_${LANG1}\ZB. We have not yet automated this, so you will have to download and install the package. You may do this any time in the future. Officially supported langpacks are available by running the Puppy Package Manager (click the \Zbinstall\ZB icon on the desktop), in the \Zbnoarch\ZB repository."
  1444. ;;
  1445. esac
  1446. AVAILPACK=''
  1447. AVAILMSG="$AVAILMSG2"
  1448. [ "`grep "$l12PTN" /root/.packages/Packages-puppy-noarch-official`" != "" ] && AVAILPACK="langpack_${LANG12}"
  1449. [ "`grep "$l1PTN" /root/.packages/Packages-puppy-noarch-official`" != "" ] && AVAILPACK="langpack_${LANG1}"
  1450. [ "$AVAILPACK" ] && AVAILMSG="$AVAILMSG1"
  1451. if [ "$DISPLAY" ];then
  1452. [ $wPID -ne 0 ] && kill $wPID #120524
  1453. wPID=0
  1454. LANG=${NEWLANG} pupdialog --background '#8080FF' --colors --backtitle "${AVAILTITLE}" --msgbox "${AVAILMSG3}\n\n${AVAILMSG}" 0 0
  1455. else
  1456. dialog --msgbox "`eval_gettext \"Note, you will need to install langpack_\\\${LANG12} or langpack_\\\${LANG1} PET package to more fully translate Puppy to your language. Run the Puppy Package Manager after connection to the Internet, to download and install this package.\"`" 0 0 >/dev/console
  1457. fi
  1458. fi
  1459. fi
  1460. #120215 offer to translate initrd... 120216 moved to separate script (so universal installer can also do it)...
  1461. GIVEITAGO='yes'
  1462. NEWLANG1=${NEWLANG%_*} #ex: en
  1463. #120401 change logic to call lang2initrd...
  1464. PLANG1=""
  1465. [ "PLANG" ] && PLANG1="${PLANG%_*}" #defined in PUPSTATE by initrd.
  1466. [ "$NEWLANG1" = "en" ] && GIVEITAGO='no'
  1467. if [ -f /var/local/lang2initrd.log ];then #read log from /usr/sbin/lang2initrd
  1468. [ "`grep "^DECLINED ${DISTRO_IDSTRING}" /var/local/lang2initrd.log`" != "" ] && GIVEITAGO='no'
  1469. [ "`grep "^SUCCESS ${DISTRO_IDSTRING}" /var/local/lang2initrd.log`" != "" ] && GIVEITAGO='no'
  1470. fi
  1471. if [ "$PLANG1" ];then #120401
  1472. [ "$PLANG" != "$NEWLANG" ] && GIVEITAGO='yes' #catch case of user only changing UTF-8 checkbox.
  1473. if [ "$PLANG1" != "$NEWLANG1" ];then
  1474. GIVEITAGO='yes'
  1475. [ "$NEWLANG1" != "en" ] && echo -n "" > /var/local/lang2initrd.log #so wmpoweroff/wmreboot can run lang2initrd after langpack installed.
  1476. fi
  1477. fi
  1478. [ "$GIVEITAGO" = "yes" ] && /usr/sbin/lang2initrd $NEWLANG #note, script has more tests, then asks if want translate initrd.
  1479. #120209 scripts fixdesk and fixmenus translate files to new language (as specified in /usr/share/sss/menu_strings and desk_strings).
  1480. #so need to call them here...
  1481. #note, these are also called in /etc/rc.d/rc.update ...
  1482. LANG=${LANGCHOICE}${UTF8} fixscripts
  1483. LANG=${LANGCHOICE}${UTF8} fixdesk
  1484. LANG=${LANGCHOICE}${UTF8} fixmenus
  1485. #...no need to refresh screen, as changing locale requires restart of X.
  1486. fi
  1487. fi
  1488. fi #end SET_LOCALE
  1489. if [ "$SET_TIMEZONE" ];then
  1490. #two variables, COMBO_TIMEZONE and CHECK_UTC
  1491. ZONERETVAL="`echo -n "$COMBO_TIMEZONE" | cut -f 1 -d ' ' | cut -f 1 -d "$TABCHAR"`"
  1492. NEW_HWCLOCKTIME="localtime"
  1493. [ "$CHECK_UTC" = "true" ] && NEW_HWCLOCKTIME="utc"
  1494. [ ! -e /etc/localtime ] && DEF_TIMEZONE="" #111027 precaution.
  1495. if [ "$DEF_TIMEZONE" != "$ZONERETVAL" -o "$HWCLOCKTIME" != "$NEW_HWCLOCKTIME" ];then
  1496. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Time Zone'):yes|"
  1497. [ "`echo "$ZONERETVAL" | grep 'GMT'`" != "" ] && ZONERETVAL="Etc/$ZONERETVAL"
  1498. #111103 these are also in Etc dir...
  1499. [ "$ZONERETVAL" = "Greenwich" ] && ZONERETVAL="Etc/$ZONERETVAL"
  1500. [ "$ZONERETVAL" = "UCT" ] && ZONERETVAL="Etc/$ZONERETVAL"
  1501. [ "$ZONERETVAL" = "Universal" ] && ZONERETVAL="Etc/$ZONERETVAL"
  1502. [ "$ZONERETVAL" = "UTC" ] && ZONERETVAL="Etc/$ZONERETVAL"
  1503. [ "$ZONERETVAL" = "Zulu" ] && ZONERETVAL="Etc/$ZONERETVAL"
  1504. ln -snf /usr/share/zoneinfo/$ZONERETVAL /etc/localtime
  1505. which xset &>/dev/null && xset s noblank s noexpose -dpms #shinobar 30jan11: avoid the screen go to blank
  1506. [ -f /etc/TZ ] && rm -f /etc/TZ #don't think need this anymore. also removed from /etc/profile.
  1507. #.../etc/profile now reads /etc/localtime and exports TZ variable.
  1508. #need to set Linux system time/date, from hardware clock...
  1509. hwclock --hctosys --${NEW_HWCLOCKTIME} #NEW_HWCLOCKTIME=localtime or utc
  1510. [ $? = 0 ] || hwclock --hctosys --${NEW_HWCLOCKTIME} --directisa #try --directisa if reading from /dev/rtc fails
  1511. #...--hctosys reads cmos clock to system, referencing /usr/share/zoneinfo/localtime
  1512. echo "#this is read/written by /usr/sbin/quicksetup, timezone-set
  1513. HWCLOCKTIME=${NEW_HWCLOCKTIME}" > /etc/clock
  1514. fi
  1515. fi #end SET_TIMEZONE
  1516. if [ "$SET_XRES" ];then
  1517. #one variable COMBO_XYRES
  1518. #note, similar code in xrandshell.
  1519. NEW_XYRES="$(echo -n "$COMBO_XYRES" | tr '\t' ' ' | cut -f 1 -d ' ')" #130202
  1520. NEW_VFREQ="$(echo -n "$COMBO_XYRES" | tr '\t' ' ' | tr -s ' ' | cut -f 2 -d ' ' | cut -f 1 -d '*')" #130202
  1521. if [ "$DEF_XYRES$DEF_VFREQ" != "$NEW_XYRES$NEW_VFREQ" ];then
  1522. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Xrandr Screen Resolution'):yes|"
  1523. T_yesno="`gettext 'Change resolution to:'`"
  1524. M_yesno1="`gettext 'Click the OK button to change the resolution.'`"
  1525. M_yesno2="`gettext 'If the new resolution does not work, wait 60 seconds, or hit the CTRL-ALT-BACKSPACE key combination to kill X.'`"
  1526. M_yesno3="$(gettext 'Note, the drive icons may be in wrong place after resolution change, but will be correct after X is restarted.')" #120226
  1527. [ $wPID -ne 0 ] && kill $wPID #120524
  1528. wPID=0
  1529. pupdialog --background yellow --backtitle "${T_yesno} ${NEW_XYRES}@${NEW_VFREQ}" --yes-label "$B_ok" --no-label "$B_cancel" --yesno "${M_yesno1}\n${M_yesno2}\n${M_yesno3}" 0 0 #130202
  1530. if [ $? -eq 0 ];then
  1531. echo "ICONWIPE" > /var/local/pup_event_icon_change_flag #120226 .xinitrc -> clean_desk_icons will read this, and redraw drive icons.
  1532. sync
  1533. xrandr -s $NEW_XYRES -r $NEW_VFREQ 2>/tmp/xrandr_error #this changes the screen resolution. #130202 add freq.
  1534. if [ "$?" -ne "0" ];then
  1535. # try without frequency
  1536. xrandr -s $NEW_XYRES 2>/dev/null
  1537. bFLG=1 #flag so correct entry entered to /etc/xrandrindex
  1538. if [ "$?" -ne "0" ];then
  1539. BMSG=`cat /tmp/xrandr_error`
  1540. /usr/lib/gtkdialog/box_splash -bg red -close box -timeout 5 -text "$BMSG" & #put out the old error, maybe it will work anyway, does here
  1541. rm /tmp/xrandr_error
  1542. unset bFLG
  1543. exit
  1544. fi
  1545. fi
  1546. sleep 1
  1547. XRANDR="`xrandr -q`"
  1548. TESTLINE="$(echo "$XRANDR" | tr -s " " | grep "^ [0-9]" | grep '\*' | head -n 1)" #130202 'head -n 1' workaround for dual monitors (see also .xinitrc).
  1549. TESTX="`echo -n "$TESTLINE" | cut -f 2 -d " " | cut -f 1 -d 'x'`"
  1550. TESTY="`echo -n "$TESTLINE" | cut -f 2 -d " " | cut -f 2 -d 'x'`"
  1551. TESTVR="`echo -n "$TESTLINE" |tr ' ' '\n' | grep "\*" | cut -f 1 -d '*'`"
  1552. M_y0=$(gettext 'Can you see this?')
  1553. M_y1=$(gettext "Click <b>Permanent</b> button to keep this resolution permanently.
  1554. Click <b>Session</b> button to keep this resolution for current session only.
  1555. Click <b>Cancel</b> button to revert to default resolution.")
  1556. M_y2=$(gettext "<b>Warning</b>
  1557. It is NOT recommended to choose <b>Permanent</b> here, as the default resolution is not really changed, instead it switches resolutions after X has started, which causes a delay and flicker at startup and may have other undesirable side-effects. Instead, run the Video Wizard to choose a permanent resolution.")
  1558. B_permanent=$(gettext 'Permanent')
  1559. B_session=$(gettext 'Session')
  1560. STEP=6 # timeout is x10sec
  1561. fontsize="x-large" # small, medium, large, x-large 130203 fix insertion of fontsize...
  1562. export XY_DIALOG="<window title=\"$WINTITLE\" icon-name=\"gtk-preferences\"><vbox>
  1563. <text use-markup=\"true\"><label>\"<span size='${fontsize}'>${M_y0}</span>\"</label></text>
  1564. <text use-markup=\"true\"><label>\"${M_y1}\"</label></text>
  1565. <text use-markup=\"true\"><label>\"${M_y2}\"</label></text>
  1566. <progressbar><input>for i in \$(seq 0 10 100); do echo \$i; sleep $STEP; done;echo 100</input>
  1567. <label>$(gettext 'Or, it will be canceled in 60 seconds.')</label>
  1568. <action type=\"exit\">TIMEOUT</action></progressbar>
  1569. <hbox>
  1570. <button><label>${B_permanent}</label><action>EXIT:permanent</action></button>
  1571. <button><label>${B_session}</label><action>EXIT:session</action></button>
  1572. <button><label>${B_cancel}</label><action>EXIT:cancel</action></button>
  1573. </hbox>
  1574. </vbox></window>"
  1575. eval $(gtkdialog -p XY_DIALOG --center)
  1576. case $EXIT in
  1577. permanent)
  1578. case $bFLG in
  1579. 1)echo -n "${TESTX}x${TESTY}" > /etc/xrandrindex ;;
  1580. *)echo -n "${TESTX}x${TESTY}@${TESTVR}" > /etc/xrandrindex ;; #so will be set in .xinitrc at next X start. #130202 added freq.
  1581. esac
  1582. ;;
  1583. session)
  1584. rm -f /etc/xrandrindex
  1585. ;;
  1586. *)
  1587. rm -f /etc/xrandrindex
  1588. xrandr -s $DEF_XYRES -r $DEF_VFREQ #restore to what it was before. #130202 added freq.
  1589. ;;
  1590. esac
  1591. fi
  1592. fi
  1593. fi #end SET_XRES
  1594. if [ "$SET_XWIZARD" ];then
  1595. if [ "$CHECK_XUPGRADE" = "true" ];then
  1596. #FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Video Upgrade Wizard'):yes|" #"Video Upgrade Wizard"
  1597. /usr/sbin/video_upgrade_wizard
  1598. fi
  1599. if [ "$CHECK_XORGWIZARD" = "true" ];then
  1600. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Xorg Video Wizard'):restart|" #"Xorg Video Wizard"
  1601. sed -i -e "s%^DISTRO_XORG_AUTO.*%DISTRO_XORG_AUTO='no'%" /etc/DISTRO_SPECS #/usr/bin/xwin reads this when X starts.
  1602. mv -f /etc/X11/xorg.conf /etc/X11/xorg.conf.prev 2>/dev/null #/usr/bin/xwin will then run xorgwizard.
  1603. echo "ICONWIPE" > /var/local/pup_event_icon_change_flag #120226 .xinitrc -> clean_desk_icons will read this, and redraw drive icons. ...actually, redundant, as xorgwizard does this.
  1604. fi
  1605. fi #end SET_XWIZARD
  1606. if [ "$SET_NETWORK" ];then #120227
  1607. #120625 set new hostname...
  1608. OLD_HOSTNAME="$HOSTNAME"
  1609. if [ "$OLD_HOSTNAME" != "$ENTRY_HOSTNAME" ];then
  1610. /usr/sbin/hostname-set $ENTRY_HOSTNAME
  1611. HOSTNAMEFLAG=$?
  1612. [ "$HOSTNAMEFLAG" = "0" ] && FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Hostname'):restart|"
  1613. [ "$HOSTNAMEFLAG" = "2" ] && FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Hostname'):yes|" #130511 see hostname-set.
  1614. fi
  1615. #120625...
  1616. if [ "$CHECK_FIREWALL" != "$DEFAULT_FIREWALL" ];then
  1617. if [ "$CHECK_FIREWALL" = "false" ];then
  1618. /etc/rc.d/rc.firewall stop 2>/dev/null
  1619. /etc/init.d/rc.firewall stop 2>/dev/null
  1620. chmod 664 /etc/rc.d/rc.firewall 2>/dev/null #so that /etc/rc.d/rc.local won't start it.
  1621. chmod 664 /etc/init.d/rc.firewall 2>/dev/null #ugh
  1622. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Firewall disabled'):yes|"
  1623. else
  1624. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Firewall enabled'):yes|"
  1625. if [ -f /etc/rc.d/rc.firewall ];then
  1626. chmod 755 /etc/rc.d/rc.firewall #so that /etc/rc.d/rc.local will start firewall at bootup.
  1627. /etc/rc.d/rc.firewall start
  1628. elif [ -f /etc/init.d/rc.firewall ];then
  1629. chmod 755 /etc/init.d/rc.firewall #ugh
  1630. /etc/init.d/rc.firewall start
  1631. else
  1632. [ $(which firewallinstallshell) ] && rxvt -bg LightYellow -title "Firewall setup" -e firewallinstallshell
  1633. [ $(which firewall_ng) ] && firewall_ng
  1634. fi
  1635. fi
  1636. fi
  1637. #120625...
  1638. if [ "$CHECK_NTP" != "$DEFAULT_NTP" ];then
  1639. if [ "$CHECK_NTP" = "false" ];then
  1640. chmod 664 /root/Startup/timesync.sh #so it won't run next bootup.
  1641. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'NTP set-time disabled'):yes|"
  1642. else
  1643. [ -f /root/Startup/timesync.sh ] && chmod 755 /root/Startup/timesync.sh
  1644. if [ -x /root/Startup/timesync.sh ];then
  1645. /root/Startup/timesync.sh &
  1646. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'NTP set-time enabled'):yes|"
  1647. else
  1648. /usr/local/psync/psync
  1649. if [ -x /root/Startup/timesync.sh ];then
  1650. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'NTP set-time enabled'):yes|"
  1651. else
  1652. #/tmp/settertime created by /usr/local/psync/psyncfunc
  1653. [ -f /tmp/settertime ] && FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'NTP set-time (this session only)'):yes|"
  1654. fi
  1655. fi
  1656. fi
  1657. fi
  1658. #130701...
  1659. if [ $DISPLAY ];then
  1660. if [ "$CHECK_SPOT" = "true" ];then
  1661. [ $wPID -ne 0 ] && kill $wPID
  1662. wPID=0
  1663. loginmanager
  1664. fi
  1665. fi
  1666. fi
  1667. #120714 raspberry pi support...
  1668. if [ "$SET_RP_AUDIO" -o "$SET_RP_VIDEO" ];then
  1669. if [ "$SET_RP_AUDIO" ];then
  1670. RP_AUDIO_OUT='0'
  1671. [ "$RP_AUDIO_0_RAD" = "true" ] && RP_AUDIO_OUT='0' #auto
  1672. [ "$RP_AUDIO_1_RAD" = "true" ] && RP_AUDIO_OUT='1' #analog
  1673. [ "$RP_AUDIO_2_RAD" = "true" ] && RP_AUDIO_OUT='2' #hdmi
  1674. if [ "$RP_DEF_AUDIO" != "$RP_AUDIO_OUT" ];then
  1675. rpPTN="s%amixer cset numid.*%amixer cset numid=3 ${RP_AUDIO_OUT}%"
  1676. sed -i -e "$rpPTN" /etc/init.d/11alsa_raspi
  1677. amixer cset numid=3 ${RP_AUDIO_OUT} #do it now.
  1678. case $RP_AUDIO_OUT in
  1679. 0) FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Automatic audio output'):yes|" ;;
  1680. 1) FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Analog audio output'):yes|" ;;
  1681. 2) FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'HDMI audio output'):yes|" ;;
  1682. esac
  1683. fi
  1684. fi
  1685. if [ "$SET_RP_VIDEO" ];then
  1686. echo
  1687. fi
  1688. fi
  1689. [ ! $DISPLAY ] && exit
  1690. if [ "`echo -n "$FLAG_CHANGED" | grep "restart"`" != "" ];then
  1691. F_restart="`gettext 'restart'`"
  1692. rPTN="s%:restart% <b><big>${F_restart}</big></b>%"
  1693. CHANGEDMARKUP="`echo "$FLAG_CHANGED" | tr '|' '\n' | sed -e "$rPTN" | cut -f 1 -d ':'`"
  1694. H_t1="`gettext 'Quick Setup: finished'`"
  1695. B_restart="`gettext 'Restart X'`"
  1696. B_exit="`gettext 'Exit'`"
  1697. M_fc0="`gettext 'These are the changed items:'`"
  1698. M_fc1="`gettext 'Those marked with <b>restart</b> require a restart of X (the graphical desktop) to take effect. Recommend, if it is ok to continue without restarting X for now, choose that option (<b>Exit</b> button).'`"
  1699. M_fc2="`gettext 'Make sure no other applications are running, and click the <b>Restart X</b> button, which will exit from the graphical desktop and restart it.'`"
  1700. M_fc3="`gettext 'Or, if the <b>Exit</b> button is clicked, the desktop will be retained, and changes marked with <b>restart</b> will not take effect. However, they will take effect the next time that X is started.'`"
  1701. export FC_DIALOG="<window title=\"${H_t1}\" window_position=\"1\" icon-name=\"${WINICON}\">
  1702. <vbox>
  1703. <text use-markup=\"true\"><label>\"${M_fc0}\"</label></text>
  1704. <text use-markup=\"true\"><label>\"<i>${CHANGEDMARKUP}</i>\"</label></text>
  1705. <text use-markup=\"true\"><label>\"${M_fc1}\"</label></text>
  1706. <text use-markup=\"true\"><label>\"${M_fc2}\"</label></text>
  1707. <text use-markup=\"true\"><label>\"${M_fc3}\"</label></text>
  1708. <hbox>
  1709. <button><label>${B_restart}</label><input file stock=\"gtk-redo\"></input><action>EXIT:OK</action></button>
  1710. <button><label>${B_exit}</label><input file stock=\"gtk-quit\"></input><action>EXIT:cancel</action></button>
  1711. </hbox>
  1712. </vbox>
  1713. </window>"
  1714. [ $wPID -ne 0 ] && kill $wPID #120524
  1715. wPID=0
  1716. RETVALS="`gtkdialog -p FC_DIALOG`"
  1717. eval "$RETVALS"
  1718. if [ "$EXIT" = "OK" ];then
  1719. rm -rf /tmp/.X0-lock
  1720. sync
  1721. exec restartwm `cat /etc/windowmanager`
  1722. fi
  1723. fi
  1724. [ $wPID -ne 0 ] && kill $wPID #120524
  1725. wPID=0
  1726. ###END###