Computer Shopper - UK (2020-01)

(Antfer) #1

ADVANCEDPROJECTS


ISSUE383|COMPUTER SHOPPER|JANUARY2020 127


touchscreen controls. To fix that, entersudo
nano /usr/share/X11/xorg.conf.d/40-libinput.
conf.Scroll through this file to findthe entry
with ‘libinput touchscreencatchall’.Add the
lineOption "TransformationMatrix" "-1 010
-1 1001"between Driver and EndSection.
Press Ctrl-O,Enter,Ctrl-Xtosavethatchange.
Now entersudo rebootand the Pi should
reboot with the desktop and touchcontrols
the right wayup.
Whether you’re building aself-contained
unit or acontrol panelfor awireless speaker,
you’ll need to configure how the Pi boots.
Enter the following:


mkdir -p /home/pi/.config/lxsession/
LXDE-pi/
cp /etc/xdg/lxsession/LXDE-pi/
autostart /home/pi/.config/lxsession/
LXDE-pi/autostart


This transfers the autostart file to the Pi user;
as that’s the user that logs in by default, that
user needs its own autostart file.


OPTION 1: SELF-CONTAINED UNIT
Forthe self-contained option, we’ll use
music stored on the Pi and amusic player.


Simply plug some PC speakers intothe
mini-jack of the Pi and you’ve got aself-
contained touchscreenjukebox. Let’s transfer
the music files first. The easiest tool to use
is WinSCP (seewinscp.net). Connect to your
Pi using its IP address, agree to the warning,
and you’ll see two panes of folders: theleft
is your PC and the right is the Pi. Youjust

select the files on your PC and copythem
over to the Pi’s Music folder.
While you’re transferring your music
collection, go back to your PuTTY SSH
window and install the music player.
Rhythmbox has aparty mode that’s abit
neater forour use.Typesudo apt-get install
-y rhythmbox unclutter.The Unclutter app
hides the mouse cursor when it’s not in use,
which makes the build abit neater.
Once all the files are copied over and
Rhythmbox has installed, you can edit that
autostart file:sudo nano home/pi/.config/
lxsession/LXDE-pi/autostart.Insert ahash
before the line xscreensaver -no-splash
(which ‘comments it out’,meaning the
line will be ignored). Then add the lines

⬆You need to edit some config files to flip the desktop and touchscreen controls

⬆You can power up your touchscreen jukebox using the Micro USB port on the screen’s control board


⬅Use theLXDE-pi autostart file to suppress some
options and auto-launch Rhythmbox
Free download pdf