X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F30accessibility;h=d838d76898b54ef4acaeecaca4db60b29069fa31;hb=2c649cf1f86f2030a213b9b0bfc1d1a1f0c14b2c;hp=17defbf3ee8f48e8d4c8b271e91bf31cbb18d91d;hpb=fdd8036ba32ad88e83a61191cc4597ae060355d2;p=live-boot-grml.git diff --git a/scripts/live-bottom/30accessibility b/scripts/live-bottom/30accessibility index 17defbf..d838d76 100755 --- a/scripts/live-bottom/30accessibility +++ b/scripts/live-bottom/30accessibility @@ -27,7 +27,13 @@ fi . /scripts/live-functions -log_begin_msg "Configuring accessibility options..." +if [ -z "${USERNAME}" ] +then + echo "No default user for accessibility options." + exit 0 +fi + +log_begin_msg "Configuring accessibility options" # live-initramfs script @@ -35,17 +41,9 @@ gconf_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gc gct () { - if [ "$gconf_version" ] - then - chroot /root sudo -u "$USERNAME" gconftool-2 "$@" - fi -} - -kderc_addtoprefixes () -{ - if [ -e "/root/etc/kderc" ] + if [ "${gconf_version}" ] then - sed -i "s|\\(prefixes=/usr/share/kubuntu-default-settings/kde-profile/default/\\)|\\1,$1|" /root/etc/kderc + chroot /root sudo -u "${USERNAME}" gconftool-2 "${@}" fi } @@ -64,27 +62,26 @@ case ${ACCESS} in gct -s -t string /desktop/gnome/background/color_shading_type solid gct -s -t int /desktop/gnome/peripherals/mouse/cursor_size 48 gct -s -t string /desktop/gnome/peripherals/mouse/cursor_theme whiteglass - - kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/lesser-visual-impairment/ - - if [ -d /root/usr/share/xubuntu-default-settings/accessibility ] - then - cp -a /root/usr/share/xubuntu-default-settings/accessibility/* /root/etc/xdg/ - fi ;; access=v2) # Moderate Visual Impairment gct -s -t bool /desktop/gnome/interface/accessibility true - gct -s -t bool /desktop/gnome/applications/at/visual/startup true gct -s -t bool /apps/gksu/disable-grab true + gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity - if [ -e /root/usr/share/pycentral/gnome-orca/site-packages/orca/settings.py ] + if [ -x /root/usr/bin/orca ] then - sed -i '/^enableSpeech\W/ s/True/False/;/^enableMagnifier/ s/False/True/' /root/usr/share/pycentral/gnome-orca/site-packages/orca/settings.py + mkdir -p /root/home/${USERNAME}/.orca + echo "import orca.settings" >> /root/home/${USERNAME}/.orca/user-settings.py + echo "orca.settings.enableSpeech = False" >> /root/home/${USERNAME}/.orca/user-settings.py + echo "orca.settings.enableMagnifier = True" >> /root/home/${USERNAME}/.orca/user-settings.py + chroot /root chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.orca + + mkdir -p /root/home/${USERNAME}/.config/autostart + cp /root/usr/share/applications/orca.desktop /root/home/${USERNAME}/.config/autostart + chroot /root chown -R ${USERNAME}.${USERNAME} /home/${USERNAME}/.config fi - - kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/lesser-visual-impairment/,/usr/share/kubuntu-default-settings/kde-profile/moderate-visual-impairment/ ;; access=v3) @@ -92,19 +89,34 @@ case ${ACCESS} in # Disabled for now, until we know eSpeak works. #gct -s -t bool /desktop/gnome/sound/enable_esd false gct -s -t bool /desktop/gnome/interface/accessibility true - gct -s -t bool /desktop/gnome/applications/at/visual/startup true gct -s -t bool /apps/gksu/disable-grab true + gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity + + if [ -x /root/usr/bin/orca ] + then + mkdir -p /root/home/${USERNAME}/.config/autostart + cp /root/usr/share/applications/orca.desktop /root/home/${USERNAME}/.config/autostart + chroot /root chown -R ${USERNAME}.${USERNAME} /home/${USERNAME}/.config + fi ;; braille=ask) # Braille gct -s -t bool /desktop/gnome/interface/accessibility true - gct -s -t bool /desktop/gnome/applications/at/visual/startup true gct -s -t bool /apps/gksu/disable-grab true + gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity - if [ -e /root/usr/share/pycentral/gnome-orca/site-packages/orca/settings.py ] + if [ -x /root/usr/bin/orca ] then - sed -i '/^enableSpeech\W/ s/True/False/;/^enableBraille/ s/False/True/' /root/usr/share/pycentral/gnome-orca/site-packages/orca/settings.py + mkdir -p /root/home/${USERNAME}/.orca + echo "import orca.settings" >> /root/home/${USERNAME}/.orca/user-settings.py + echo "orca.settings.enableSpeech = False" >> /root/home/${USERNAME}/.orca/user-settings.py + echo "orca.settings.enableBraille = True" >> /root/home/${USERNAME}/.orca/user-settings.py + chroot /root chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.orca + + mkdir -p /root/home/${USERNAME}/.config/autostart + cp /root/usr/share/applications/orca.desktop /root/home/${USERNAME}/.config/autostart + chroot /root chown -R ${USERNAME}.${USERNAME} /home/${USERNAME}/.config fi ;; @@ -120,8 +132,6 @@ case ${ACCESS} in gct -s -t int /desktop/gnome/peripherals/keyboard/rate 10 gct -s -t bool /apps/gksu/disable-grab true - kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/minor-motor-difficulties/ - if [ -e /root/etc/xdg/xfce4/mcs_settings/keyboard.xml ] then sed -i 's/0/1/' /root/etc/xdg/xfce4/mcs_settings/keyboard.xml @@ -137,8 +147,6 @@ case ${ACCESS} in gct -s -t bool /desktop/accessibility/gnome/keyboard/stickykeys_two_key_off false gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [onboard] - kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/minor-motor-difficulties/,/usr/share/kubuntu-default-settings/kde-profile/motor-difficulties-pointing-devices/ - if [ -e /root/etc/xdg/xfce4/mcs_settings/keyboard.xml ] then sed -i '/Sticky/ s/0/1/' /root/etc/xdg/xfce4/mcs_settings/keyboard.xml