quicksetup 94 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822
  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. if [ "$MYBASE" = "quicksetup" ];then #120313 only allow in main quicksetup window.
  257. #130701 removed this condition, always display network frame...
  258. SET_NETWORK="yes"
  259. HOSTNAME="`cat /etc/hostname`" #do not use $HOSTNAME, as hostname-set may have just been run.
  260. #120625 firewall checkbox...
  261. DEFAULT_FIREWALL='false'
  262. [ "`lsmod | grep '^iptable'`" != "" ] && DEFAULT_FIREWALL='true'
  263. #120625 get time/date off internet...
  264. CHKBOXNTP=""
  265. if [ "`cat /root/.packages/woof-installed-packages /root/.packages/user-installed-packages | grep '^[Pp]sync'`" != "" ];then
  266. DEFAULT_NTP='false'
  267. #[ -x /root/Startup/timesync.sh ] && DEFAULT_NTP='true' #created by psync package.
  268. [ -f /tmp/settertime ] && DEFAULT_NTP='true' #created by psync package.
  269. CHKBOXNTP='
  270. <hbox tooltip-text="'$(gettext "Set this computer's time and date from an Internet NTP server")'">
  271. <checkbox xalign="0" space-expand="true" space-fill="true">
  272. <label>'$(gettext "Set time/date from the Internet")'</label>
  273. <variable>CHECK_NTP</variable>
  274. <default>'${DEFAULT_NTP}'</default>
  275. </checkbox>
  276. <button>
  277. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  278. <action>help ntp</action>
  279. </button>
  280. </hbox>'
  281. fi
  282. #130701...
  283. SPOT_XML=''
  284. HOMEUSER="`whoami`"
  285. if [ "$HOMEUSER" = "root" ];then
  286. SPOT_XML='
  287. <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">
  288. <hbox space-expand="true" space-fill="true">
  289. <button space-expand="false" space-fill="false">
  290. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  291. <action>basichtmlviewer /usr/share/doc/root.htm & </action>
  292. </button>
  293. <text space-expand="true" space-fill="true"><label>""</label></text>
  294. </hbox>
  295. <checkbox space-expand="false" space-fill="false">
  296. <label>'$(gettext 'Run Internet apps as spot')'</label>
  297. <variable>CHECK_SPOT</variable>
  298. <default>false</default>
  299. </checkbox>
  300. </hbox>'
  301. fi
  302. NETWORK_XML='
  303. <frame '$(gettext 'Network')'>
  304. <hbox space-expand="true" space-fill="true">
  305. <vbox space-expand="false" space-fill="false">
  306. <hbox tooltip-text="'$(gettext "Tick checkbox to activate the firewall (recommended)")'" space-expand="false" space-fill="false">
  307. <checkbox xalign="0" space-expand="true" space-fill="true">
  308. <label>'$(gettext "Firewall enabled")'</label>
  309. <variable>CHECK_FIREWALL</variable>
  310. <default>'${DEFAULT_FIREWALL}'</default>
  311. </checkbox>
  312. <button space-expand="false" space-fill="false">
  313. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  314. <action>help firewall</action>
  315. </button>
  316. </hbox>
  317. '${CHKBOXNTP}'
  318. </vbox>
  319. <text space-expand="true" space-fill="true"><label>""</label></text>
  320. '"`/usr/lib/gtkdialog/xml_pixmap network_connect.svg icon`"'
  321. <text space-expand="true" space-fill="true"><label>""</label></text>
  322. <vbox space-expand="false" space-fill="false">
  323. '${SPOT_XML}'
  324. <hbox space-expand="false" space-fill="false">
  325. <button space-expand="false" space-fill="false">
  326. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  327. <action>help net</action>
  328. </button>
  329. <text space-expand="false" space-fill="false"><label>'$(gettext 'Hostname:')'</label></text>
  330. <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">
  331. <input>echo -n "'$HOSTNAME'"</input>
  332. <variable>ENTRY_HOSTNAME</variable>
  333. </entry>
  334. </hbox>
  335. </vbox>
  336. </hbox>
  337. </frame>'
  338. #fi
  339. fi
  340. ###Country localization###
  341. if [ "$SET_COUNTRY" ];then
  342. #120402
  343. INSTLANGPACK="`grep '^langpack_' /root/.packages/woof-installed-packages | cut -f 2 -d '|'`"
  344. [ ! "$INSTLANGPACK" ] && [ -f /root/.packages/user-installed-packages ] && INSTLANGPACK="`grep '^langpack_' /root/.packages/user-installed-packages | cut -f 2 -d '|'`"
  345. [ ! "$INSTLANGPACK" ] && INSTLANGPACK="none"
  346. ###Choose locale###
  347. LOCALEXML=""
  348. if [ "$SET_LOCALE" ];then
  349. CURRLANG="`grep '^LANG=' /etc/profile | tr -d "'" | tr -d '"' | cut -f 2 -d '='`" #111022
  350. [ ! "$CURRLANG" ] && CURRLANG="en_US" #precaution
  351. UTF8=''
  352. if [ "`echo -n "$CURRLANG" | grep 'utf8'`" != "" ];then #111022 get rid of old name.
  353. rm -rf /usr/lib/locale/$CURRLANG
  354. UTF8='.UTF-8'
  355. fi
  356. [ "`echo -n "$CURRLANG" | grep 'UTF\-8'`" != "" ] && UTF8='.UTF-8'
  357. BASELANG="`basename $CURRLANG .utf8`"
  358. BASELANG="`basename $BASELANG .UTF-8`"
  359. #does the locale need to have UTF-8 enabled?...
  360. UTF_FLAG="no"
  361. grep -q "^${BASELANG}[_. ].*ISO-8859-" /usr/share/i18n/SUPPORTED
  362. [ $? -ne 0 ] && UTF_FLAG="yes" #actually, alternate code below to determine this.
  363. if [ "$PARAM1" != "composeonly" ];then #param passed to chooselocale by 3builddistro in Woof.
  364. #want to default to utf8, but localedef crash problem in 64MB PC...
  365. if [ "$UTF8" = "" ];then
  366. [ ! -d /usr/lib/locale/en_US ] && localedef -f ISO-8859-1 -i en_US --no-archive en_US >/dev/null
  367. else
  368. #warning: free output varies different versions of busybox (also early version do not accept params)...
  369. RAMK=`free | tr -s ' ' | grep -o 'Mem:.*' | cut -f 2 -d ' '`
  370. if [ $RAMK -gt 100000 ];then
  371. #111022 no, i seem to have been lead up the garden path, the dir must remain as 'en_US.utf8'...
  372. [ ! -d /usr/lib/locale/en_US.utf8 ] && localedef -f UTF-8 -i en_US --no-archive en_US.utf8 >/dev/null #110409 111022
  373. else
  374. [ ! -d /usr/lib/locale/en_US ] && localedef -f ISO-8859-1 -i en_US --no-archive en_US >/dev/null
  375. UTF8=''
  376. fi
  377. fi
  378. fi
  379. #build language table...
  380. LANGUAGEDESCR='
  381. aa:Afar
  382. ab:Abkhazian
  383. af:Africaans
  384. am:Amharic
  385. an:Aragonese
  386. ar:Arabic
  387. az:Azeri
  388. be:Belarusian
  389. bg:Bulgarian
  390. bn:Bengali
  391. br:Breton
  392. bs:Bosnian
  393. ca:Catalan
  394. cs:Czech
  395. cy:Welsh
  396. da:Danish
  397. de:German
  398. dv:Divehi
  399. dz:Dzongkha
  400. el:Greek
  401. en:English
  402. eo:Esperanto
  403. es:Spanish
  404. et:Estonian
  405. eu:Basque
  406. fa:Persian
  407. fi:Finnish
  408. fo:Faeroese
  409. fr:French
  410. ga:Irish
  411. gd:Scots_Gaelic
  412. gl:Galician
  413. gu:Gujarati
  414. gv:Manx_Gaelic
  415. he:Hebrew
  416. hi:Hindi
  417. hr:Croatian
  418. hu:Hungarian
  419. hy:Armenian
  420. id:Indonesian
  421. is:Icelandic
  422. it:Italian
  423. iw:Hebrew
  424. ja:Japanese
  425. ka:Georgian
  426. kk:Kazakh
  427. kl:Greenlandic
  428. km:Khmer
  429. kn:Kannada
  430. kok:Konkani
  431. ko:Korean
  432. ku:Kurdish
  433. kw:Cornish
  434. ky:Kyrgyz
  435. lg:Luganda
  436. lo:Lao
  437. lt:Lithuanian
  438. lv:Latvian
  439. mg:Malagasy
  440. mi:Maori
  441. mk:Macedonian
  442. ml:Malayalam
  443. mn:Mongolian
  444. mr:Marathi
  445. ms:Malay
  446. mt:Maltese
  447. ne:Nepali
  448. nl:Dutch
  449. nb:Norgwegian
  450. nn:Norwegian_Nynorsk
  451. no:Norwegian_Bokm
  452. oc:Occitan
  453. om:Oromo
  454. or:Oriya
  455. pa:Pashto
  456. pa:Punjabi
  457. pl:Polish
  458. pt:Portuguese
  459. quz:Quechua
  460. ro:Romania
  461. rs:Serbian
  462. ru:Russian
  463. rw:Kinyarwanda
  464. sa:Sanskrit
  465. se:Sami
  466. sma:Sami
  467. smj:Sami
  468. smn:Sami
  469. sms:Sami
  470. sl:Slovenian
  471. sq:Albanian
  472. sr:Srpski
  473. sv:Swedish
  474. sw:Swahili
  475. syr:Syriac
  476. ta:Tamil
  477. te:Telugu
  478. th:Thai
  479. tl:Tagalog
  480. tr:Turkish
  481. tt:Tatar
  482. uk:Ukrainian
  483. ur:Urdu
  484. uz:Uzbek
  485. vi:Vietnamese
  486. wa:Walloon
  487. xh:Xhosa
  488. yi:Yiddish
  489. zh:Chinese
  490. zu:Zulu'
  491. REGIONDESCR='
  492. AA:ArabicCountries
  493. AE:UAE
  494. AL:Yugoslavia
  495. AR:Argentina
  496. AT:Austria
  497. AU:Australia
  498. BE:Belgium
  499. BG:Bularia
  500. BH:Bahrain
  501. BN:Brunei
  502. BO:Bolvia
  503. BR:Brazil
  504. BZ:Belize
  505. CA:Canada
  506. CH:Switzerland
  507. CL:Chile
  508. CN:PeoplesRepublicChina
  509. CO:Columbia
  510. CR:CostaRica
  511. CY:Cyprus
  512. CZ:CzechRepublic
  513. DE:Germany
  514. DK:Denmark
  515. DO:DominicanRepublic
  516. DO:Dominican
  517. DZ:Algeria
  518. EC:Ecuador
  519. EC:Ecuador
  520. EE:Estonia
  521. EG:Egypt
  522. ES:Spain
  523. FI:Finland
  524. FR:France
  525. GB:GreatBritain
  526. GR:Greece
  527. GT:Guatemalia
  528. HK:HongKong
  529. HN:Honduras
  530. HR:Croatia
  531. HU:Hungary
  532. ID:Indonesia
  533. IE:Ireland
  534. IL:Israel
  535. IN:India
  536. IQ:Iraq
  537. IS:Iceland
  538. IT:Italy
  539. JM:Jamaica
  540. JO:Jordan
  541. JP:Japan
  542. KR:Korea
  543. KW:Kuwait
  544. KZ:Kazakhstan
  545. LB:Lebanon
  546. LI:Liechtenstein
  547. LU:Luxembourg
  548. LY:Libya
  549. MA:Morocco
  550. MC:Monaco
  551. MK:Macedonia
  552. MO:Macau
  553. MY:Malaysia
  554. MX:Mexico
  555. MX:Mexico
  556. NI:Nicaragua
  557. NI:Nicaragua
  558. NL:Netherlands
  559. NO:Norway
  560. NZ:NewZealand
  561. OM:Oman
  562. PA:Panama
  563. PE:Peru
  564. PE:Peru
  565. PH:Philippines
  566. PL:Poland
  567. PR:PuertoRico
  568. PT:Portugal
  569. PY:Paraguay
  570. QA:Qatar
  571. RO:Romania
  572. RU:Russia
  573. SA:SaudiArabia
  574. SE:Sweden
  575. SG:Singapore
  576. SK:Slovakia
  577. SV:ElSalvador
  578. SY:Syria
  579. TH:Thailand
  580. TN:Tunisia
  581. TR:Turkey
  582. TW:Taiwan
  583. TT:Trinidad
  584. US:USA
  585. UY:Uruguay
  586. VE:Venezuela
  587. YE:Yemen
  588. YU:Yugoslavia
  589. ZA:SouthAfrica
  590. ZA:SouthAfrica'
  591. #need sanity check, as format of these files has changed...
  592. SANITYFLAG='pass'
  593. [ -f /usr/share/i18n/dialog_table_x ] || SANITYFLAG='fail' #111113 precaution.
  594. [ -s /usr/share/i18n/dialog_table_cli ] && [ `cat /usr/share/i18n/dialog_table_cli | wc -l` -le 1 ] && SANITYFLAG='fail'
  595. [ -s /usr/share/i18n/dialog_table_x ] && [ `cat /usr/share/i18n/dialog_table_x | wc -l` -le 1 ] && SANITYFLAG='fail'
  596. if [ "$PARAM1" = "composeonly" -o "$SANITYFLAG" = "fail" ];then
  597. #CHOICES_CLI=""; ON=""; OFF=""; CHOICES_X="" #120717 remove XPID="";
  598. rm -f /tmp/quicksetup_language_x;rm -f /tmp/quicksetup_language_cli
  599. for ONELOCALE in `ls -1 /usr/share/i18n/locales | grep -v -E 'i18n|iso|translit|POSIX'`
  600. do
  601. STATUS="off"
  602. [ "$ONELOCALE" = "$BASELANG" ] && STATUS="on"
  603. LANGUAGE="${ONELOCALE%%_*}"
  604. REGION=`echo -n "${ONELOCALE#*_}" | cut -f 1 -d '.' | cut -f 1 -d '@'`
  605. lPATTERN="^${LANGUAGE}:"
  606. LANGUAGE=`echo "$LANGUAGEDESCR" | tr ' ' '\n' | grep "$lPATTERN" | head -n 1 | cut -f 2 -d ':'`
  607. rPATTERN="^${REGION}:"
  608. REGION=`echo "$REGIONDESCR" | tr ' ' '\n' | grep "$rPATTERN" | head -n 1 | cut -f 2 -d ':'`
  609. [ "$LANGUAGE" -a "$REGION" ] && LANGUAGE="${LANGUAGE}, "
  610. DESCR="${LANGUAGE}${REGION}"
  611. if [ "$STATUS" = "on" ];then
  612. echo "$ONELOCALE \"${DESCR}\" on" >>/tmp/quicksetup_language_x
  613. FIRSTLINE_CLI="$ONELOCALE \"${DESCR}\" "
  614. touch /tmp/quicksetup_language_cli
  615. sed -i '1 i\\'"$FIRSTLINE_CLI" /tmp/quicksetup_language_cli
  616. else
  617. echo "$ONELOCALE \"${DESCR}\" off" >>/tmp/quicksetup_language_x
  618. echo "$ONELOCALE \"${DESCR}\" " >>/tmp/quicksetup_language_cli
  619. fi
  620. done
  621. cat /tmp/quicksetup_language_x >/usr/share/i18n/dialog_table_x
  622. [ $? = 0 ] && rm /tmp/quicksetup_language_x
  623. cat /tmp/quicksetup_language_cli >/usr/share/i18n/dialog_table_cli
  624. [ $? = 0 ] && rm /tmp/quicksetup_language_cli
  625. [ "$PARAM1" = "composeonly" ] && exit
  626. fi
  627. #tables already exist, but may need to reselect 'on' item...
  628. onPTN="s%^${BASELANG} \"(.*)\" off$%${BASELANG} \"\1\" on%"
  629. sed -i -e 's% on$% off%' -r -e "$onPTN" /usr/share/i18n/dialog_table_x
  630. DEFAULTXML=""
  631. DEFAULT=`grep ' on$' /usr/share/i18n/dialog_table_x | sed -e 's% on$%%' -e 's%"%%g' -e "s% % ${TABCHAR}%"`
  632. [ "$DEFAULT" ] && DEFAULTXML="<item>${DEFAULT}</item>" #111107 combobox does not support default tag.
  633. 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`
  634. DEFAULT_UTF8='false'
  635. [ "$UTF8" ] && DEFAULT_UTF8='true'
  636. CHECKUTF8XML='
  637. <hbox tooltip-text="'$(gettext 'Tick checkbox to support UTF-8 encoding')'" space-expand="true" space-fill="true">
  638. <checkbox space-expand="false" space-fill="false">
  639. <label>'$(gettext 'UTF-8 encoding')'</label>
  640. <variable>CHECK_UTF8</variable>
  641. <default>'${DEFAULT_UTF8}'</default>
  642. </checkbox>
  643. <text space-expand="true" space-fill="true"><label>""</label></text>
  644. <button space-expand="false" space-fill="false">
  645. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  646. <action>help utf8</action>
  647. </button>
  648. </hbox>'
  649. LOCALEXML='
  650. <vbox space-expand="false" space-fill="false">
  651. <hbox tooltip-text="'$(gettext "Main Language")'" space-expand="true" space-fill="true">
  652. '"`/usr/lib/gtkdialog/xml_pixmap country_language.svg icon`"'
  653. <text width-request="10" space-expand="false" space-fill="false"><label>""</label></text>
  654. <vbox space-expand="true" space-fill="true">'
  655. [ "$(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>'
  656. LOCALEXML=$LOCALEXML'
  657. <hbox tooltip-text="'$(gettext "Choose main language")'" space-expand="true" space-fill="true">
  658. <combobox space-expand="true" space-fill="true">
  659. '${DEFAULTXML}'
  660. '${ITEMS}'
  661. <variable>COMBO_LOCALE</variable>
  662. </combobox>
  663. <button space-expand="false" space-fill="false">
  664. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  665. <action>help locale</action>
  666. </button>
  667. </hbox>
  668. '${CHECKUTF8XML}'
  669. </vbox>
  670. </hbox>
  671. </vbox>'
  672. fi #end SET_LOCALE
  673. ###Choose timezone###
  674. TIMEZONEXML=""
  675. if [ "$SET_TIMEZONE" ];then
  676. if [ -e /etc/localtime ];then
  677. CZONE="`readlink /etc/localtime 2>/dev/null`"
  678. [ "$CZONE" = "" ] && rm -f /etc/localtime
  679. fi
  680. if [ -e /etc/localtime ];then
  681. CZONE="`readlink /etc/localtime`"
  682. DEF_TIMEZONE="`readlink /etc/localtime | sed -e 's%/usr/share/zoneinfo/%%'`"
  683. else
  684. CZONE='/usr/share/zoneinfo/Australia/Perth'
  685. DEF_TIMEZONE='Australia/Perth'
  686. fi
  687. DEF_TIMEZONE=`echo -n "$DEF_TIMEZONE" | sed -e 's%Etc/%%'`
  688. xDEF_TIMEZONE="`echo -n "$DEF_TIMEZONE" | sed 's%GMT%GMT\\\\%'`" #the sign needs a \ in front. ex: GMT\+8
  689. #120901 fix for new layout in ubuntu precise...
  690. 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' ' '`"
  691. if [ ! -f /var/local/quicksetup-timezone-table-x -o ! -f /var/local/quicksetup-timezone-table-cli ];then
  692. rm -f /var/local/quicksetup-timezone-table-x
  693. rm -f /var/local/quicksetup-timezone-table-cli
  694. ZONECHOICES_CLI=""
  695. for ONEZONE in $ZONEINFO
  696. do
  697. ONEDESCR="."
  698. [ "$ONEZONE" = "GMT" ] && continue
  699. [ "$ONEZONE" = "GMT-0" ] && continue
  700. case $ONEZONE in
  701. GMT+0) ONEDESCR='(London, Dublin, Edinburgh, Lisbon, Reykjavik, Casablanca)';;
  702. GMT-1) ONEDESCR='(Azores, Cape Verdes)';;
  703. GMT+1) ONEDESCR='(Paris, Berlin, Amsterdam, Brussels, Madrid, Stockholm Oslo)';;
  704. GMT-2) ONEDESCR='(mid-Atlantic)';;
  705. GMT+2) ONEDESCR='(Athens, Helsinki, Istanbul, Jerusalem, Harare)';;
  706. GMT-3) ONEDESCR='(Brasilia, Buenos Aires, Georgetown)';;
  707. GMT+3) ONEDESCR='(Kuwait, Nairobi, Riyadh, Moscow)';;
  708. GMT-4) ONEDESCR='(Caracas, La Paz, Canada)';;
  709. GMT+4) ONEDESCR='(Abu Dhabi, Muscat, Tblisi, Volgograd, Kabul)';;
  710. GMT-5) ONEDESCR='(Bogota, Lima, New York)';;
  711. GMT+5) ONEDESCR='(Islamabad, Karachi)';;
  712. GMT+5:30) ONEDESCR='(India)';;
  713. GMT-6) ONEDESCR='(Mexico City, Saskatchewan)';;
  714. GMT+6) ONEDESCR='(Almaty, Dhaka)';;
  715. GMT+6:30) ONEDESCR='(Cocos Islands)';;
  716. GMT-7) ONEDESCR='(Alberta, Montana, Arizona)';;
  717. GMT+7) ONEDESCR='(Bangkok, Jakarta)';;
  718. GMT-8) ONEDESCR='(Los Angeles)';;
  719. GMT+8) ONEDESCR='(Perth, Singapore, Hongkong)';;
  720. GMT-9) ONEDESCR='(Alaska)';;
  721. GMT+9) ONEDESCR='(Tokyo)';;
  722. GMT+9:30) ONEDESCR='(Darwin, Adelaide)';;
  723. GMT-10) ONEDESCR='(Alaska, Hawaii)';;
  724. GMT+10) ONEDESCR='(Guam)';;
  725. GMT+10:30) ONEDESCR='(Lord Howe Island)';;
  726. GMT-11) ONEDESCR='(Samoa)';;
  727. GMT+11) ONEDESCR='(Magadan, Soloman Is.)';;
  728. GMT-12) ONEDESCR='(Eniwetok)';;
  729. GMT+12) ONEDESCR='(Wellington, Fiji, Marshall Islands)';;
  730. GMT+13) ONEDESCR='(Rawaki Islands)';;
  731. GMT+14) ONEDESCR='(Line Islands)';;
  732. esac
  733. echo -n "${ONEZONE} \"${ONEDESCR}\" " >> /var/local/quicksetup-timezone-table-cli #111113
  734. if [ "$DEF_TIMEZONE" = "${ONEZONE}" ];then
  735. echo "${ONEZONE} \"${ONEDESCR}\" on" >> /var/local/quicksetup-timezone-table-x
  736. else
  737. echo "${ONEZONE} \"${ONEDESCR}\" off" >> /var/local/quicksetup-timezone-table-x
  738. fi
  739. done
  740. fi
  741. ZONECHOICES_CLI="`cat /var/local/quicksetup-timezone-table-cli`" #111113
  742. #table already exist, but may need to reselect 'on' item...
  743. onPTN="s%^${xDEF_TIMEZONE} \"(.*)\" off$%${DEF_TIMEZONE} \"\1\" on%"
  744. sed -i -e 's% on$% off%' -r -e "$onPTN" /var/local/quicksetup-timezone-table-x
  745. DEFAULTXML=""
  746. DEFAULT=`grep ' on$' /var/local/quicksetup-timezone-table-x | sed -e 's% on$%%' -e 's%"%%g' -e "s% %${TABCHAR}%"`
  747. [ "$DEFAULT" ] && DEFAULTXML="<item>${DEFAULT}</item>" #111107 combobox does not support default tag.
  748. 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`
  749. DEFAULT_UTC="false"
  750. [ "$HWCLOCKTIME" = "utc" ] && DEFAULT_UTC="true" #see /etc/clock
  751. CHECKUTCXML='
  752. <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">
  753. <checkbox space-expand="false" space-fill="false">
  754. <label>'$(gettext 'Hardware clock set to UTC')'</label>
  755. <variable>CHECK_UTC</variable>
  756. <default>'${DEFAULT_UTC}'</default>
  757. </checkbox>
  758. <text space-expand="true" space-fill="true"><label>""</label></text>
  759. <button space-expand="false" space-fill="false">
  760. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  761. <action>help utc</action>
  762. </button>
  763. </hbox>'
  764. TIMEZONEXML='
  765. <vbox space-expand="false" space-fill="false">
  766. <hbox tooltip-text="'$(gettext "Time Zone")'" space-expand="true" space-fill="true">
  767. '"`/usr/lib/gtkdialog/xml_pixmap country_timezone.svg icon`"'
  768. <text width-request="10" space-expand="false" space-fill="false"><label>""</label></text>
  769. <vbox space-expand="true" space-fill="true">'
  770. [ "$(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>'
  771. TIMEZONEXML=$TIMEZONEXML'
  772. <hbox tooltip-text="'$(gettext "Choose time zone")'" space-expand="true" space-fill="true">
  773. <combobox space-expand="true" space-fill="true">
  774. '${DEFAULTXML}'
  775. '${ITEMS}'
  776. <variable>COMBO_TIMEZONE</variable>
  777. </combobox>
  778. <button space-expand="false" space-fill="false">
  779. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  780. <action>help timezone</action>
  781. </button>
  782. </hbox>
  783. '${CHECKUTCXML}'
  784. </vbox>
  785. </hbox>
  786. </vbox>'
  787. fi #end SET_TIMEZONE
  788. ###keyboard layout###
  789. KEYBOARDXML=""
  790. if [ "$SET_KEYBOARD" ];then
  791. #120627
  792. KMAPPATH='/lib/keymaps'
  793. [ -d /usr/share/kbd/keymaps/i386 ] && KMAPPATH='/usr/share/kbd/keymaps/i386'
  794. [ -d /usr/share/keymaps/i386 ] && KMAPPATH='/usr/share/keymaps/i386' #debian, gentoo. note, debian files have extension .kmap.gz, gentoo have .map.gz
  795. KEXT=''
  796. [ -f ${KMAPPATH}/qwerty/us.map ] && KEXT='.map'
  797. [ -f ${KMAPPATH}/qwerty/us.map.gz ] && KEXT='.map'
  798. [ -f ${KMAPPATH}/qwerty/us.kmap ] && KEXT='.kmap'
  799. [ -f ${KMAPPATH}/qwerty/us.kmap.gz ] && KEXT='.kmap'
  800. DEF_KMAP="us"
  801. [ -f /etc/keymap ] && DEF_KMAP="`cat /etc/keymap | sed -e 's/\..*//'`"
  802. [ ! "$DEF_KMAP" ] && DEF_KMAP="us" #precaution.
  803. if [ ! -f /var/local/quickset-keyboard-list ];then
  804. echo -n "" > /var/local/quickset-keyboard-list
  805. case $KMAPPATH in #120627
  806. /lib/keymaps) KMAPFILES="`find /lib/keymaps -mindepth 1 -maxdepth 1 -name '*.gz' | sort`" ;; #ex: us.gz
  807. *) KMAPFILES="`find ${KMAPPATH}/[^i]* -name '*.map' -o -name '*.kmap' -o -name '*.map.gz' -o -name '*.kmap.gz' -not -name 'defkeymap*' | sort`" ;;
  808. esac
  809. for AFILE in $KMAPFILES
  810. do
  811. AKMAP="`basename $AFILE .gz`" #us, fr, br, etc.
  812. AKMAP="`basename $AKMAP .kmap`" #120627
  813. AKMAP="`basename $AKMAP .map`" #120627
  814. case $AKMAP in
  815. us*) ACNTRY="(USA)";;
  816. fr*) ACNTRY="(France)";;
  817. it*) ACNTRY="(Italy)";;
  818. ba*) ACNTRY="(Bashkir)";;
  819. be*) ACNTRY="(Belgium)";;
  820. bg*) ACNTRY="(Bulgaria)";;
  821. br*) ACNTRY="(Brazil)";;
  822. by*) ACNTRY="(Byelorussian)";;
  823. cf*) ACNTRY="(French-Canadian)";;
  824. croat*) ACNTRY="(Croatia)";;
  825. cz*) ACNTRY="(Czech)";;
  826. de) ACNTRY="(Germany)";;
  827. de_*) ACNTRY="(Germany)";;
  828. de-*) ACNTRY="(Germany)";;
  829. dk*) ACNTRY="(Denmark)";;
  830. es*) ACNTRY="(Spain)";;
  831. fi*) ACNTRY="(Finland)";;
  832. hu*) ACNTRY="(Hungary)";;
  833. ka*) ACNTRY="(Kazakhstan)";;
  834. ky*) ACNTRY="(Kyrgyzstan)";;
  835. et*) ACNTRY="(Estonia)";;
  836. lt*) ACNTRY="(Lithuania)";;
  837. mk*) ACNTRY="(Macedonia)";;
  838. sr*) ACNTRY="(Serbia)";;
  839. tr*) ACNTRY="(Turkey)";;
  840. tt*) ACNTRY="(Tatar)";;
  841. sg*) ACNTRY="(Sango)";;
  842. ua*) ACNTRY="(Ukraine)";;
  843. gr*) ACNTRY="(Greece)";;
  844. il*) ACNTRY="(Israel)";;
  845. is*) ACNTRY="(Iceland)";;
  846. jp*) ACNTRY="(Japan)";;
  847. pc*) ACNTRY="(Japanese/English)";;
  848. la*) ACNTRY="(Latin_America)";;
  849. nl*) ACNTRY="(Netherlands)";;
  850. no*) ACNTRY="(Norway)";;
  851. pl*) ACNTRY="(Poland)";;
  852. pt*) ACNTRY="(Portugal)";;
  853. ro*) ACNTRY="(Romania)";;
  854. ru*) ACNTRY="(Russia)";;
  855. se*) ACNTRY="(Sweden)";;
  856. sv*) ACNTRY="(Sweden)";;
  857. sk*) ACNTRY="(Slovakia)";;
  858. sl*) ACNTRY="(Slovenia)";;
  859. uk*) ACNTRY="(UK)";;
  860. wangbe*) ACNTRY="(Belgium)";;
  861. azerty) ACNTRY="(Tandon)";;
  862. dvorak-r) ACNTRY="(Right_single-handed)";;
  863. dvorak-l) ACNTRY="(Left_single-handed)";;
  864. *) ACNTRY="-";;
  865. esac
  866. if [ "$DEF_KMAP" = "$AKMAP" ];then
  867. echo "$AKMAP \"${ACNTRY}\" on" >> /var/local/quickset-keyboard-list
  868. else
  869. echo "$AKMAP \"${ACNTRY}\" off" >> /var/local/quickset-keyboard-list
  870. fi
  871. done
  872. fi
  873. #table already exist, but may need to reselect 'on' item...
  874. onPTN="s%^${DEF_KMAP} \"(.*)\" off$%${DEF_KMAP} \"\1\" on%"
  875. sed -i -e 's% on$% off%' -r -e "$onPTN" /var/local/quickset-keyboard-list
  876. DEFAULTXML=""
  877. DEFAULT=`grep ' on$' /var/local/quickset-keyboard-list | sed -e 's% on$%%' -e 's%"%%g' -e "s% % ${TABCHAR}%"`
  878. [ "$DEFAULT" ] && DEFAULTXML="<item>${DEFAULT}</item>" #111107 combobox does not support default tag.
  879. 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`
  880. DEFAULT_NUMLOCK="false"
  881. CHECKNUMLOCKXML=""
  882. if which numlockx >/dev/null;then
  883. [ -x /root/Startup/numlockx ] && [ "`grep '^numlockx on' /root/Startup/numlockx`" != "" ] && DEFAULT_NUMLOCK="true"
  884. CHECKNUMLOCKXML='
  885. <hbox tooltip-text="'$(gettext 'Tick checkbox to turn on keyboard numlock')'" space-expand="true" space-fill="true">
  886. <checkbox space-expand="false" space-fill="false">
  887. <label>'$(gettext 'Keyboard numlock')'</label>
  888. <variable>CHECK_NUMLOCK</variable>
  889. <default>'${DEFAULT_NUMLOCK}'</default>
  890. </checkbox>
  891. <text space-expand="true" space-fill="true"><label>""</label></text>
  892. <button space-expand="false" space-fill="false">
  893. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  894. <action>help numlock</action>
  895. </button>
  896. </hbox>'
  897. fi
  898. KEYBOARDXML='
  899. <vbox space-expand="false" space-fill="false">
  900. <hbox tooltip-text="'$(gettext "Keyboard Layout")'" space-expand="true" space-fill="true">
  901. '"`/usr/lib/gtkdialog/xml_pixmap country_keyboard.svg icon`"'
  902. <text width-request="10" space-expand="false" space-fill="false"><label>""</label></text>
  903. <vbox space-expand="true" space-fill="true">'
  904. [ "$(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>'
  905. KEYBOARDXML=$KEYBOARDXML'<hbox tooltip-text="'$(gettext "Choose keyboard layout")'" space-expand="true" space-fill="true">
  906. <combobox space-expand="true" space-fill="true">
  907. '${DEFAULTXML}'
  908. '${ITEMS}'
  909. <variable>COMBO_KEYBOARD</variable>
  910. </combobox>
  911. <button space-expand="false" space-fill="false">
  912. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  913. <action>help keyboard</action>
  914. </button>
  915. </hbox>
  916. '${CHECKNUMLOCKXML}'
  917. </vbox>
  918. </hbox>
  919. </vbox>'
  920. fi #end SET_KEYBOARD
  921. COUNTRYXML='
  922. <vbox>
  923. <frame '${COUNTRYFRAMETITLE}'>
  924. '${LOCALEXML}'
  925. '${TIMEZONEXML}'
  926. '${KEYBOARDXML}'
  927. </frame>
  928. </vbox>'
  929. fi #end SET_COUNTRY
  930. ###setup x###
  931. if [ "$SET_X" ];then
  932. #try keep this message short, so renders in one line...
  933. M_xy="`gettext 'If the Wizard fails to set desired resolution, try this:'`" #used in SET_XRES, but maybe changed in SET_XWIZARD.
  934. if [ "$SET_XWIZARD" ];then
  935. #note, quicksetup gets launched from /usr/sbin/delayedrun, but only for xorg, not xvesa.
  936. #put up a button to launch xorgwizard...
  937. if [ -f /var/log/Xorg.0.log ];then #log file created when X starts.
  938. XDRIVERSUCCESS=''
  939. 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' ' ')"
  940. for ALOADED in $LOADED
  941. do
  942. aPTN="UnloadModule: \"$ALOADED\""
  943. bPTN="LoadModule: \"$ALOADED\""
  944. #Xorg loaded noauveau, then tried to load it again, failed, then unloaded, so count them...
  945. CNTload=`grep "$bPTN" /var/log/Xorg.0.log | wc -l`
  946. CNTunload=`grep "$aPTN" /var/log/Xorg.0.log | wc -l`
  947. [ $CNTload -eq 0 ] && continue
  948. [ $CNTunload -ge $CNTload ] && continue
  949. XDRIVERSUCCESS="$ALOADED"
  950. break
  951. done
  952. if [ "$XDRIVERSUCCESS" ];then #precaution.
  953. #130509 record this for xorgwizard-cli...
  954. if [ $PUPMODE -eq 5 ];then
  955. if [ "$DISTRO_XORG_AUTO" = "yes" ];then #see /etc/DISTRO_SPECS
  956. echo -n "$XDRIVERSUCCESS" > /var/local/quicksetup-pupmode5-autodriver
  957. fi
  958. fi
  959. 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.')
  960. M_xdrv2=$(gettext 'The')
  961. M_xdrv3=$(gettext 'video driver is currently being used. Good, but if you need to adjust screen resolution or displacement, run the Video Wizard.')
  962. TT_xorg1=$(gettext 'Run the Xorg Video Wizard')
  963. TT_xorg2=$(gettext 'Xorg Video Wizard')
  964. B_xwiz=$(gettext 'Video Wizard')
  965. B_xup=$(gettext 'Upgrade Wizard')
  966. TT_xup1=$(gettext 'Run the Video Upgrade Wizard')
  967. TT_xup2=$(gettext 'Video Upgrade Wizard')
  968. if [ "$XDRIVERSUCCESS" = "vesa" ];then
  969. M_xy="`gettext 'If the Wizards fail to set desired resolution, try this:'`" #used in SET_XRES.
  970. XMSGXML="<text use-markup=\"true\"><label>\"${M_xdrv1}\"</label></text>"
  971. XWIZARDXML='
  972. <hbox space-expand="true" space-fill="true">
  973. '"`/usr/lib/gtkdialog/xml_pixmap graphics.svg icon`"'
  974. <text space-expand="true" space-fill="true"><label>""</label></text>
  975. <vbox>
  976. <hbox tooltip-text="'${TT_xorg2}'">
  977. <checkbox tooltip-text="'${TT_xorg1}'">
  978. <variable>CHECK_XORGWIZARD</variable>
  979. <label>'${B_xwiz}'</label>
  980. <action>if true disable:CHECK_XUPGRADE</action>
  981. <action>if false enable:CHECK_XUPGRADE</action>
  982. </checkbox>
  983. </hbox>
  984. <hbox tooltip-text="'${TT_xup2}'">
  985. <checkbox tooltip-text="'${TT_xup1}'">
  986. <variable>CHECK_XUPGRADE</variable>
  987. <label>'${B_xup}'</label>
  988. <action>if true disable:CHECK_XORGWIZARD</action>
  989. <action>if false enable:CHECK_XORGWIZARD</action>
  990. </checkbox>
  991. <button>
  992. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  993. <action>help xorg</action>
  994. </button>
  995. </hbox>
  996. </vbox>
  997. </hbox>'
  998. else
  999. XMSGXML="<text use-markup=\"true\"><label>\"${M_xdrv2} <b>${XDRIVERSUCCESS}</b> ${M_xdrv3}\"</label></text>"
  1000. XWIZARDXML='
  1001. <hbox space-expand="true" space-fill="true">
  1002. '"`/usr/lib/gtkdialog/xml_pixmap graphics.svg icon`"'
  1003. <text space-expand="true" space-fill="true"><label>""</label></text>
  1004. <vbox>
  1005. <hbox tooltip-text="'${TT_xorg2}'">
  1006. <checkbox tooltip-text="'${TT_xorg1}'">
  1007. <variable>CHECK_XORGWIZARD</variable>
  1008. <label>'${B_xwiz}'</label>
  1009. </checkbox>
  1010. <button>
  1011. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  1012. <action>help xorg</action>
  1013. </button>
  1014. </hbox>
  1015. </vbox>
  1016. </hbox>'
  1017. fi
  1018. fi
  1019. fi
  1020. fi #end SET_XWIZARD
  1021. if [ "$SET_XRES" ];then
  1022. #a combobox to choose resolution...
  1023. FLAG_XYRES="enabled"
  1024. #shinobar...
  1025. NVIDIABUTTON=""
  1026. if which nvidia-settings &>/dev/null && NRATE=$(nvidia-settings -q RefreshRate | grep '[0-9]') ; then
  1027. 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>"
  1028. FLAG_XYRES="disabled"
  1029. fi
  1030. XRANDR="`xrandr -q`"
  1031. 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)
  1032. 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.
  1033. xXYRESES="$(echo "$XRANDR"| tr -s ' ' | grep '^ [0-9]'|while read p
  1034. do
  1035. echo $p | awk '{print $1,$2}'
  1036. e=`echo $p | awk '{print $3}'`
  1037. if [ "$e" != "" ];then
  1038. [ "$e" = "+" ] && continue
  1039. echo $p | awk '{print $1,$3}'
  1040. fi
  1041. f=`echo $p | awk '{print $4}'`
  1042. if [ "$f" != "" ];then
  1043. [ "$f" = "+" ] && continue
  1044. echo $p | awk '{print $1,$4}'
  1045. fi
  1046. g=`echo $p | awk '{print $5}'`
  1047. if [ "$g" != "" ];then
  1048. [ "$g" = "+" ] && continue
  1049. echo $p | awk '{print $1,$5}'
  1050. fi
  1051. done)" #131121 #131124 sort out "+" ..is it necessary to go beyond $5?
  1052. LIST_XYRESES=""
  1053. [ "$xXYRESES" ] && LIST_XYRESES="$(echo "$xXYRESES" | sed -e 's%$% "" off%')"
  1054. echo "$LIST_XYRESES" > /var/local/quickset-xrandr-list
  1055. RESLINE=`grep -n ${DEF_XYRES} /var/local/quickset-xrandr-list|grep "\*"` #get the line number of default
  1056. RESLINE=${RESLINE%%:*}
  1057. sed -i -e 's% on$% off%' -e ""$RESLINE"s%off$%on%" /var/local/quickset-xrandr-list
  1058. DEFAULTXML=""
  1059. DEFAULT=`grep ' on$' /var/local/quickset-xrandr-list | sed -e 's% on$%%' -e 's%"%%g' -e "s% % ${TABCHAR}%"`
  1060. [ "$DEFAULT" ] && DEFAULTXML="<item>${DEFAULT}</item>" #111107 combobox does not support default tag.
  1061. 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`
  1062. [ "$SET_XWIZARD" ] && XRANDRWARNXML="<text><label>${M_xy}</label></text>"
  1063. XYRESXML='
  1064. <vbox space-expand="false" space-fill="false">
  1065. '${XRANDRWARNXML}'
  1066. <hbox tooltip-text="'$(gettext 'Xrandr Screen Resolution')'">
  1067. <combobox tooltip-text="'$(gettext 'Set screen resolution with xrandr')'">
  1068. '${DEFAULTXML}'
  1069. '${ITEMS}'
  1070. <variable>COMBO_XYRES</variable>
  1071. <visible>'${FLAG_XYRES}'</visible>
  1072. </combobox>
  1073. <button>
  1074. '"`/usr/lib/gtkdialog/xml_button-icon info mini`"'
  1075. <action>help resolution</action>
  1076. </button>
  1077. </hbox>
  1078. </vbox>'
  1079. fi #end SET_XRES
  1080. XXML='
  1081. <vbox>
  1082. <frame '${XFRAMETITLE}'>
  1083. '${XWIZARDXML}'
  1084. '${NVIDIABUTTON}'
  1085. '${XMSGXML}'
  1086. '${XYRESXML}'
  1087. </frame>
  1088. </vbox>'
  1089. fi
  1090. #120714 alternate audio/video frame for arm board... create $XXML...
  1091. if [ "$SET_RP_AUDIO" -o "$SET_RP_VIDEO" ];then
  1092. if [ "$SET_RP_AUDIO" ];then
  1093. RP_DEF_AUDIO='0'; RP_AUDIO_0_DEF='false'; RP_AUDIO_1_DEF='false'; RP_AUDIO_2_DEF='false'
  1094. if [ -f /etc/init.d/11alsa_raspi ];then
  1095. RP_DEF_AUDIO="`grep 'amixer cset numid' /etc/init.d/11alsa_raspi | rev | cut -f 1 -d ' ' | rev`" #0=auto, 1=analog, 2=hdmi.
  1096. else #precaution. script should be provided by 'z_raspi_fixes_hack' pet.
  1097. echo '#!/bin/sh
  1098. case $1 in
  1099. start)
  1100. amixer cset numid=3 0
  1101. ;;
  1102. esac' > /etc/init.d/11alsa_raspi
  1103. chmod 755 /etc/init.d/11alsa_raspi
  1104. fi
  1105. case $RP_DEF_AUDIO in
  1106. 1) RP_AUDIO_1_DEF='true' ;;
  1107. 2) RP_AUDIO_2_DEF='true' ;;
  1108. *) RP_AUDIO_0_DEF='true' ;;
  1109. esac
  1110. RP_AUDIOXML="<frame $(gettext 'Raspberry Pi Audio Settings')>
  1111. <radiobutton active=\"${RP_AUDIO_0_DEF}\"><label>$(gettext 'Automatic output routing')</label><variable>RP_AUDIO_0_RAD</variable></radiobutton>
  1112. <radiobutton active=\"${RP_AUDIO_1_DEF}\"><label>$(gettext 'Output to round analog socket')</label><variable>RP_AUDIO_1_RAD</variable></radiobutton>
  1113. <radiobutton active=\"${RP_AUDIO_2_DEF}\"><label>$(gettext 'Output to HDMI TV/monitor')</label><variable>RP_AUDIO_2_RAD</variable></radiobutton>
  1114. </frame>"
  1115. fi
  1116. if [ "$SET_RP_VIDEO" ];then
  1117. RP_VIDEOXML="<frame Raspberry Pi Video Settings>
  1118. <text><label>No fancy GUI here yet! Please edit file 'config.txt' in partition #1 then reboot.</label></text>
  1119. </frame>"
  1120. fi
  1121. XXML="<vbox>
  1122. ${RP_AUDIOXML}
  1123. ${RP_VIDEOXML}
  1124. </vbox>"
  1125. fi
  1126. ####main window####
  1127. ###################
  1128. [ $XPID -ne 0 ] && kill $XPID 2> /dev/null
  1129. BACKTITLEXML=""
  1130. [ "$BACKTITLE" ] && BACKTITLEXML="`/usr/lib/gtkdialog/xml_info fixed "$ICON.svg" 60 "$(gettext "${BACKTITLE}")"`"
  1131. [ "$MYBASE" = "quicksetup" ] && MOUSEXML='
  1132. <button space-expand="false" space-fill="false">
  1133. '"`/usr/lib/gtkdialog/xml_button-icon mouse.svg`"'
  1134. <action>mousecheck nowait</action>
  1135. </button>
  1136. <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>
  1137. '
  1138. WINWIDTH=""
  1139. WINWIDTHPARAM=""
  1140. B_cancel=$(gettext "Cancel")
  1141. export QUICKSETUP_DIALOG='
  1142. <window title="'${WINTITLE}'" window_position="1" icon-name="'${WINICON}'" '${WINWIDTHPARAM}'>
  1143. <vbox space-expand="true" space-fill="true">
  1144. '${BACKTITLEXML}'
  1145. <hbox space-expand="true" space-fill="true">
  1146. '${COUNTRYXML}'
  1147. '${XXML}'
  1148. </hbox>
  1149. '${NETWORK_XML}'
  1150. <hbox space-expand="false" space-fill="false">
  1151. '${MOUSEXML}'
  1152. <text space-expand="true" space-fill="true"><label>""</label></text>
  1153. <button space-expand="false" space-fill="false">
  1154. <label>'$(gettext "Ok")'</label>
  1155. '"`/usr/lib/gtkdialog/xml_button-icon ok`"'
  1156. <action>exit:OK</action>
  1157. </button>
  1158. '"`/usr/lib/gtkdialog/xml_scalegrip`"'
  1159. </hbox>
  1160. </vbox>
  1161. </window>'
  1162. ###display main window###
  1163. wPID=0
  1164. if [ $DISPLAY ];then
  1165. if [ -s /initrd/tmp/RWPART ];then #see init script in initrd, only exists if PUPMODE=5.
  1166. pdFLG=0
  1167. pdDEV="$(cat /initrd/tmp/RWPART | cut -f 1 -d '|')"
  1168. pdFS="$(cat /initrd/tmp/RWPART | cut -f 2 -d '|')"
  1169. pdMNTPT="$(cat /proc/mounts | grep "/dev/${pdDEV} " | cut -f 2 -d ' ')"
  1170. if [ ! "$pdMNTPT" ];then
  1171. mkdir -p /mnt/$pdDEV
  1172. mount -t $pdFS /dev/$pdDEV /mnt/$pdDEV
  1173. pdFLG=1
  1174. pdMNTPT="/mnt/${pdDEV}"
  1175. fi
  1176. [ -f ${pdMNTPT}/pupdesk.flg ] && echo -n "$XDRIVERSUCCESS" > ${pdMNTPT}/pupdesk.flg #init script (in initrd) will read this.
  1177. if [ $pdFLG -eq 1 ];then
  1178. sync
  1179. umount $pdMNTPT
  1180. fi
  1181. fi
  1182. #note: this mechanism of using pupdesk.flg to force run of xorgwizard at next boot, if user unable
  1183. #to click OK button below, is only for PUPMODE=5. When puppy has a save-file, /root/.XLOADED is used
  1184. #to manage forced reboot, see /usr/bin/xwin.
  1185. #note also, there is a totally different file on the "home" partition, fsckme.flg, that forces a
  1186. #f.s. check if a forced reboot/shutdown (such as power failure).
  1187. . /usr/lib/gtkdialog/xml_info gtk #build bg_pixmap for gtk-theme
  1188. RETVALS="`gtkdialog -p QUICKSETUP_DIALOG`"
  1189. eval "$RETVALS"
  1190. [ "$EXIT" != "OK" -a "$EXIT" != "NVIDIA" ] && exit
  1191. #130513 modify...
  1192. if [ -s /initrd/tmp/RWPART ];then #see init script in initrd.
  1193. pdFLG=0
  1194. pdDEV="$(cat /initrd/tmp/RWPART | cut -f 1 -d '|')"
  1195. pdFS="$(cat /initrd/tmp/RWPART | cut -f 2 -d '|')"
  1196. pdMNTPT="$(cat /proc/mounts | grep "/dev/${pdDEV} " | cut -f 2 -d ' ')"
  1197. if [ ! "$pdMNTPT" ];then
  1198. mkdir -p /mnt/$pdDEV
  1199. mount -t $pdFS /dev/$pdDEV /mnt/$pdDEV
  1200. pdFLG=1
  1201. pdMNTPT="/mnt/${pdDEV}"
  1202. fi
  1203. [ -f ${pdMNTPT}/pupdesk.flg ] && rm -f ${pdMNTPT}/pupdesk.flg
  1204. if [ $pdFLG -eq 1 ];then
  1205. sync
  1206. umount $pdMNTPT
  1207. fi
  1208. fi
  1209. #get rid of this, as causes xorgwizard to run at next boot (see /root/.profile)...
  1210. [ -f /root/.xorgwizard-reenter ] && rm -f /root/.xorgwizard-reenter
  1211. /usr/lib/gtkdialog/box_splash -close never -fontsize large -text "$(gettext 'Processing, please wait...')" & #120524
  1212. wPID=$!
  1213. else
  1214. #replace the old single-purpose text-mode scripts...
  1215. case $MYBASE in
  1216. chooselocale)
  1217. CHOICES="`cat /usr/share/i18n/dialog_table_cli | tr '\n' ' '`"
  1218. if [ "$PARAM2" = "quiet" ];then #120215 rc.country calls 'chooselocale cli quiet'
  1219. COMBO_LOCALE=${BASELANG} #LANG already chosen. ex: de_DE (.UTF-8 part is specified by UTF8)
  1220. else
  1221. echo "#!/bin/sh
  1222. 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
  1223. exit \$?" > /tmp/dialog-chooselocale
  1224. chmod 777 /tmp/dialog-chooselocale
  1225. /tmp/dialog-chooselocale
  1226. [ $? -ne 0 ] && exit
  1227. COMBO_LOCALE="`cat /tmp/chooselocale-choice | head -n 1`"
  1228. fi
  1229. CHECK_UTF8="$DEFAULT_UTF8" #dialog box does not have a UTF-8 checkbox.
  1230. ;;
  1231. timezone-set)
  1232. 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}"
  1233. eval $ZONEDLG 2>/tmp/zoneretval
  1234. [ $? -ne 0 ] && exit
  1235. COMBO_TIMEZONE="`cat /tmp/zoneretval`"
  1236. CHECK_UTC="$DEFAULT_UTC" #dialog box does not have a UTC checkbox.
  1237. ;;
  1238. *)
  1239. exit
  1240. ;;
  1241. esac
  1242. fi
  1243. ####process choices####
  1244. FLAG_CHANGED=""
  1245. if [ "$EXIT" = "NVIDIA" ];then
  1246. nvidia-settings
  1247. fi
  1248. if [ "$SET_KEYBOARD" ];then
  1249. #two variables COMBO_KEYBOARD and CHECK_NUMLOCK
  1250. NEW_KMAP="`echo -n "$COMBO_KEYBOARD" | cut -f 1 -d ' ' | cut -f 1 -d "$TABCHAR"`"
  1251. FONTMAP=""; CODEPAGE=""
  1252. if [ "$DEF_KMAP" != "$NEW_KMAP" ];then
  1253. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Keyboard Layout'):yes|" #111020 no need to restart X.
  1254. case $NEW_KMAP in #note, same code in /etc/rc.d/rc.country, init, and input-wizard.
  1255. de*|be*|br*|dk*|es*|fi*|fr*|it*|no*|se*|sv*|pt*)
  1256. modprobe nls_cp850
  1257. CODEPAGE="850"
  1258. ;;
  1259. cz*|hu*|pl*|ro*|sk*|croat*|slovene*)
  1260. modprobe nls_cp852
  1261. modprobe nls_iso8859-2
  1262. CODEPAGE="852"
  1263. ;;
  1264. esac
  1265. echo -n "${NEW_KMAP}${KEXT}" > /etc/keymap #120627
  1266. echo -n "$CODEPAGE" > /etc/codepage
  1267. keymap-set --load #111020 script by shinobar.
  1268. #120224 fontmap will be handled in locale code below.
  1269. fi
  1270. if [ "$DEFAULT_NUMLOCK" != "$CHECK_NUMLOCK" ];then
  1271. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Keyboard numlock'):yes|"
  1272. STATUS_NUMLOCK=off
  1273. [ "$CHECK_NUMLOCK" = "true" ] && STATUS_NUMLOCK=on
  1274. echo -e "#!/bin/sh\nnumlockx ${STATUS_NUMLOCK}" > /root/Startup/numlockx
  1275. chmod 755 /root/Startup/numlockx
  1276. numlockx ${STATUS_NUMLOCK} #do it now.
  1277. fi
  1278. fi #end SET_KEYBOARD
  1279. if [ "$SET_LOCALE" ];then
  1280. #two variables, COMBO_LOCALE and CHECK_UTF8
  1281. LANGCHOICE="`echo -n "$COMBO_LOCALE" | cut -f 1 -d ' ' | cut -f 1 -d '@'`" #nl_BE@euro, need to chop.
  1282. UTF8=""
  1283. [ "$CHECK_UTF8" = "true" ] && UTF8='.UTF-8'
  1284. #120215 rc.country calls 'chooselocale cli quiet'
  1285. [ "$PARAM2" = "quiet" ] && CURRLANG=en_US #so as to force below code block to run...
  1286. if [ "$LANGCHOICE" != "" -a "${LANGCHOICE}${UTF8}" != "$CURRLANG" ];then
  1287. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Main Language'):restart|"
  1288. # creates locale files in /usr/lib/locale...
  1289. OLDLANGLINE="LANG=$CURRLANG"
  1290. NEWLANGLINE="LANG=${LANGCHOICE}"
  1291. xUTF8="$UTF8"
  1292. if [ "$UTF8" != "" ];then #111022
  1293. NEWLANGLINE="LANG=${LANGCHOICE}"'.UTF-8'
  1294. xUTF8='.utf8'
  1295. fi
  1296. if [ "`locale -a | grep "${LANGCHOICE}${xUTF8}$"`" = "" ];then #120228 L18L bugfix.
  1297. if [ "$UTF8" = "" ];then
  1298. lcPATTERN='^'"${LANGCHOICE}"' '
  1299. CHARMAP="`grep "$lcPATTERN" /usr/share/i18n/SUPPORTED | head -n 1 | cut -f 2 -d ' '`"
  1300. if [ "$CHARMAP" != "" ];then #make sure have it...
  1301. cPATTERN="$CHARMAP"'\.gz'
  1302. [ "`ls -1 /usr/share/i18n/charmaps | grep '.gz$'`" = "" ] && cPATTERN="$CHARMAP"'$'
  1303. [ "`ls -1 /usr/share/i18n/charmaps | grep "$cPATTERN"`" = "" ] && CHARMAP=""
  1304. fi
  1305. if [ "$CHARMAP" != "" ];then
  1306. localedef -f $CHARMAP -i $LANGCHOICE --no-archive ${LANGCHOICE} > /dev/null
  1307. NEWLANGLINE="LANG=${LANGCHOICE}"
  1308. UTF8="" #120209
  1309. else
  1310. #no match, i think forced to use utf8... 111022 change name back to .utf8...
  1311. localedef -f UTF-8 -i $LANGCHOICE --no-archive ${LANGCHOICE}.utf8 > /dev/null
  1312. NEWLANGLINE="LANG=${LANGCHOICE}.UTF-8"
  1313. UTF8='.UTF-8'
  1314. fi
  1315. else
  1316. localedef -f UTF-8 -i $LANGCHOICE --no-archive ${LANGCHOICE}.utf8 > /dev/null #111022
  1317. NEWLANGLINE="LANG=${LANGCHOICE}.UTF-8"
  1318. fi
  1319. fi
  1320. NEWLANG="`echo -n "$NEWLANGLINE" | cut -f 2 -d '='`" #ex: de_DE.UTF-8
  1321. if [ "$OLDLANGLINE" != "$NEWLANGLINE" ];then
  1322. langPATTERN="s%^LANG=.*%${NEWLANGLINE}%" #111022
  1323. sed -i -e "$langPATTERN" /etc/profile
  1324. #120328 code moved up, to be compatible for chooselocale call from rc.country...
  1325. #120224 load console font... (code based on that in 'init')
  1326. #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)
  1327. case $NEWLANG in
  1328. en*)
  1329. #er, no, really want to unload all console fonts.
  1330. echo -n "" > /etc/fontmap #well, next boot, no font will be loaded.
  1331. ;;
  1332. ar*|iw*) #L18L no Greek
  1333. echo -n 'LatArCyrHeb-16.psfu' > /etc/fontmap
  1334. ;;
  1335. *) #L18L All European languages; new default ?!
  1336. echo -n 'LatGrkCyr-8x16.psfu' > /etc/fontmap
  1337. ;;
  1338. esac
  1339. fi
  1340. if [ "$PARAM2" = "quiet" ];then #120215 refer to /etc/rc.d/rc.country.
  1341. #scripts fixdesk and fixmenus translate files to new language (as specified in /usr/share/sss/menu_strings and desk_strings).
  1342. #so need to call them here...
  1343. #note, these are also called in /etc/rc.d/rc.update, and further down.
  1344. LANG=${NEWLANG} fixscripts
  1345. LANG=${NEWLANG} fixdesk
  1346. LANG=${NEWLANG} fixmenus
  1347. exit
  1348. fi
  1349. [ "$MYBASE" = "chooselocale" ] && [ "$PARAM1" = "cli" ] && exit #refer rc.country.
  1350. if [ "$OLDLANGLINE" != "$NEWLANGLINE" ];then
  1351. #120213 need language-pack...
  1352. LANG1=${LANGCHOICE%_*} #"`echo -n $LANGCHOICE | cut -f 1 -d '_'`" #ex: de
  1353. LANG12=${LANGCHOICE%.*} #"`echo -n $LANGCHOICE | cut -f 1 -d '.'`" #ex: de_DE
  1354. l1PTN="|langpack_${LANG1}|"
  1355. l12PTN="|langpack_${LANG12}|"
  1356. if [ "$LANG1" != "en" ];then
  1357. LANGFLAG='no'
  1358. [ "`grep "$l12PTN" /root/.packages/woof-installed-packages`" != "" ] && LANGFLAG='yes'
  1359. [ "`grep "$l12PTN" /root/.packages/user-installed-packages`" != "" ] && LANGFLAG='yes'
  1360. [ "`grep "$l1PTN" /root/.packages/woof-installed-packages`" != "" ] && LANGFLAG='yes'
  1361. [ "`grep "$l1PTN" /root/.packages/user-installed-packages`" != "" ] && LANGFLAG='yes'
  1362. if [ "$LANGFLAG" = "no" ];then
  1363. #check if a langpack available...
  1364. case $NEWLANG in #120313 hardcode translations... 120315
  1365. fr*) #French, esmourguit
  1366. 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.
  1367. 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."
  1368. 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)."
  1369. AVAILTITLE="Langpack nécessaire"
  1370. 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."
  1371. ;;
  1372. de*) #German, L18L
  1373. 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.
  1374. 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."
  1375. 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)."
  1376. AVAILTITLE="Sprachpaket erforderlich"
  1377. 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."
  1378. ;;
  1379. es*) #Spanish, vicmz
  1380. 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.
  1381. 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."
  1382. 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)."
  1383. AVAILTITLE="Se necesita un paquete de idioma"
  1384. 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. "
  1385. ;;
  1386. it*) #Italian, vicmz
  1387. 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.
  1388. 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."
  1389. 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)."
  1390. AVAILTITLE="È necessario un pacchetto di lingua"
  1391. 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."
  1392. ;;
  1393. nl*) #Netherlands (Dutch), FlyingDutchman 120701 fix...
  1394. 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.
  1395. 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."
  1396. 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)."
  1397. AVAILTITLE="Taalpakket nodig"
  1398. 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."
  1399. ;;
  1400. pl*) #120331 Polish, robwoj44 (Robert)
  1401. 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ę.
  1402. 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ć."
  1403. 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)."
  1404. AVAILTITLE="Pakiet językowy potrzebny"
  1405. 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."
  1406. ;;
  1407. pt*) #Portuguese, vicmz
  1408. 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.
  1409. 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."
  1410. 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)."
  1411. AVAILTITLE="Precisa-se de um pacote de língua"
  1412. 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. "
  1413. ;;
  1414. ru*) #Russian, rodin.s
  1415. AVAILMSG1="Есть подходящий пакет \\Zb${AVAILPACK}\\ZB в \\Zbnoarch\\ZB PET-репозитарии, в категории \\ZbSetup\\ZB. После того, как у вас появится подключение к Интернет нажмите значок \\Zbinstall\\ZB на рабочем столе для запуска Менеджера пакетов Puppy, затем выберите репозитарий и категорию.
  1416. Примечание: Перед загрузкой пакета локализации вы должны будете настроить подключение к Интернет и использовать Менеджер пакетов Puppy на английском. Если вы думаете, что не знаете английский достаточно хорошо, альтернатива - это запуск другой операционной системы, зайдете на http://distro.ibiblio.org/quirky/pet_packages-noarch и загрузите пакет локализации. После этого загрузите Puppy, нажмите на значок раздела на рабочем столе для монтирования раздела (на который вы загрузили пакет локализации), затем кликните на сам PET-пакет лангпака для его установки."
  1417. AVAILMSG2="Официальные пакеты локализации доступны в \\Zbnoarch\\ZB-репозитарии, однако для вашего языка нет пакета. Возможно пакет для вашего языка в разработке на форуме Puppy (будте осторожны, пакеты для старых версий Puppy не подходят). Или, возможно, вы захотите помочь и создать пакет -- Кликните Меню -> Справка -> HOWTO Internationalization (конечно же вам будет нужно хорошее знание английского языка)."
  1418. AVAILTITLE="Нужен пакет локализации"
  1419. AVAILMSG3="Локаль будет изменена на ${LANGCHOICE}, но вам нужно установить языковой пакет для перевода Puppy на ваш язык. Вам нужен PET-пакет с названием \\Zblangpack_${LANG12}\\ZB или \\Zblangpack_${LANG1}\\ZB. Этот процесс ещё не автоматизирован, так, что вам нужно загрузить и установить пакет. Вы можете сделать это в любое время в будущем. Официально поддерживаемые пакеты локализации доступны в Менеджере пакетов Puppy (кликните значок \\Zbinstall\\ZB на рабочем столе), в репозитарии \\Zbnoarch\\ZB."
  1420. ;;
  1421. es*) #Spanish,
  1422. 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.
  1423. 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."
  1424. 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)."
  1425. AVAILTITLE="Se necesita un paquete de idioma"
  1426. 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."
  1427. ;;
  1428. *)
  1429. 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.
  1430. 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."
  1431. 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)."
  1432. AVAILTITLE="Language pack needed"
  1433. 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."
  1434. ;;
  1435. esac
  1436. AVAILPACK=''
  1437. AVAILMSG="$AVAILMSG2"
  1438. [ "`grep "$l12PTN" /root/.packages/Packages-puppy-noarch-official`" != "" ] && AVAILPACK="langpack_${LANG12}"
  1439. [ "`grep "$l1PTN" /root/.packages/Packages-puppy-noarch-official`" != "" ] && AVAILPACK="langpack_${LANG1}"
  1440. [ "$AVAILPACK" ] && AVAILMSG="$AVAILMSG1"
  1441. if [ "$DISPLAY" ];then
  1442. [ $wPID -ne 0 ] && kill $wPID #120524
  1443. wPID=0
  1444. LANG=${NEWLANG} pupdialog --background '#8080FF' --colors --backtitle "${AVAILTITLE}" --msgbox "${AVAILMSG3}\n\n${AVAILMSG}" 0 0
  1445. else
  1446. 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
  1447. fi
  1448. fi
  1449. fi
  1450. #120215 offer to translate initrd... 120216 moved to separate script (so universal installer can also do it)...
  1451. GIVEITAGO='yes'
  1452. NEWLANG1=${NEWLANG%_*} #ex: en
  1453. #120401 change logic to call lang2initrd...
  1454. PLANG1=""
  1455. [ "PLANG" ] && PLANG1="${PLANG%_*}" #defined in PUPSTATE by initrd.
  1456. [ "$NEWLANG1" = "en" ] && GIVEITAGO='no'
  1457. if [ -f /var/local/lang2initrd.log ];then #read log from /usr/sbin/lang2initrd
  1458. [ "`grep "^DECLINED ${DISTRO_IDSTRING}" /var/local/lang2initrd.log`" != "" ] && GIVEITAGO='no'
  1459. [ "`grep "^SUCCESS ${DISTRO_IDSTRING}" /var/local/lang2initrd.log`" != "" ] && GIVEITAGO='no'
  1460. fi
  1461. if [ "$PLANG1" ];then #120401
  1462. [ "$PLANG" != "$NEWLANG" ] && GIVEITAGO='yes' #catch case of user only changing UTF-8 checkbox.
  1463. if [ "$PLANG1" != "$NEWLANG1" ];then
  1464. GIVEITAGO='yes'
  1465. [ "$NEWLANG1" != "en" ] && echo -n "" > /var/local/lang2initrd.log #so wmpoweroff/wmreboot can run lang2initrd after langpack installed.
  1466. fi
  1467. fi
  1468. [ "$GIVEITAGO" = "yes" ] && /usr/sbin/lang2initrd $NEWLANG #note, script has more tests, then asks if want translate initrd.
  1469. #120209 scripts fixdesk and fixmenus translate files to new language (as specified in /usr/share/sss/menu_strings and desk_strings).
  1470. #so need to call them here...
  1471. #note, these are also called in /etc/rc.d/rc.update ...
  1472. LANG=${LANGCHOICE}${UTF8} fixscripts
  1473. LANG=${LANGCHOICE}${UTF8} fixdesk
  1474. LANG=${LANGCHOICE}${UTF8} fixmenus
  1475. #...no need to refresh screen, as changing locale requires restart of X.
  1476. fi
  1477. fi
  1478. fi #end SET_LOCALE
  1479. if [ "$SET_TIMEZONE" ];then
  1480. #two variables, COMBO_TIMEZONE and CHECK_UTC
  1481. ZONERETVAL="`echo -n "$COMBO_TIMEZONE" | cut -f 1 -d ' ' | cut -f 1 -d "$TABCHAR"`"
  1482. NEW_HWCLOCKTIME="localtime"
  1483. [ "$CHECK_UTC" = "true" ] && NEW_HWCLOCKTIME="utc"
  1484. [ ! -e /etc/localtime ] && DEF_TIMEZONE="" #111027 precaution.
  1485. if [ "$DEF_TIMEZONE" != "$ZONERETVAL" -o "$HWCLOCKTIME" != "$NEW_HWCLOCKTIME" ];then
  1486. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Time Zone'):yes|"
  1487. [ "`echo "$ZONERETVAL" | grep 'GMT'`" != "" ] && ZONERETVAL="Etc/$ZONERETVAL"
  1488. #111103 these are also in Etc dir...
  1489. [ "$ZONERETVAL" = "Greenwich" ] && ZONERETVAL="Etc/$ZONERETVAL"
  1490. [ "$ZONERETVAL" = "UCT" ] && ZONERETVAL="Etc/$ZONERETVAL"
  1491. [ "$ZONERETVAL" = "Universal" ] && ZONERETVAL="Etc/$ZONERETVAL"
  1492. [ "$ZONERETVAL" = "UTC" ] && ZONERETVAL="Etc/$ZONERETVAL"
  1493. [ "$ZONERETVAL" = "Zulu" ] && ZONERETVAL="Etc/$ZONERETVAL"
  1494. ln -snf /usr/share/zoneinfo/$ZONERETVAL /etc/localtime
  1495. which xset &>/dev/null && xset s noblank s noexpose -dpms #shinobar 30jan11: avoid the screen go to blank
  1496. [ -f /etc/TZ ] && rm -f /etc/TZ #don't think need this anymore. also removed from /etc/profile.
  1497. #.../etc/profile now reads /etc/localtime and exports TZ variable.
  1498. #need to set Linux system time/date, from hardware clock...
  1499. hwclock --hctosys --${NEW_HWCLOCKTIME} #NEW_HWCLOCKTIME=localtime or utc
  1500. [ $? = 0 ] || hwclock --hctosys --${NEW_HWCLOCKTIME} --directisa #try --directisa if reading from /dev/rtc fails
  1501. #...--hctosys reads cmos clock to system, referencing /usr/share/zoneinfo/localtime
  1502. echo "#this is read/written by /usr/sbin/quicksetup, timezone-set
  1503. HWCLOCKTIME=${NEW_HWCLOCKTIME}" > /etc/clock
  1504. fi
  1505. fi #end SET_TIMEZONE
  1506. if [ "$SET_XRES" ];then
  1507. #one variable COMBO_XYRES
  1508. #note, similar code in xrandshell.
  1509. NEW_XYRES="$(echo -n "$COMBO_XYRES" | tr '\t' ' ' | cut -f 1 -d ' ')" #130202
  1510. NEW_VFREQ="$(echo -n "$COMBO_XYRES" | tr '\t' ' ' | tr -s ' ' | cut -f 2 -d ' ' | cut -f 1 -d '*')" #130202
  1511. if [ "$DEF_XYRES$DEF_VFREQ" != "$NEW_XYRES$NEW_VFREQ" ];then
  1512. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Xrandr Screen Resolution'):yes|"
  1513. T_yesno="`gettext 'Change resolution to:'`"
  1514. M_yesno1="`gettext 'Click the OK button to change the resolution.'`"
  1515. M_yesno2="`gettext 'If the new resolution does not work, wait 60 seconds, or hit the CTRL-ALT-BACKSPACE key combination to kill X.'`"
  1516. M_yesno3="$(gettext 'Note, the drive icons may be in wrong place after resolution change, but will be correct after X is restarted.')" #120226
  1517. [ $wPID -ne 0 ] && kill $wPID #120524
  1518. wPID=0
  1519. 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
  1520. if [ $? -eq 0 ];then
  1521. echo "ICONWIPE" > /var/local/pup_event_icon_change_flag #120226 .xinitrc -> clean_desk_icons will read this, and redraw drive icons.
  1522. sync
  1523. xrandr -s $NEW_XYRES -r $NEW_VFREQ 2>/tmp/xrandr_error #this changes the screen resolution. #130202 add freq.
  1524. if [ "$?" -ne "0" ];then
  1525. # try without frequency
  1526. xrandr -s $NEW_XYRES 2>/dev/null
  1527. bFLG=1 #flag so correct entry entered to /etc/xrandrindex
  1528. if [ "$?" -ne "0" ];then
  1529. BMSG=`cat /tmp/xrandr_error`
  1530. /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
  1531. rm /tmp/xrandr_error
  1532. unset bFLG
  1533. exit
  1534. fi
  1535. fi
  1536. XRANDR="`xrandr -q`"
  1537. TESTLINE="$(echo "$XRANDR" | tr -s " " | grep "^ [0-9]" | grep '\*' | head -n 1)" #130202 'head -n 1' workaround for dual monitors (see also .xinitrc).
  1538. TESTX="`echo -n "$TESTLINE" | cut -f 2 -d " " | cut -f 1 -d 'x'`"
  1539. TESTY="`echo -n "$TESTLINE" | cut -f 2 -d " " | cut -f 2 -d 'x'`"
  1540. TESTVR="`echo -n "$TESTLINE" |tr ' ' '\n' | grep "\*" | cut -f 1 -d '*'`"
  1541. M_y0=$(gettext 'Can you see this?')
  1542. M_y1=$(gettext "Click <b>Permanent</b> button to keep this resolution permanently.
  1543. Click <b>Session</b> button to keep this resolution for current session only.
  1544. Click <b>Cancel</b> button to revert to default resolution.")
  1545. M_y2=$(gettext "<b>Warning</b>
  1546. 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.")
  1547. B_permanent=$(gettext 'Permanent')
  1548. B_session=$(gettext 'Session')
  1549. STEP=6 # timeout is x10sec
  1550. fontsize="x-large" # small, medium, large, x-large 130203 fix insertion of fontsize...
  1551. export XY_DIALOG="<window title=\"$WINTITLE\" icon-name=\"gtk-preferences\"><vbox>
  1552. <text use-markup=\"true\"><label>\"<span size='${fontsize}'>${M_y0}</span>\"</label></text>
  1553. <text use-markup=\"true\"><label>\"${M_y1}\"</label></text>
  1554. <text use-markup=\"true\"><label>\"${M_y2}\"</label></text>
  1555. <progressbar><input>for i in \$(seq 0 10 100); do echo \$i; sleep $STEP; done;echo 100</input>
  1556. <label>$(gettext 'Or, it will be canceled in 60 seconds.')</label>
  1557. <action type=\"exit\">TIMEOUT</action></progressbar>
  1558. <hbox>
  1559. <button><label>${B_permanent}</label><action>EXIT:permanent</action></button>
  1560. <button><label>${B_session}</label><action>EXIT:session</action></button>
  1561. <button><label>${B_cancel}</label><action>EXIT:cancel</action></button>
  1562. </hbox>
  1563. </vbox></window>"
  1564. eval $(gtkdialog -p XY_DIALOG --center)
  1565. case $EXIT in
  1566. permanent)
  1567. case $bFLG in
  1568. 1)echo -n "${TESTX}x${TESTY}" > /etc/xrandrindex ;;
  1569. *)echo -n "${TESTX}x${TESTY}@${TESTVR}" > /etc/xrandrindex ;; #so will be set in .xinitrc at next X start. #130202 added freq.
  1570. esac
  1571. ;;
  1572. session)
  1573. rm -f /etc/xrandrindex
  1574. ;;
  1575. *)
  1576. rm -f /etc/xrandrindex
  1577. xrandr -s $DEF_XYRES -r $DEF_VFREQ #restore to what it was before. #130202 added freq.
  1578. ;;
  1579. esac
  1580. fi
  1581. fi
  1582. fi #end SET_XRES
  1583. if [ "$SET_XWIZARD" ];then
  1584. if [ "$CHECK_XUPGRADE" = "true" ];then
  1585. #FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Video Upgrade Wizard'):yes|" #"Video Upgrade Wizard"
  1586. /usr/sbin/video_upgrade_wizard
  1587. fi
  1588. if [ "$CHECK_XORGWIZARD" = "true" ];then
  1589. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Xorg Video Wizard'):restart|" #"Xorg Video Wizard"
  1590. sed -i -e "s%^DISTRO_XORG_AUTO.*%DISTRO_XORG_AUTO='no'%" /etc/DISTRO_SPECS #/usr/bin/xwin reads this when X starts.
  1591. mv -f /etc/X11/xorg.conf /etc/X11/xorg.conf.prev 2>/dev/null #/usr/bin/xwin will then run xorgwizard.
  1592. 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.
  1593. fi
  1594. fi #end SET_XWIZARD
  1595. if [ "$SET_NETWORK" ];then #120227
  1596. #120625 set new hostname...
  1597. OLD_HOSTNAME="$HOSTNAME"
  1598. if [ "$OLD_HOSTNAME" != "$ENTRY_HOSTNAME" ];then
  1599. /usr/sbin/hostname-set $ENTRY_HOSTNAME
  1600. HOSTNAMEFLAG=$?
  1601. [ "$HOSTNAMEFLAG" = "0" ] && FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Hostname'):restart|"
  1602. [ "$HOSTNAMEFLAG" = "2" ] && FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Hostname'):yes|" #130511 see hostname-set.
  1603. fi
  1604. #120625...
  1605. if [ "$CHECK_FIREWALL" != "$DEFAULT_FIREWALL" ];then
  1606. if [ "$CHECK_FIREWALL" = "false" ];then
  1607. /etc/rc.d/rc.firewall stop
  1608. chmod 664 /etc/rc.d/rc.firewall #so that /etc/rc.d/rc.local won't start it.
  1609. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Firewall disabled'):yes|"
  1610. else
  1611. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Firewall enabled'):yes|"
  1612. if [ -f /etc/rc.d/rc.firewall ];then
  1613. chmod 755 /etc/rc.d/rc.firewall #so that /etc/rc.d/rc.local will start firewall at bootup.
  1614. /etc/rc.d/rc.firewall start
  1615. else
  1616. rxvt -bg LightYellow -title "Firewall setup" -e firewallinstallshell
  1617. fi
  1618. fi
  1619. fi
  1620. #120625...
  1621. if [ "$CHECK_NTP" != "$DEFAULT_NTP" ];then
  1622. if [ "$CHECK_NTP" = "false" ];then
  1623. chmod 664 /root/Startup/timesync.sh #so it won't run next bootup.
  1624. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'NTP set-time disabled'):yes|"
  1625. else
  1626. [ -f /root/Startup/timesync.sh ] && chmod 755 /root/Startup/timesync.sh
  1627. if [ -x /root/Startup/timesync.sh ];then
  1628. /root/Startup/timesync.sh &
  1629. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'NTP set-time enabled'):yes|"
  1630. else
  1631. /usr/local/psync/psync
  1632. if [ -x /root/Startup/timesync.sh ];then
  1633. FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'NTP set-time enabled'):yes|"
  1634. else
  1635. #/tmp/settertime created by /usr/local/psync/psyncfunc
  1636. [ -f /tmp/settertime ] && FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'NTP set-time (this session only)'):yes|"
  1637. fi
  1638. fi
  1639. fi
  1640. fi
  1641. #130701...
  1642. if [ $DISPLAY ];then
  1643. if [ "$CHECK_SPOT" = "true" ];then
  1644. [ $wPID -ne 0 ] && kill $wPID
  1645. wPID=0
  1646. loginmanager
  1647. fi
  1648. fi
  1649. fi
  1650. #120714 raspberry pi support...
  1651. if [ "$SET_RP_AUDIO" -o "$SET_RP_VIDEO" ];then
  1652. if [ "$SET_RP_AUDIO" ];then
  1653. RP_AUDIO_OUT='0'
  1654. [ "$RP_AUDIO_0_RAD" = "true" ] && RP_AUDIO_OUT='0' #auto
  1655. [ "$RP_AUDIO_1_RAD" = "true" ] && RP_AUDIO_OUT='1' #analog
  1656. [ "$RP_AUDIO_2_RAD" = "true" ] && RP_AUDIO_OUT='2' #hdmi
  1657. if [ "$RP_DEF_AUDIO" != "$RP_AUDIO_OUT" ];then
  1658. rpPTN="s%amixer cset numid.*%amixer cset numid=3 ${RP_AUDIO_OUT}%"
  1659. sed -i -e "$rpPTN" /etc/init.d/11alsa_raspi
  1660. amixer cset numid=3 ${RP_AUDIO_OUT} #do it now.
  1661. case $RP_AUDIO_OUT in
  1662. 0) FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Automatic audio output'):yes|" ;;
  1663. 1) FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'Analog audio output'):yes|" ;;
  1664. 2) FLAG_CHANGED="${FLAG_CHANGED}$(gettext 'HDMI audio output'):yes|" ;;
  1665. esac
  1666. fi
  1667. fi
  1668. if [ "$SET_RP_VIDEO" ];then
  1669. echo
  1670. fi
  1671. fi
  1672. [ ! $DISPLAY ] && exit
  1673. if [ "`echo -n "$FLAG_CHANGED" | grep "restart"`" != "" ];then
  1674. F_restart="`gettext 'restart'`"
  1675. rPTN="s%:restart% <b><big>${F_restart}</big></b>%"
  1676. CHANGEDMARKUP="`echo "$FLAG_CHANGED" | tr '|' '\n' | sed -e "$rPTN" | cut -f 1 -d ':'`"
  1677. H_t1="`gettext 'Quick Setup: finished'`"
  1678. B_restart="`gettext 'Restart X'`"
  1679. B_exit="`gettext 'Exit'`"
  1680. M_fc0="`gettext 'These are the changed items:'`"
  1681. 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).'`"
  1682. 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.'`"
  1683. 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.'`"
  1684. export FC_DIALOG="<window title=\"${H_t1}\" window_position=\"1\" icon-name=\"${WINICON}\">
  1685. <vbox>
  1686. <text use-markup=\"true\"><label>\"${M_fc0}\"</label></text>
  1687. <text use-markup=\"true\"><label>\"<i>${CHANGEDMARKUP}</i>\"</label></text>
  1688. <text use-markup=\"true\"><label>\"${M_fc1}\"</label></text>
  1689. <text use-markup=\"true\"><label>\"${M_fc2}\"</label></text>
  1690. <text use-markup=\"true\"><label>\"${M_fc3}\"</label></text>
  1691. <hbox>
  1692. <button><label>${B_restart}</label><input file stock=\"gtk-redo\"></input><action>EXIT:OK</action></button>
  1693. <button><label>${B_exit}</label><input file stock=\"gtk-quit\"></input><action>EXIT:cancel</action></button>
  1694. </hbox>
  1695. </vbox>
  1696. </window>"
  1697. [ $wPID -ne 0 ] && kill $wPID #120524
  1698. wPID=0
  1699. RETVALS="`gtkdialog -p FC_DIALOG`"
  1700. eval "$RETVALS"
  1701. if [ "$EXIT" = "OK" ];then
  1702. rm -rf /tmp/.X0-lock
  1703. sync
  1704. exec restartwm `cat /etc/windowmanager`
  1705. fi
  1706. fi
  1707. [ $wPID -ne 0 ] && kill $wPID #120524
  1708. wPID=0
  1709. ###END###