[PATCH libinput 16/16] tools: add shell script for making the pointer acceleration graphs in the docs

Peter Hutterer peter.hutterer at who-t.net
Mon Aug 10 16:01:23 PDT 2015


On Mon, Aug 10, 2015 at 04:23:34PM +0800, Jonas Ådahl wrote:
> On Wed, Aug 05, 2015 at 04:32:45PM +1000, Peter Hutterer wrote:
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> >  tools/Makefile.am             |  2 ++
> >  tools/make-ptraccel-graphs.sh | 79 +++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 81 insertions(+)
> >  create mode 100755 tools/make-ptraccel-graphs.sh
> > 
> > diff --git a/tools/Makefile.am b/tools/Makefile.am
> > index 68e60cb..8f72db9 100644
> > --- a/tools/Makefile.am
> > +++ b/tools/Makefile.am
> > @@ -39,3 +39,5 @@ event_gui_LDADD = ../src/libinput.la libshared.la $(CAIRO_LIBS) $(GTK_LIBS) $(LI
> >  event_gui_CFLAGS = $(CAIRO_CFLAGS) $(GTK_CFLAGS) $(LIBUDEV_CFLAGS)
> >  event_gui_LDFLAGS = -no-install
> >  endif
> > +
> > +EXTRA_DIST = make-ptraccel-graphs.sh
> > diff --git a/tools/make-ptraccel-graphs.sh b/tools/make-ptraccel-graphs.sh
> > new file mode 100755
> > index 0000000..8f7b8a6
> > --- /dev/null
> > +++ b/tools/make-ptraccel-graphs.sh
> > @@ -0,0 +1,79 @@
> > +#!/bin/bash
> > +
> > +tool=$PWD/ptraccel-debug
> 
> I think you could do `basename $0`/ptraccel-debug, assuming this script
> and ptraccel-debug are always in the same directory.

they aren't necessarily (builddir != srcdir) but I don't think we need to
cater for that case. The results are in git, this script is only there to to
be able to quickly reproduce them when we change things so there's no need
to be able to build this from a tarball. I've fixed it now, though I figured
I'd use dirname instead of basename, just to be different ;)

> Anyhow, Reviewed-by: Jonas Ådahl <jadahl at gmail.com>

thanks, much appreciated.

Cheers,
   Peter

> 
> > +gnuplot=/usr/bin/gnuplot
> > +
> > +outfile="ptraccel-linear"
> > +for speed in -1 -0.75 -0.5 -0.25 0 0.5 1; do
> > +	$tool --mode=accel --dpi=1000 --filter=linear --speed=$speed > $outfile-$speed.gnuplot
> > +done
> > +$gnuplot <<EOF
> > +set terminal svg enhanced background rgb 'white'
> > +set output "$outfile.svg"
> > +set xlabel "speed in units/us"
> > +set ylabel "accel factor"
> > +set style data lines
> > +set yrange [0:3]
> > +set xrange [0:0.003]
> > +plot "$outfile--1.gnuplot" using 1:2 title "-1.0", \
> > +	"$outfile--0.75.gnuplot" using 1:2 title "-0.75", \
> > +	"$outfile--0.5.gnuplot" using 1:2 title "-0.5", \
> > +	"$outfile--0.25.gnuplot" using 1:2 title "-0.25", \
> > +	"$outfile-0.gnuplot" using 1:2 title "0.0", \
> > +	"$outfile-0.5.gnuplot" using 1:2 title "0.5", \
> > +	"$outfile-1.gnuplot" using 1:2 title "1.0"
> > +EOF
> > +
> > +outfile="ptraccel-low-dpi"
> > +for dpi in 200 400 800 1000; do
> > +	$tool --mode=accel --dpi=$dpi --filter=low-dpi > $outfile-$dpi.gnuplot
> > +done
> > +
> > +$gnuplot <<EOF
> > +set terminal svg enhanced background rgb 'white'
> > +set output "$outfile.svg"
> > +set xlabel "speed in units/us"
> > +set ylabel "accel factor"
> > +set style data lines
> > +set yrange [0:5]
> > +set xrange [0:0.003]
> > +plot "$outfile-200.gnuplot" using 1:2 title "200dpi", \
> > +     "$outfile-400.gnuplot" using 1:2 title "400dpi", \
> > +     "$outfile-800.gnuplot" using 1:2 title "800dpi", \
> > +     "$outfile-1000.gnuplot" using 1:2 title "1000dpi"
> > +EOF
> > +
> > +outfile="ptraccel-touchpad"
> > +$tool --mode=accel --dpi=1000 --filter=linear > $outfile-mouse.gnuplot
> > +$tool --mode=accel --dpi=1000 --filter=touchpad > $outfile-touchpad.gnuplot
> > +$gnuplot <<EOF
> > +set terminal svg enhanced background rgb 'white'
> > +set output "$outfile.svg"
> > +set xlabel "speed in units/us"
> > +set ylabel "accel factor"
> > +set style data lines
> > +set yrange [0:3]
> > +set xrange [0:0.003]
> > +plot "$outfile-mouse.gnuplot" using 1:2 title "linear (mouse)", \
> > +     "$outfile-touchpad.gnuplot" using 1:2 title "touchpad"
> > +EOF
> > +
> > +outfile="ptraccel-trackpoint"
> > +$tool --mode=accel --dpi=1000 --filter=linear > $outfile-mouse.gnuplot
> > +for constaccel in 1 2 3; do
> > +	dpi=$((1000/$constaccel))
> > +	$tool --mode=accel --dpi=$dpi --filter=trackpoint > $outfile-trackpoint-$constaccel.gnuplot
> > +done
> > +$gnuplot <<EOF
> > +set terminal svg enhanced background rgb 'white'
> > +set output "$outfile.svg"
> > +set xlabel "speed in units/us"
> > +set ylabel "accel factor"
> > +set style data lines
> > +set yrange [0:5]
> > +set xrange [0:0.003]
> > +plot "$outfile-mouse.gnuplot" using 1:2 title "linear (mouse)", \
> > +     "$outfile-trackpoint-1.gnuplot" using 1:2 title "const accel 1", \
> > +     "$outfile-trackpoint-2.gnuplot" using 1:2 title "const accel 2", \
> > +     "$outfile-trackpoint-3.gnuplot" using 1:2 title "const accel 3"
> > +EOF
> > -- 
> > 2.4.3
> > 
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list