slitaz-tools rev 933
tazx:Undo previous, already checked in rcS. (except check for lxpanel & app*.conf not required). Read video= from /proc/cmdline("tazx config-xorg" only)
author | Xander Ziiryanoff <psychomaniak@xakep.ru> |
---|---|
date | Fri Dec 19 14:11:25 2014 +0000 (2014-12-19) |
parents | dcdd11dd6fe9 |
children | 90d52d0d4775 |
files | tinyutils/tazx |
line diff
1.1 --- a/tinyutils/tazx Thu Dec 18 21:46:43 2014 +0000 1.2 +++ b/tinyutils/tazx Fri Dec 19 14:11:25 2014 +0000 1.3 @@ -473,7 +473,8 @@ 1.4 slitaz_apps_conf() { 1.5 apps_conf=/etc/slitaz/applications.conf 1.6 1.7 -if [ -f $apps_conf ]; then 1.8 + [ -f $apps_conf ] || inst_pkg slitaz-configs --forced 1.9 + 1.10 if [ "$(id -u)" = 0 ]; then 1.11 user_conf=$apps_conf 1.12 new_user_conf="/etc/skel/.config/slitaz/applications.conf" 1.13 @@ -487,14 +488,41 @@ 1.14 cp $apps_conf $user_conf 1.15 fi 1.16 fi 1.17 -else 1.18 - [ "$1" == 'init' ] || inst_pkg slitaz-configs --forced 1.19 -fi 1.20 - 1.21 [ -f "$HOME/.xinitrc" ] || inst_pkg slitaz-configs-base --forced 1.22 } 1.23 1.24 1.25 +# Handle live options: screen= video= 1.26 +proc_cmdline() 1.27 +{ 1.28 + if grep -qs 'screen=' /proc/cmdline ; then 1.29 + MODE="$(sed 's/.*screen=\([0-9]*x[0-9]*\).*/\1/' < /proc/cmdline)" 1.30 + sed "s/.*EndSubSection.*/\\t\\tModes\\t\"$MODE\"\\n&/" \ 1.31 + -i ${xorg_config}/70-Screen.conf 1.32 + elif grep -qs 'video=' /proc/cmdline ; then 1.33 + MODE="$(sed 's/.*video=\([0-9]*x[0-9]*\).*/\1/' < /proc/cmdline)" 1.34 + DEPTH=$(sed 's/.*video=.*-\([0-9]*\).*/\1/' < /proc/cmdline) 1.35 + sed "s/.*EndSubSection.*/\\t\\tModes\\t\"$MODE\"\\n&/" \ 1.36 + -i ${xorg_config}/70-Screen.conf 1.37 + set_depth $DEPTH 1.38 + fi 1.39 +} 1.40 + 1.41 +set_depth() 1.42 +{ 1.43 + case "$1" in 1.44 + 8|15|16|24) colors=$1 ;; 1.45 + *) 1.46 + exec 3>&1 1.47 + colors=$($DIALOG --menu " " 12 12 12 \ 1.48 + 24 truecolor 16 hicolor 15 hicolor 8 256colors 2>&1 1>&3) 1.49 + dialog_end ;; 1.50 + esac 1.51 + sed 's|Monitor.*"$|&\n\tDefaultDepth '$colors'|' -i ${xorg_config}/70-Screen.conf 1.52 +} 1.53 + 1.54 + 1.55 + 1.56 # Commands 1.57 1.58 case "$1" in 1.59 @@ -507,18 +535,13 @@ 1.60 check_root 1.61 slitaz_apps_conf 1.62 xorg_conf_d 1.63 - # Handle live option: screen= 1.64 - if grep -qs 'screen=' /proc/cmdline ; then 1.65 - MODE="$(sed 's/.*screen=\([0-9]*x[0-9]*\).*/\1/' < /proc/cmdline)" 1.66 - sed -i "s/.*EndSubSection.*/\\t\\tModes\\t\"$MODE\"\\n&/" \ 1.67 - /etc/X11/xorg.conf.d/70-Screen.conf 1.68 - fi ;; 1.69 + proc_cmdline ;; 1.70 1.71 init) 1.72 # We don't need much config files with last Xorg version, So just 1.73 # get files for starting an X session and config the keyboard. 1.74 check_root 1.75 - slitaz_apps_conf init 1.76 + slitaz_apps_conf 1.77 keyboard_conf 1.78 gen_xorg_conf_file ;; 1.79 1.80 @@ -535,22 +558,12 @@ 1.81 bpp) 1.82 check_root 1.83 xorg_conf_d 1.84 - case "$2" in 1.85 - 8|15|16|24) 1.86 - colors=$2 ;; 1.87 - *) 1.88 - exec 3>&1 1.89 - colors=$($DIALOG --menu " " 12 12 12 \ 1.90 - 24 truecolor 16 hicolor 15 hicolor 8 256colors 2>&1 1>&3) 1.91 - dialog_end ;; 1.92 - esac 1.93 - sed 's|Monitor.*"$|&\n\tDefaultDepth '$colors'|' \ 1.94 - -i ${xorg_config}/70-Screen.conf ;; 1.95 + set_depth $2 ;; 1.96 1.97 xkb) 1.98 xkb ;; 1.99 1.100 - *help) 1.101 + *help|-h|-?) 1.102 emsg " 1.103 <b>tazx</b> - $(_ 'Configuration tool for SliTaz GNU/Linux') 1.104