Skip to main content

Installing the Mate Desktop on Raspbian Lite

How to take a Raspbian Lite Image and Accessify it

This requires a USB audio dongle to work in the desktop.

After this installation, console audio will come out of the analog audio jack and desktop speech with Orca will come out of the USB dongle.

Script:

  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
#!/bin/bash

if [ `whoami` != 'root' ]; then
    echo "Script must be run as root. Try sudo $0"
    exit 1
fi

set -e

ILCTTS_VERSION=1.0.0
PIESPEAKUP_VERSION=1.1.0

# Change to the dummy video driver for a headless Pi which will produce no
# display but probably run more quickly in the desktop
VIDEODEVICE=xserver-xorg-video-fbdev
#VIDEODEVICE=xserver-xorg-video-dummy

#  Change this to GREETER=lightdm to install
# the lightdm greeter. Without this you will
# need to type startx at the console prompt
# to start the desktop
GREETER=

echo 'Performing an update...'
apt-get -yq update

echo 'Installing espeak and espeak development files...'
apt-get install -yq libespeak-dev espeak

echo 'Getting ilctts library code from www.raspberryvi.org...'
wget http://www.raspberryvi.org/Downloads/ilctts-${ILCTTS_VERSION}.tar.gz
echo 'Extracting the library code...'
tar -zxf ilctts-${ILCTTS_VERSION}.tar.gz
cd ilctts-${ILCTTS_VERSION}
echo 'Configuring library code for a build...'
./configure
./fix-timestamps.sh
echo 'Making the library...'
make -s
echo 'Installing the library...'
make install
cd ..

echo 'Executing ldconfig...'
ldconfig

echo 'Tidying up...'
rm -rf ilctts-${ILCTTS_VERSION}/
rm ilctts-${ILCTTS_VERSION}.tar.gz

echo 'Writing to /etc/modules...'
echo -e "\n\nspeakup_soft\n\n" >> /etc/modules
echo 'Loading speakup_soft for this session...'
modprobe speakup_soft

echo 'Getting the piespeakup code from www.raspberryvi.org...'
wget http://www.raspberryvi.org/Downloads/piespeakup-${PIESPEAKUP_VERSION}.tar.gz
echo 'Extracting the piespeakup code...'
tar zxf piespeakup-${PIESPEAKUP_VERSION}.tar.gz
cd piespeakup-${PIESPEAKUP_VERSION}
echo 'Configuring piespeakup for a build...'
./configure
./fix-timestamps.sh
echo 'Making piespeakup...'
make -s
echo 'Installing piespeakup...'
make install
cd ..

echo 'Enabling and starting the piespeakup service...'
systemctl enable piespeakup.service
systemctl start piespeakup.service

echo 'Tidying up...'
rm -rf piespeakup-${PIESPEAKUP_VERSION}/
rm piespeakup-${PIESPEAKUP_VERSION}.tar.gz

echo 'Installing xorg stuff...'
apt-get install -yq xserver-xorg-core ${VIDEODEVICE}

echo 'Editing /lib/modprobe.d/aliases.conf...'
sed -i 's|^\(options snd-usb-audio index=\)|#\1|' /lib/modprobe.d/aliases.conf

echo 'Editing /boot/config.txt...'
sed -i 's|^\(dtparam=audio=on\)|#\1|' /boot/config.txt

echo 'Installing some stuff, this will take a long time...'
apt-get install -yq mate-core mate-desktop-environment gnome-orca xinit

if [ ${GREETER} ]; then
    echo 'Installing the lightdm greeter..'
    apt -get install -yq lightdm
    echo 'Editing /etc/lightdm/lightdm.conf...'
    sed -i 's|^#\(greeter-wrapper=\)|\1/usr/bin/orca-dm-wrapper|' /etc/lightdm/lightdm.conf
    echo 'Adding the lightdm user to the audio group...'
    usermod -a -G audio lightdm
fi

echo 'Removing unused speech-dispatcher modules...'
rm /usr/lib/speech-dispatcher-modules/sd_cicero
rm /usr/lib/speech-dispatcher-modules/sd_flite
rm /usr/lib/speech-dispatcher-modules/sd_generic

echo "All done"
exit 0

After running the above script you will need to do this, but not as root, to get Orca to start when you start the desktop:

dbus-launch gsettings set org.mate.interface accessibility true
dbus-launch gsettings set org.gnome.desktop.a11y.applications screen-reader-enabled true

If you did not change:

GREETER=

To:

GREETER=lightdm

You will have to type startx at the console to get the desktop to start.