Stream Deck Mini
I was given a Stream Deck Mini for Christmas, and it has turned out to be massively beneficial. I use it for all sorts of things, like quick access buttons for controlling Spotify, keyboard entry of timesheet categories, a small sound board, and I plan to configure some buttons for automatically switching between using my headphones or my speakers, and possibly a push-to-talk button.
You may be wondering how I manage to do all of that with just 6 buttons, but that's because the device has "pages", and I use the first "page" as a menu screen for 6 sub screens. E.g. button 1 takes me to the sound deck menu, and button two takes me to the sound settings menu etc. In each sub-menu, the 6th button takes me back to the main menu, so I currently have 6 x 5 = 30 useful buttons.
Installation
The first thing we need to do is install Python PIP.
Then we need to install some additional packages that are required.
sudo apt install -y libudev-dev libusb-1.0-0-dev libhidapi-libusb0 libxcb-xinerama0
After having installed PIP, we can use it to install the streamdeck module and the UI tool that we can use to configure it if we wish (the alternative is to manually configure it through Python code).
pip install streamdeck
pip3 install streamdeck_ui --user
Now we need to add some udev rules in order to allow us to have the privileges to access/modify the device without being the root user.
sudo vim /etc/udev/rules.d/70-streamdeck.rules
Paste in the following contents:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", TAG+="uaccess"
Note: There are many tutorials out there with lots of lines, this is the only one we need.
Make the new rules take effect:
sudo udevadm trigger
Finally, we need to unplug and plug in the device.
Stream Deck UI
After having run the installation steps, we should now have the Stream Deck UI tool which can be manually run by executing:
streamdeck
Automatic Startup
It is probably a good idea to add an entry to your startup commands to automatically start the streamdeck on login. The command/tool will have been installed to your user directory's .local/bin
folder like so:
/home/stuart/.local/bin/streamdeck
Automatic Typing
The Stream Deck Mini UI has an interface for automatically entering text for you, but if you need to do this as part of a script that the deck performs, you may find the following snippet useful:
from pynput.keyboard import Key, Controller
keyboard = Controller()
keyboard.type('textToTypeGoesHere')
References
- GitHub - timothycrosley /streamdeck-ui
- How to Set Up Elgato's Stream Deck on Ubuntu Linux 22.04
- timothycrosley.github.iostreamdeck-ui
- GitHub - jamesridgway / devdeck
- GitHub - amesridgway / devdeck - Issue: Keep getting Cloud not open HID device
First published: 31st December 2022