X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F30accessibility;h=3ff3fda0d8235db41ed3b97b2ec27ef349291b4b;hb=45dc5f16b790ce5b8b46a48ca582c8da2a881dff;hp=2a91157a2a821551b219784b383cda1db3664119;hpb=c3e20f8ca4cd37d2641007947e58c781fd501f11;p=live-boot-grml.git diff --git a/scripts/live-bottom/30accessibility b/scripts/live-bottom/30accessibility index 2a91157..3ff3fda 100755 --- a/scripts/live-bottom/30accessibility +++ b/scripts/live-bottom/30accessibility @@ -47,6 +47,33 @@ gct () fi } +laptop_detect () +{ + if chroot /root /usr/sbin/laptop-detect + then + echo "orca.settings.orcaModifierKeys = orca.settings.LAPTOP_MODIFIER_KEYS" >> /root/home/$USERNAME/.orca/user-settings.py + echo "orca.settings.keyboardLayout = orca.settings.GENERAL_KEYBOARD_LAYOUT_LAPTOP" >> /root/home/$USERNAME/.orca/user-settings.py + 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 :)" + 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 @@ -68,7 +95,9 @@ 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 if [ -x /root/usr/bin/orca ] then @@ -76,6 +105,7 @@ case ${ACCESS} in 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 + laptop_detect chroot /root chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.orca fi ;; @@ -86,14 +116,18 @@ 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 bool /apps/gksu/disable-grab true gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity + + remove_applet fast_user_switch ;; 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 @@ -103,8 +137,11 @@ case ${ACCESS} in 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)