X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F30accessibility;h=3c51fa0362ec70745ffb42df11d1458139751894;hb=30d8972aa25fd49dd01aa042155a48bd49c0ae2d;hp=3f88e2f0005e56c325cf8c0da9ca02124bf418b5;hpb=e0a050e3bcf51cf0bb1df9490487e0619d4aa9f9;p=live-boot-grml.git diff --git a/scripts/live-bottom/30accessibility b/scripts/live-bottom/30accessibility index 3f88e2f..3c51fa0 100755 --- a/scripts/live-bottom/30accessibility +++ b/scripts/live-bottom/30accessibility @@ -47,6 +47,24 @@ 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 :)" + 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 @@ -71,6 +89,7 @@ case ${ACCESS} in 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 [ -x /root/usr/bin/orca ] then @@ -91,7 +110,22 @@ case ${ACCESS} in 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 + remove_applet fast_user_switch + if [ -x /root/usr/bin/pulse-session ] + then + touch /root/home/$USERNAME/.pulse_a11y_nostart + chroot /root chown $USERNAME.$USERNAME /home/$USERNAME/.pulse_a11y_nostart + mkdir -p /root/home/$USERNAME/.pulse + echo "autospawn = no" > /root/home/$USERNAME/.pulse/client.conf + chroot /root chown -R $USERNAME.$USERNAME /home/$USERNAME/.pulse + fi + 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) @@ -101,6 +135,7 @@ case ${ACCESS} in 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 [ -x /root/usr/bin/orca ] then @@ -108,8 +143,20 @@ 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 + + if [ -x /root/usr/bin/pulse-session ] + then + touch /root/home/$USERNAME/.pulse_a11y_nostart + chroot /root chown $USERNAME.$USERNAME /home/$USERNAME/.pulse_a11y_nostart + mkdir -p /root/home/$USERNAME/.pulse + echo "autospawn = no" > /root/home/$USERNAME/.pulse/client.conf + chroot /root chown -R $USERNAME.$USERNAME /home/$USERNAME/.pulse + fi + + remove_applet fast_user_switch ;; access=m1)