If you are using a touchscreen with your Raspberry Pi, then this guide is for you.
Xstroke (Gesture recognition) is the perfect tool to help you get more out of your touhscreen. I am using a PiScreen
Gesture recognition allows you to draw "strokes" on your touchscreen, which get interpreted as commands or text. Xstroke allows these to be entered anywhere on the screen. In some cases, Xstroke can be used instead of a keyboard.
Xstroke Installation
Installing xstroke is very easy, just need to install some prerequisites, download xstroke and compile
Installing
pi@raspberrypi ~ $ wget http://mirror.egtvedt.no/avr32linux.org/twiki/pub/Main/XStroke/xstroke-0.6.tar.gz
pi@raspberrypi ~ $ tar xfv xstroke-0.6.tar.gz
pi@raspberrypi ~ $ cd xstroke-0.6/
pi@raspberrypi ~ $ ./configure
We need to make a small edit to the Makefile, otherwise make will fail;
pi@raspberrypi ~ $ make
pi@raspberrypi ~ $ sudo make install
Menu shortcuts
We will install some menu items so we can start and stop xtroke within X.
Download the menu items from ozzmaker.com;
pi@raspberrypi ~ $ wget http://www.ozzmaker.com/piscreen/xstroke.desktop
Then copy them to the appropriate location;
Below you can see the location of the two scripts.
One to start xstroke and the other to kill the xstroke process
After starting xstroke, an icon will appear on the task bar to the right. You will need to click on this icon to enable gesture recognition.
The image below shows the icon when gesture recognition is enabled.
Default Gesture Set
Global Gestures
[wp_ad_camp_3]
Hi, I successfully complete this step:
pi@raspberrypi ~ $ tar xfv xstroke-0.6.tar.gz
And then get an error when trying to enter this:
pi@raspberrypi ~ $ ./confgure
Should it be ./configure…?
Ooops.. sorry. You are right. it should be ./configure.
I’ll fix it up right now.
pi@raspberrypi ~ $ sudo apt-get -y install libxft-dev libxpm-dev libxtst-dev
pi@raspberrypi ~ $ wget http://mirror.egtvedt.no/avr32linux.org/twiki/pub/Main/XStroke/xstroke-0.6.tar.gz
pi@raspberrypi ~ $ tar xfv xstroke-0.6.tar.gz
pi@raspberrypi ~ $ cd xstroke-0.6
pi@raspberrypi ~ $ ./configure
pi@raspberrypi ~ $ make
pi@raspberrypi ~ $ sudo make install
try this
Thanks all. Downloaded and installed – it’s working!
This works. Awesome stuff. Thanks
The pencil icon is not showing up at the task bar, but the Xstroke process is running. How can I get the icon appear?
try running it from xTerminal. just use
xstroke
and see if it gives you any errors.I’ve tried running it from the X-terminal but gets automatically redirected to LXTerminal. It runs XStroke, without any messages or errors, but still no pencil icon.
Hi,
I tried to install xstroke but I can’t due to one error:
gcc -I/usr/include/freetype2 -DXSTROKE_CONF_DIR='”/usr/local/etc/xstroke”‘ -g -O2 -o xstroke action.o action_item.o anchor_engine.o args.o backing.o bresenham.o brush.o control_win.o dir_engine.o feature.o fixed.o gesture.o grid.o grid_engine.o log.o matrix.o option.o raw_engine.o rec.o rec_callback.o rec_engine.o rec_history.o rec_lex.o rec_mode.o rec_parse.o regex_feature.o sprintf_alloc.o stroke.o tray.o xlp.o xlp_callback.o xlp_color.o xlp_timeout.o xlp_win.o xstroke.o -lXft -lm -lpthread -lXpm -lXtst
/usr/bin/ld: backing.o: référence au symbole non défini «XRenderFindFormat»
//usr/lib/arm-linux-gnueabihf/libXrender.so.1: error adding symbols: DSO missing from command line
collect2: ld returned 1 exit status
Makefile:292: recipe for target ‘xstroke’ failed
make[1]: *** [xstroke] Error 1
make[1]: Leaving directory ‘/home/pi/tools/xstroke-0.6’
Makefile:230: recipe for target ‘all’ failed
make: *** [all] Error 2
Do you have any idea of the reason of this trouble?
Thanks
try updating your packages
sudo apt-get upgrade
I’m having the exact same problem as Guuk.
Running Occidentals
Did Upgrade
Any thoughts?
Same error here, on a fresh rasbian install. Something has changed with the dependencies and is now missing:
/usr/bin/ld: backing.o: undefined reference to symbol ‘XRenderFindFormat’
//usr/lib/arm-linux-gnueabihf/libXrender.so.1: error adding symbols: DSO missing from command line
collect2: ld returned 1 exit status
ld (the linker) is failing because XRenderFindFormat is no longer present in libxrender. I have the latest versions available installed:
ii libxrender-dev:armhf 1:0.9.7-1+deb7u1 armhf X Rendering Extension client library (development files)
ii libxrender1:armhf 1:0.9.7-1+deb7u1 armhf X Rendering Extension client library
same error also after upgrade. But when upgrading I get a message that 19 packages were not upgraded.
I already do this but nothing change.
I’m getting the exact same error as Guuk.
Running Occidentals
Did Upgrade
Thoughts?
@scottlj What Raspbian image did you use?
Same issue, latest raspian (sudo apt-get update AND sudo apt-get upgrade DONE yesterday)
/usr/bin/ld: backing.o: undefined reference to symbol ‘XRenderFindFormat’
//usr/lib/arm-linux-gnueabihf/libXrender.so.1: error adding symbols: DSO missing from command line
collect2: ld returned 1 exit status
Makefile:292: recipe for target ‘xstroke’ failed
make[1]: *** [xstroke] Error 1
make[1]: Leaving directory ‘/home/pi/xstroke-0.6’
Makefile:230: recipe for target ‘all’ failed
make: *** [all] Error 2
I also have the latest libxrender
ii libxrender-dev:armhf 1:0.9.7-1+deb7u1 armhf X Rendering Extension client library (development files)
ii libxrender1:armhf 1:0.9.7-1+deb7u1 armhf X Rendering Extension client library
Any path to follow?
Thanks
—
Guy
Hi,
I found a way around this, but this meant I had to change the Makefile. Replace the X_LIBS with
X_LIBS = -lXrender -lX11 -lXext -ldl
The fact that these libs are not defined here is probably caused by something else.
Regards,
Bas.
excellent! thanks!. I will update the details above to include this edit.
Yeah it works!
Thanks for sharing Bas
—
Guy
Great tutorial! Just a note that the following command from above did not work for me… I went to the Makefile directly to append “-lXrender -lX11 -lXext -ldl” to “X_LIBS = ”
Command:
sed -i ‘/^X_LIBS = / s/$/ -lXrender -lX11 -lXext -ldl/’ Makefile
Thanks 🙂
This command [ sed -i ‘/^X_LIBS = / s/$/ -lXrender -lX11 -lXext -ldl/’ Makefile ] does not work for the lastest raspbian on a Pi B+ :-(.
I’m having the same issue too 🙁
Did you try to do like Naglaa eid said (modifying the file with a text editor instead of using the command) ? I did it on my Pi B+ and it works
Hi, wonderful guide!!!
I have a problem…any time that i launch startx the desktop is very large and I can only see a big trash icon. Isn’t about the image on the guide. Anyone can help me?
Many thanks
Gianni
Hello,
I am trying to install it, but package seems no more available, there it is error message :
pi@raspberrypi:~ $ wget http://mirror.egtvedt.no/avr32linux.org/twiki/pub/Main/XStroke/xtroke-0.6.tar.gz
–2016-05-13 16:59:02– http://mirror.egtvedt.no/avr32linux.org/twiki/pub/Main/XStroke/xtroke-0.6.tar.gz
Résolution de mirror.egtvedt.no (mirror.egtvedt.no)… 178.255.151.173, 2a02:20c8:2640::b2ff:97ad
Connexion à mirror.egtvedt.no (mirror.egtvedt.no)|178.255.151.173|:80… connecté.
requête HTTP transmise, en attente de la réponse… 404 Not Found
2016-05-13 16:59:02 erreur 404 : Not Found.
Is there anything to change in order to receive the package anyway ?
ohhh dear! i’ve forgot one “s” in the file name… not xtroke-0.6.tar.gz but yes xstroke-0.6.tar.gz
thanks for the tutorial, by the way 🙂
Thanks for the guide. I was able to successfully install xstroke 0.6 on an old HP T1000 tablet computer. I did need to change a couple of steps. Since this isn’t a ARM processor, I chose to get the code from https://github.com/jeevesmkii/xstroke. I followed the other steps and everything proceeded successfully. This was installed on the Raspberry Pi Pixel for X86 that was attached to Issue 60 of The Magpi. Again thanks.
Ian