5 # initramfs-tools header
23 if [ -n "${NOACCESSIBILITY}" ]
28 .
/scripts
/live-functions
30 if [ -z "${USERNAME}" ]
32 echo "No default user for accessibility options."
36 log_begin_msg
"Configuring accessibility options"
40 gconf_version
=$
(chroot
/root
/usr
/bin
/dpkg-query
-W --showformat='${Version}' gconf2
2>/dev
/null
) || gconf_version
=""
44 if [ "${gconf_version}" ]
46 chroot
/root sudo
-u "${USERNAME}" gconftool-2
"${@}"
52 # Code to remove an applet from the default panel setup
53 # This is rather hacky, but I can't think of a one or two line regular
54 # expression to do this any more efficiently. Patches welcome. In
55 # addition, setting these via gconf also doesn't work for some reason.
57 local line_no prior_line next_line
59 line_no
="$(grep -n "<string
>$1</string
>" /root/usr/share/gconf/defaults/05_panel-default-setup.entries | cut -f 1 -d :)"
60 [ "$line_no" ] ||
return
61 prior_line
="$((line_no-1))"
62 next_line
="$((line_no+1))"
64 sed -i -n "${prior_line},${next_line}!p" /root
/usr
/share
/gconf
/defaults
/05_panel-default-setup.entries
66 chroot
/root update-gconf-defaults
72 cat <<EOF > /root/etc/sudoers.d/a11y-sudo
73 # TO allow accessibility in GTK to work with sudo.
74 Defaults env_keep = "ORBIT_SOCKETDIR XDG_SESSION_COOKIE GTK_MODULES"
77 chmod 0440 /root
/etc
/sudoers.d
/a11y-sudo
82 # Lesser Visual Impairment
83 gct
-s -t string
/desktop
/gnome
/interface
/gtk_theme HighContrastLargePrint
84 gct
-s -t string
/desktop
/gnome
/interface
/icon_theme HighContrast
85 gct
-s -t string
/desktop
/gnome
/interface
/monospace_font_name
"monospace 18"
86 gct
-s -t string
/desktop
/gnome
/interface
/font_name
"sans 18"
87 gct
-s -t string
/apps
/metacity
/general
/theme Atlanta
88 gct
-s -t string
/desktop
/gnome
/background
/picture_filename
""
89 gct
-s -t string
/desktop
/gnome
/background
/picture_options none
90 gct
-s -t string
/desktop
/gnome
/background
/primary_color \
#666666
91 gct
-s -t string
/desktop
/gnome
/background
/secondary_color \
#7F7F7F
92 gct
-s -t string
/desktop
/gnome
/background
/color_shading_type solid
93 gct
-s -t int
/desktop
/gnome
/peripherals
/mouse
/cursor_size
48
94 gct
-s -t string
/desktop
/gnome
/peripherals
/mouse
/cursor_theme whiteglass
98 # Moderate Visual Impairment
99 gct
-s -t bool
/desktop
/gnome
/interface
/accessibility true
100 gct
-s -t bool
/desktop
/gnome
/applications
/at
/visual
/startup true
101 gct
-s -t string
/desktop
/gnome
/applications
/at
/visual
/exec orca
102 gct
-s -t bool
/apps
/gksu
/disable-grab true
103 gct
-s -t string
/desktop
/gnome
/applications
/window_manager
/default
/usr
/bin
/metacity
106 if [ -x /root
/usr
/bin
/orca
]
108 mkdir
-p /root
/home
/${USERNAME}/.orca
109 echo "import orca.settings" >> /root
/home
/${USERNAME}/.orca
/user-settings.py
110 echo "orca.settings.enableSpeech = False" >> /root
/home
/${USERNAME}/.orca
/user-settings.py
111 echo "orca.settings.enableMagnifier = True" >> /root
/home
/${USERNAME}/.orca
/user-settings.py
112 chroot
/root chown
-R ${USERNAME}:${USERNAME} /home/${USERNAME}/.orca
118 # Disabled for now, until we know eSpeak works.
119 #gct -s -t bool /desktop/gnome/sound/enable_esd false
120 gct
-s -t bool
/desktop
/gnome
/interface
/accessibility true
121 gct
-s -t bool
/desktop
/gnome
/applications
/at
/visual
/startup true
122 gct
-s -t string
/desktop
/gnome
/applications
/at
/visual
/exec orca
123 gct
-s -t string
/apps
/empathy
/conversation
/theme classic
124 gct
-s -t bool
/apps
/gksu
/disable-grab true
125 gct
-s -t string
/desktop
/gnome
/applications
/window_manager
/default
/usr
/bin
/metacity
128 remove_applet fast_user_switch
129 if [ -x /root
/usr
/bin
/orca
]
131 mkdir
-p /root
/home
/$USERNAME/.orca
132 chroot
/root chown
-R $USERNAME.
$USERNAME /home
/$USERNAME/.orca
138 gct
-s -t bool
/desktop
/gnome
/interface
/accessibility true
139 gct
-s -t bool
/desktop
/gnome
/applications
/at
/visual
/startup true
140 gct
-s -t string
/desktop
/gnome
/applications
/at
/visual
/exec orca
141 gct
-s -t bool
/apps
/gksu
/disable-grab true
142 gct
-s -t string
/desktop
/gnome
/applications
/window_manager
/default
/usr
/bin
/metacity
143 gct
-s -t string
/apps
/empathy
/conversation
/theme classic
146 if [ -x /root
/usr
/bin
/orca
]
148 mkdir
-p /root
/home
/${USERNAME}/.orca
149 echo "import orca.settings" >> /root
/home
/${USERNAME}/.orca
/user-settings.py
150 echo "orca.settings.enableSpeech = False" >> /root
/home
/${USERNAME}/.orca
/user-settings.py
151 echo "orca.settings.enableBraille = True" >> /root
/home
/${USERNAME}/.orca
/user-settings.py
153 chroot
/root chown
-R ${USERNAME}:${USERNAME} /home/${USERNAME}/.orca
156 remove_applet fast_user_switch
160 # Minor Motor Difficulties
161 gct
-s -t bool
/desktop
/gnome
/accessibility
/keyboard
/enable true
162 gct
-s -t bool
/desktop
/gnome
/accessibility
/keyboard
/mousekeys_enable true
163 gct
-s -t bool
/desktop
/gnome
/accessibility
/keyboard
/stickykeys_enable true
164 gct
-s -t bool
/desktop
/gnome
/accessibility
/keyboard
/stickykeys_modifier_beep true
165 gct
-s -t bool
/desktop
/accessibility
/gnome
/keyboard
/stickykeys_two_key_off false
166 gct
-s -t bool
/desktop
/gnome
/peripherals
/keyboard
/repeat true
167 gct
-s -t int
/desktop
/gnome
/peripherals
/keyboard
/delay
700
168 gct
-s -t int
/desktop
/gnome
/peripherals
/keyboard
/rate
10
169 gct
-s -t bool
/apps
/gksu
/disable-grab true
171 if [ -e /root
/etc
/xdg
/xfce
4/mcs_settings
/keyboard.xml
]
173 sed -i 's/0/1/' /root
/etc
/xdg
/xfce
4/mcs_settings
/keyboard.xml
178 # Motor Difficulties - pointing devices
179 gct
-s -t bool
/desktop
/gnome
/accessibility
/keyboard
/enable true
180 gct
-s -t bool
/desktop
/gnome
/interface
/accessibility true
181 gct
-s -t bool
/desktop
/gnome
/accessibility
/keyboard
/stickykeys_enable true
182 gct
-s -t bool
/desktop
/gnome
/accessibility
/keyboard
/stickykeys_modifier_beep false
183 gct
-s -t bool
/desktop
/accessibility
/gnome
/keyboard
/stickykeys_two_key_off false
184 gct
-s -t list
--list-type=string
/desktop
/gnome
/accessibility
/startup
/exec_ats
[onboard
]
186 if [ -e /root
/etc
/xdg
/xfce
4/mcs_settings
/keyboard.xml
]
188 sed -i '/Sticky/ s/0/1/' /root
/etc
/xdg
/xfce
4/mcs_settings
/keyboard.xml