X-Git-Url: http://git.grml.org/?a=blobdiff_plain;ds=inline;f=scripts%2Flive-bottom%2F30accessibility;h=4ed1c6d62119c047b6345c5399a53e8eeeb33291;hb=65dc1e4b2ba0d3e086308d4ad3104a1ce3a098cd;hp=9c20265484395fdf493c6c9af81e3c2127473ef1;hpb=e5ed5f84c8dff7855284b6d37f14da6a2e85f1c5;p=live-boot-grml.git
diff --git a/scripts/live-bottom/30accessibility b/scripts/live-bottom/30accessibility
index 9c20265..4ed1c6d 100755
--- a/scripts/live-bottom/30accessibility
+++ b/scripts/live-bottom/30accessibility
@@ -18,7 +18,7 @@ case "${1}" in
;;
esac
-# live-initramfs header
+# live-boot header
if [ -n "${NOACCESSIBILITY}" ]
then
@@ -27,9 +27,15 @@ fi
. /scripts/live-functions
-log_begin_msg "Configuring accessibility options..."
+if [ -z "${USERNAME}" ]
+then
+ echo "No default user for accessibility options."
+ exit 0
+fi
-# live-initramfs script
+log_begin_msg "Configuring accessibility options"
+
+# live-boot script
gconf_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gconf2 2>/dev/null) || gconf_version=""
@@ -41,6 +47,36 @@ 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
+}
+
+add_sudoers_file ()
+{
+
+cat < /root/etc/sudoers.d/a11y-sudo
+# TO allow accessibility in GTK to work with sudo.
+Defaults env_keep = "ORBIT_SOCKETDIR XDG_SESSION_COOKIE GTK_MODULES"
+EOF
+
+ chmod 0440 /root/etc/sudoers.d/a11y-sudo
+}
+
case ${ACCESS} in
access=v1)
# Lesser Visual Impairment
@@ -62,11 +98,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
+ add_sudoers_file
- 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
fi
;;
@@ -76,19 +119,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
+ add_sudoers_file
+
+ 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
+ add_sudoers_file
- 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
+ laptop_detect
+ chroot /root chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.orca
fi
+
+ remove_applet fast_user_switch
;;
access=m1)