timothycrosley / streamdeck-ui

A Linux compatible UI for the Elgato Stream Deck.
https://timothycrosley.github.io/streamdeck-ui/
MIT License
1.13k stars 241 forks source link

cannot start streamdeck_ui on KDE Neon #243

Closed Jullegaming04 closed 2 years ago

Jullegaming04 commented 2 years ago

raise ImportError('this platform is not supported: {}'.format( ImportError: this platform is not supported: ('failed to acquire X connection: Bad display name ""', DisplayNameError(''))

oh btw i am just testing if this works so i can purchase a streamdeck

dodgyrabbit commented 2 years ago

This error comes from the pynput library (which handles keyboard emulation). The reason is most likely that your system is using Wayland and this library requires X.

While I have not experimented with this, apparently you can set a different "backend" using environment variables. Set the following environment variables:

export PYNPUT_BACKEND=uinput
export PYNPUT_BACKEND_MOUSE=dummy

You will have to launch the application as root for this to work. This will very likely not work "as-is" since the streamdeck application and all it's dependencies were not installed as the root user. You will likely have to redo the pip3 install steps as sudo.

The easier alternative would be to install X, but understandably that may not be an option or desirable. Also, the usual disclaimer: install and use this as root at your own risk.

You can learn more about that stuff here: https://pynput.readthedocs.io/en/latest/ https://github.com/moses-palmer/pynput

One consideration is that in future we could ignore this error somehow. While this may be quite limiting (it won't be able to press shortcut keys etc) you will be able to do things like launch programs or execute shell scripts.

Good luck!

jvzr commented 1 year ago

I had been running streamdeck-ui flawlessly under Gnome Wayland until a routine update a week or two ago broke it. (Running Arch, and I clearly remember some Python packages being updated, and streamdeck-ui not running the boot after. There may have been other packages that might have broken this, such as xorg-xwayland. Unfortunately I didn't note the exact date and as such cannot narrow down the packages). I'm getting the same error since, and have been unable to make it run with the PYINPUT_BACKEND/root workaround (getting the exact same error)

I was using streamdeck-ui to run commands (no keyboard shortcuts AFAIR) and it was perfect for that. I feel naked without my Stream Deck now. Anyway I can help test other workarounds?