Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
projects:lt_presentation [2016/01/27 14:11] – created Andreas Böhlerprojects:lt_presentation [2017/03/27 12:21] (current) Andreas Böhler
Line 3: Line 3:
 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. 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.+A few months ago, I also bought a Logitech R400 wireless presenter as well as a Genius Ring Presenter and an ISY 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 ====
  
-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:+The solution is a small Python application I called lt_presentation. It offers the following features, but is very closely tied to my environment. You can, however, change few things in the configuration file. The location is ~/.lt_presentation/config.ini and it will be created during the first start of the program.
  
-  * Logitech R400 +You need the following (checked during startup): 
-  * xfce4-power-manager + 
-  * Atril+  * Logitech R400 OR Genius Ring Presenter OR ISY Presenter (device name can be changed in [devices] -> presenter) 
 +  * [optional] xfce4-power-manager (can be disabled in [general] -> xfce_pm_presentation_mode 
 +  * [optional] xdg-compliant power manager, such as xfce4-power-manager (can be disabled in [general] -> inhibit_xdg_pm) 
 +  * [optional] Workrave (can be disabled in [general] -> inhibit_workrave) 
 +  * Atril (can be changed in [programs] -> pdfviewer)
   * xdotool   * xdotool
   * wmctrl   * wmctrl
Line 18: Line 22:
 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: 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+  * PDF Viewer is started
   * The Power Manager is set to "Inhibit"   * The Power Manager is set to "Inhibit"
   * Xfce Power Manager is set to Presentation Mode   * Xfce Power Manager is set to Presentation Mode
-  * The Logitech R400 is grabbed for exclusive access +  * Workrave is suspsended 
-  * All button events are read from the R400 and sent directly to this, and only this, Atril window +  * The presenter is grabbed for exclusive access 
-  * When Atril is closed, the R400 is released and the power management settings are restored.+  * All button events are read from the presenter and sent directly to this, and only this, Atril window 
 +  * When Atril is closed, the presenter is released and the power management settings are restored
 + 
 +This works through a series of "hacks" using ''wmctrl'' and ''xdotool'' magic. <del>Fortunately, Atril accepts key events this way, not all applications support that.</del> As a hack, focus is quickly switched to the presentation window, the key is sent and the focus is immediately switched back to the original application. The result is that no matter where the keyboard focus is, Atril is always able to receive the remote control messages.
  
-This works through series of "hacks" using ''wmctrl'' and ''xdotool'' magicFortunately, Atril accepts key events this waynot all applications support that+It requires udev rule to have access to the input device as a regular userIf you use a different presenter than mineyou need to change the device IDs in the udev rule file.
  
-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.+Feel free to hack around the code at http://www.aboehler.at/hg/lt_presentation/. A very basic Arch Linux PKGBUILD is also included which is everything you need to get it running on Arch (builds directly from the latest Mercurial version).