Package: knoepfe
Knöpfe[ˈknœpfə]Connect and control Elgato Stream Decks from Linux.FeaturesSeveral integrated widgetsOBS integration includingShowing and changing if stream is runningShowing and changing if recording is runningShowing current sceneSwitching between scenesMultiple pages to switch betweenConfiguring device's brightness and hardware polling intervalAutomatic sleeping if device isn't used with the possibility for widgets to prevent this (i.e. while OBS is running)InstallationPyPIpip install knoepfeshould do the trick :)Prerequisitesudev rules are required for Knöpfe to be able to communicate with the device.Create/etc/udev/rules.d/99-streamdeck.ruleswith following content:SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", TAG+="uaccess"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006d", TAG+="uaccess"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0080", TAG+="uaccess"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0063", TAG+="uaccess"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006c", TAG+="uaccess"Then, runsudo udevadm control --reload-rulesand reconnect the device. You should be ready to go then.systemd unitIf you want to start Knöpfe automatically on user login, consider creating and enabling a systemd unit in~/.config/systemd/user/knoepfe.service:[Unit]
Description=Knoepfe

[Service]
# Set path to where Knoepfe executable was installed to
ExecStart=/usr/local/bin/knoepfe
Restart=always

[Install]
WantedBy=default.targetAnd start and enable it by running:systemd --user enable knoepfe
systemd --user start knoepfeUsageStartingUsually just runningknoepfeshould be enough. It reads the configuration from~/.config/knoepfe/knoepfe.cfg(see below for more information) and connects to the stream deck.Anyway, some command line options are available:knopfe
Connect and control Elgato Stream Decks

Usage:
  knoepfe [(-v | --verbose)] [--config=<path>]
  knoepfe (-h | --help)
  knoepfe --version

Options:
  -h --help       Show this screen.
  -v --verbose    Print debug information.
  --config=<path> Config file to use.ConfigurationUnless overwritten on command line, Knöpfe loads its configuration from~/.config/knoepfe/knoepfe.cfg. So you should create that file if you don't want to stick to the example config used as fallback.Anyway, the example is a great way to start. It can be found asknoepfe/default.cfgin this repository and the installation target directory.The configuration is parsed as Python code. So every valid Python statement can be used, allowing to dynamically create and reuse parts of it.
The default configuration is heavily commented, hopefully explaining how to use it clear enough.WidgetsFollowing widgets are included:TextSimple widget just displaying a text.Can be instantiated as:widget({'type': 'knoepfe.widgets.Text', 'text': 'My great text!'})Does nothing but showing the text specified withtexton the key.ClockWidget displaying the current time. Instantiated as:widget({'type': 'knoepfe.widgets.Clock', 'format': '%H:%M'})formatexpects astrftime() format codeto define the formatting.TimerStop watch widget.Instantiated as:widget({'type': 'knoepfe.widgets.Timer'})When pressed it counts the seconds until it is pressed again. It then shows the time elapsed between both presses until pressed again to reset.This widget acquires the wake lock while the time is running, preventing the device from going to sleep.Mic MuteMute/unmute PulseAudio source, i.e. microphone.Instantiated with:widget({'type': 'knoepfe.widgets.MicMute'})Acceptsdeviceas optional argument with the name of source the operate with. If not set, the default source is used.
This widget shows if the source is muted and toggles the state on pressing it.OBS Streaming and RecordingShow and toggle OBS streaming/recording.These widgets can be instantiated withwidget({'type': 'knoepfe.widgets.obs.Recording'})andwidget({'type': 'knoepfe.widgets.obs.Streaming'})They connect to OBS (if running, they're quite gray if not) and show if the stream or recording is running. On a long press the state is toggled.As long as the connection to OBS is established these widgest hold the wake lock.OBS Current Scene and Scene SwitchShow and switch active OBS scene.These widgets are instantiated withwidget({'type': 'knoepfe.widgets.obs.CurrentScene'})andwidget({'type': 'knoepfe.widgets.obs.SwitchScene', 'scene': 'Scene'})The current scene widget just displays the active OBS scene.The scene switch widget indicates if the scene set with thescenekey is currently active. If not and the widget is pressed it switches to the scene.As long as the connection to OBS is established these widgets hold the wake lock.DevelopmentPlease feel free to open anissueif you encounter any bugs.Pull requests are also very welcome :)As widgets are loaded by their module path it should also be possible to add new functionality in a plugin-ish way by just creating independent python modules defining their behaviour. But, well, I haven't tested that yet.MentionsThis project relies onpython-elgato-streamdeckto communicate with the devices and is heavily inspired byDev Deckanddeckmaster.