xcinfo provides information of X cursor including, also the output:
x y sw sh cw ch cx cy
where:
x
,y
: cursor positionsw
,sh
: screen resolutioncw
,ch
: cursor image sizecx
,cy
: cursor hotspot position
$ make
# By default, to install to `/usr/local`, run:
$ make install
# Or to `/usr`:
$ make install PREFIX=/usr
# Or to your home:
$ make install PREFIX=$HOME
To uninstall, use uninstall
target with PREFIX
if supplied during installation.
This code is written intentedly being used in shell script, e.g.
:::bash
read x y sw sh cw ch cx cy <<< "$(xcinfo)"
You can discard unneeded outputs, e.g.
:::bash
read x y sw sh _ <<< "$(xcinfo)"
-i N
: querying every N microseconds.
A dzen2 which bounches, simply run:
bzen2.sh message here, blah blah blah...
You can watch a screenshot in this blog post.
Scripts to record and render mouse trail as a SVG file, for example:
$ mousetrack-record.sh mouse.pos
Press Q to stop recording
$ mousetrack-svg.sh mouse.pos mouse.svg
# Converting to PNG format
$ inkscape mouse.svg --export-background=FFF --export-png=mouse.png
# or simply
$ inkscape mouse.svg -b FFF -e mouse.png
A script snaps a screenshot when mouse has movements every 5 minutes. It requires xsnap program to grab a screenshot.
Drawing heatmap of X cursor onto terminal window size. Here is a video.
This code is placed in Public Domain.