X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F30accessibility;h=75bfae497ec88cb5f43f69446ca0a80d804e8d41;hb=c967ebfc4e43fb16a0c2c140c66900712be95ab7;hp=eaf3a504ea1c25752adeb636b8265db52cca314e;hpb=cc8532df0a706a167cfd423bc13a69b7be9ffef9;p=live-boot-grml.git diff --git a/scripts/live-bottom/30accessibility b/scripts/live-bottom/30accessibility index eaf3a50..75bfae4 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 @@ -41,6 +47,25 @@ gct () fi } +remove_applet () +{ + # Code to remove an applet from the default panel setup + # This is rather hacky, but I can't think of a one or two line regular + # expression to do this any more efficiently. Patches welcome. In + # addition, setting these via gconf also doesn't work for some reason. + + local line_no prior_line next_line + + line_no="$(grep -n "$1" /root/usr/share/gconf/defaults/05_panel-default-setup.entries | cut -f 1 -d :)" + [ "$line_no" ] || return + prior_line="$((line_no-1))" + next_line="$((line_no+1))" + + sed -i -n "${prior_line},${next_line}!p" /root/usr/share/gconf/defaults/05_panel-default-setup.entries + + chroot /root update-gconf-defaults +} + case ${ACCESS} in access=v1) # Lesser Visual Impairment @@ -62,13 +87,18 @@ case ${ACCESS} in # 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 string /desktop/gnome/applications/at/visual/exec orca gct -s -t bool /apps/gksu/disable-grab true + gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity + sed -i -e 's/# Host alias specification/Defaults\tenv_keep = "ORBIT_SOCKETDIR XDG_SESSION_COOKIE GTK_MODULES"\n\n# Host alias specification/g' /root/etc/sudoers - if type orca > /dev/null 2>&1 + if [ -x /root/usr/bin/orca ] then mkdir -p /root/home/${USERNAME}/.orca - echo "orca.settings.enableSpeech = False" >> /root/home/${USERNAME}/.orca/orca-customizations.py - echo "orca.settings.enableMagnifier = True" >> /root/home/${USERNAME}/.orca/orca-customizations.py + 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 fi ;; @@ -78,21 +108,41 @@ case ${ACCESS} in #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 string /desktop/gnome/applications/at/visual/exec orca + gct -s -t string /apps/empathy/conversation/theme classic gct -s -t bool /apps/gksu/disable-grab true + gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity + sed -i -e 's/# Host alias specification/Defaults\tenv_keep = "ORBIT_SOCKETDIR XDG_SESSION_COOKIE GTK_MODULES"\n\n# Host alias specification/g' /root/etc/sudoers + + remove_applet fast_user_switch + if [ -x /root/usr/bin/orca ] + then + mkdir -p /root/home/$USERNAME/.orca + chroot /root chown -R $USERNAME.$USERNAME /home/$USERNAME/.orca + 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 string /desktop/gnome/applications/at/visual/exec orca gct -s -t bool /apps/gksu/disable-grab true + gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity + gct -s -t string /apps/empathy/conversation/theme classic + sed -i -e 's/# Host alias specification/Defaults\tenv_keep = "ORBIT_SOCKETDIR XDG_SESSION_COOKIE GTK_MODULES"\n\n# Host alias specification/g' /root/etc/sudoers - if type orca > /dev/null 2>&1 + if [ -x /root/usr/bin/orca ] then mkdir -p /root/home/${USERNAME}/.orca - echo "orca.settings.enableSpeech = False" >> /root/home/${USERNAME}/.orca/orca-customizations.py - echo "orca.settings.enableBraille = True" >> /root/home/${USERNAME}/.orca/orca-customizations.py + 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 + laptop_detect + chroot /root chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.orca fi + + remove_applet fast_user_switch ;; access=m1)