This is an old revision of the document!
LT_Presentation
As a teacher and lecturer, I need to give talks and presentations quite often. Usually, I write my presentations in LaTeX and use a PDF viewer like Atril (Mate Document Viewer) to display the slides.
A few months ago, I also bought a Logitech R400 wireless presenter to control the presentation. This works quite well if the document viewer is the active window. However, I tend to have either a script or different other things on my Laptop's window and often lose focus. Furthermore, the power manager is not automatically set to Presentation Mode.
The Solution
The solution is a small Python application I called lt_presentation. It offers the following features, but is very closely tied to my environment. Once I have a bit more spare time, I can add a configuration screen and make the document viewer and power manager configurable. For now, you need the following:
- Logitech R400
- xfce4-power-manager
- Atril
- xdotool
- wmctrl
- python-evdev
The program works the following way: It sits in the system tray and presents a right-click menu with the option to start a new presentation. After selecting it, you need to select the PDF presentation to use. Then, the following happens:
- Atril is started
- The Power Manager is set to “Inhibit”
- Xfce Power Manager is set to Presentation Mode
- The Logitech R400 is grabbed for exclusive access
- All button events are read from the R400 and sent directly to this, and only this, Atril window
- When Atril is closed, the R400 is released and the power management settings are restored.
This works through a series of “hacks” using wmctrl
and xdotool
magic. Fortunately, Atril accepts key events this way, not all applications support that.
Feel free to hack around the code at http://www.aboehler.at/hg/lt_presentation/. A very basic Arch Linux PKGBUILD is also included, but it only works on a local copy, for now.