Nowadays it also occurs sometimes to make the presentation in a videoconference.
In this case one cannot use a laser pointer, so I looked for a way to have something
like a bright and large screen cursor which I could move around the screen with my
local mouse.
What I describe here is the solution which works for me in my specific environment
(i.e. a Linux workstation with X, and using the
fvwm
window manager). I also give some (untested) hints I received while trying to find
my solution.
Here are some snapshots of "pointers" of different shape (all red) superimposed over
various windows.
-
The only items which may possible require downloading are the icons
(unless you want to create your own). These are the three sample icons I use in
their natural size. Just use your browser to retrieve them.
|
|
|
100×100 pix circle |
200×100 pix ellipse |
80×80 pix "laser beam" |
The icon files shall be stored in some directory, like a place where you keep other
personal icons, or the directory where the .fvwm2rc configuration file is.
-
The remainder of the "installation" just consist in copying lines into the
.fvwm2rc configuration file.
-
The next step is to make fvwm aware of such directory which is
achieved just making sure it is appended to the ImagePath line in the .fvwm2rc configuration file.
ImagePath .....:/<yourdirectorypath>
-
The next step is to choose the application (I use xterm), and to associate one of
the icons to it. One has also to define the command used to start the
application.
I start the application iconified, and with a special name resource, which in
fvwm can be achieved with a run string like
Exec xterm -name Laser -iconic
-
In order to make sure the icon stays always on top of all other windows on all
desktops, has no associated title but just the icon, is not parked in an eventual
icon box but is created at the mouse position
in my case I use a particular style LaserBase
defined in .fvwm2rc.
The example works starting from my pre-existing .fvwm2rc. Tuning might
be necessary in your case.
The potential styles LaserA LaserB LaserC are de facto not
used but just define the possible association of the three icons. The only usage is
in the next line. I give all three styles to allow you to choose a default.
The style Laser is initialized to one of those and
associates the (default) icon to the application exploiting
the name resource.
This is the relevant bit of .fvwm2rc:
Style LaserBase StickyIcon, StickyAcrossDesks, Layer 9, !IconTitle, IconBox none, PositionPlacement UnderMouse
Style LaserA Icon beam.png, UseStyle LaserBase
Style LaserB Icon circle.png, UseStyle LaserBase
Style LaserC Icon ellipse.png, UseStyle LaserBase
Style Laser UseStyle LaserA
-
To start the application from the root menu add this to the definition
of it in .fvwm2rc:
+ "LaserPointer " Exec xterm -name Laser -iconic
- The rest of this stuff can all be grouped together at the end of your
.fvwm2rc:
-
This sequence of lines defines a "laser switch on" function which can, if called with an argument
equal to A, B or C, start a pointer with the shape defined by the style
LaserA LaserB LaserC or otherwise by the current Laser style.
DestroyFunc PointLaser
AddToFunc PointLaser
+ I Exec xterm -name Laser$0 -iconic
-
As example, a line like this associates a default startup to shifted mouse button 1
Mouse 1 A S PointLaser
while a line like this associates a startup with the laser beam icon to key P when
pressed in the root window
Key P R A PointLaser A
None of these lines is mandatory.
-
Defining a function key for laser switch on at current mouse position
is definitely trickier.
One has first to define an auxiliary function which moves the newly created
icon to the current mouse position, offset by half of the icon sizes (so that it is
centered), and associates the particular icon. The function requires three
pseudo-arguments passed via environment variables.
DestroyFunc rePointLaser
AddToFunc rePointLaser
+ I ThisWindow ("Laser*") Move m-$[xof]p m-$[yof]p
+ I ThisWindow ("Laser*") WindowStyle Icon $[ik].png
+ I UnsetEnv xof
+ I UnsetEnv yof
+ I UnsetEnv ik
One has then to associate an event handler to activate the function when a new icon
is created
DestroyModuleConfig Event-PL: *
*Event-PL: Cmd Function
*Event-PL: add_window rePointLaser
Finally one can bind to a functional key the function with specific arguments.
In our case we use shift-F4/5/6 and start all instances with the
Laser style.
PointerKey F4 A S PipeRead 'echo "SetEnv xof 50" && echo "SetEnv yof 50" && echo "SetEnv ik circle" && echo "PointLaser "'
PointerKey F5 A S PipeRead 'echo "SetEnv xof 100" && echo "SetEnv yof 50" && echo "SetEnv ik ellipse" && echo "PointLaser "'
PointerKey F6 A S PipeRead 'echo "SetEnv xof 40" && echo "SetEnv yof 40" && echo "SetEnv ik beam" && echo "PointLaser "'
-
The definition of function keys to change icon with
unshifted F4/F5/F6 is much simpler
and operates on any instance due to the wildchar style
PointerKey (Laser*) F4 I N WindowStyle Icon circle.png
PointerKey (Laser*) F5 I N WindowStyle Icon ellipse.png
PointerKey (Laser*) F6 I N WindowStyle Icon beam.png
-
The definition of function keys to move, park and switch off with
unshifted F1/2/3 is even simpler
PointerKey (Laser*) F1 I N Move
PointerKey (Laser*) F2 I N Move -0 -0
PointerKey (Laser*) F3 I N Close
sax.iasf-milano.inaf.it/~lucio/SW/Laser/
:: original creation 2009 set 14 14:59:35 CEST ::
last edit 2009 Sep 14 14:59:35 CEST