LibreOffice Impress, has a feature useful to switch presentation slides using an Android app. It is a very nice feature, but the last time I used it (on version 5) it was a little unreliable.
So, what about an handmade solution? Just for fun. You need a micro:bit and a Linux (Fedora) workstation (equipped with Bluetooth).
So we will use Bluetooth, Python (3),
evemu-event command line tool (read this post on Fedora Magazine) and a micro:bit.
The micro:bit buttons will be used to switch between the slides (button B go to the next one, button A return back to the previous slide).
You can read here on github some basic information I wrote some time ago about micro:bit Bluetooth and Linux.
Install bluepy Python module
Let’s install bluepy module for your user (or system wide as you wish).
pip3 install bluepy --user
If you get compilation problems, install glib2-devel.
dnf install glib2-devel
Like xdotool, evemu tools are useful to simulate keyboard input and mouse activity. So you can scripting keystrokes. Why using evemu instead of xdotool? Because the former works also on Wayland.
sudo dnf install evemu
By using evemu tools you can record keystrokes, save them to a file, and replay them. But this goes beyond this post scope.
First of all you have to locate your keyboard
You can see which key you press using this command (where
/dev/input/by-path/pci-0000\:39\:00.0-usb-0\:1.6\:1.0-event-kbd is the keyboard device).
sudo evemu-record /dev/input/by-path/pci-0000\:39\:00.0-usb-0\:1.6\:1.0-event-kbd
evemu-event command you can simulate a keystroke. Note that value 1 means key pressed, and 0 key released.
evemu-event /dev/input/by-path/pci-0000\:39\:00.0-usb-0\:1.6\:1.0-event-kbd --type EV_KEY --code KEY_LEFTMETA --value 1 --sync \
evemu-event /dev/input/by-path/pci-0000\:39\:00.0-usb-0\:1.6\:1.0-event-kbd --type EV_KEY --code KEY_LEFTMETA --value 0 --sync
You have pressed the SUPER key (win key), so, if you are on GNOME, the activities overview should appear.
Programming the micro:bit
Simply use these makecode blocks.
The Python code
You can find an example here on github (remember: i’m not a Python developer).
Once paired the micro:bit with your PC, launch the Python script (using
sudo), start LibreOffice Impress, open a presentation, put it in full screen and voila: you can show your slides using the micro:bit buttons.
Look it in action here on Twitter