This file is indexed.

/usr/share/initramfs-tools/scripts/live-bottom/30accessibility is in live-boot-initramfs-tools 3.0~a24-1ubuntu1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#!/bin/sh

#set -e

# initramfs-tools header

PREREQ=""

prereqs()
{
	echo "${PREREQ}"
}

case "${1}" in
	prereqs)
		prereqs
		exit 0
		;;
esac

# live-boot header

if [ -n "${NOACCESSIBILITY}" ]
then
	exit 0
fi

. /scripts/live-functions

if [ -z "${USERNAME}" ]
then
	echo "No default user for accessibility options."
	exit 0
fi

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=""

gct ()
{
	if [ "${gconf_version}" ]
	then
		chroot /root sudo -u "${USERNAME}" gconftool-2 "${@}"
	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 "<string>$1</string>" /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 <<EOF > /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
		gct -s -t string /desktop/gnome/interface/gtk_theme HighContrastLargePrint
		gct -s -t string /desktop/gnome/interface/icon_theme HighContrast
		gct -s -t string /desktop/gnome/interface/monospace_font_name "monospace 18"
		gct -s -t string /desktop/gnome/interface/font_name "sans 18"
		gct -s -t string /apps/metacity/general/theme Atlanta
		gct -s -t string /desktop/gnome/background/picture_filename ""
		gct -s -t string /desktop/gnome/background/picture_options none
		gct -s -t string /desktop/gnome/background/primary_color \#666666
		gct -s -t string /desktop/gnome/background/secondary_color \#7F7F7F
		gct -s -t string /desktop/gnome/background/color_shading_type solid
		gct -s -t int /desktop/gnome/peripherals/mouse/cursor_size 48
		gct -s -t string /desktop/gnome/peripherals/mouse/cursor_theme whiteglass
		;;

	access=v2)
		# 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 [ -x /root/usr/bin/orca ]
		then
			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
		;;

	access=v3)
		# Blindness
		# Disabled for now, until we know eSpeak works.
		#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 [ -x /root/usr/bin/orca ]
		then
			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)
		# Minor Motor Difficulties
		gct -s -t bool /desktop/gnome/accessibility/keyboard/enable true
		gct -s -t bool /desktop/gnome/accessibility/keyboard/mousekeys_enable true
		gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_enable true
		gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_modifier_beep true
		gct -s -t bool /desktop/accessibility/gnome/keyboard/stickykeys_two_key_off false
		gct -s -t bool /desktop/gnome/peripherals/keyboard/repeat true
		gct -s -t int /desktop/gnome/peripherals/keyboard/delay 700
		gct -s -t int /desktop/gnome/peripherals/keyboard/rate 10
		gct -s -t bool /apps/gksu/disable-grab true

		if [ -e /root/etc/xdg/xfce4/mcs_settings/keyboard.xml ]
		then
			sed -i 's/0/1/' /root/etc/xdg/xfce4/mcs_settings/keyboard.xml
		fi
		;;

	access=m2)
		# Motor Difficulties - pointing devices
		gct -s -t bool /desktop/gnome/accessibility/keyboard/enable true
		gct -s -t bool /desktop/gnome/interface/accessibility true
		gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_enable true
		gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_modifier_beep false
		gct -s -t bool /desktop/accessibility/gnome/keyboard/stickykeys_two_key_off false
		gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [onboard]

		if [ -e /root/etc/xdg/xfce4/mcs_settings/keyboard.xml ]
		then
			sed -i '/Sticky/ s/0/1/' /root/etc/xdg/xfce4/mcs_settings/keyboard.xml
		fi
		;;
esac

log_end_msg