5
submitted 9 months ago* (last edited 9 months ago) by spacemanspiffy@lemmy.world to c/linuxquestions@lemmy.zip

Here is my problem:

Our TV is connected to a SBC running a GNOME/Wayland desktop, where we watch Jellyfin and sometimes Netflix/Hulu through Firefox.

I'd like to be able to trigger pause/play (space button) from Home Assistant, which is running on my home server.

What I am thinking of would be a server/daemon running on the TV computer that my home server would be able to send keys to via a CLI tool (in this case the space key). I am surprised to find that I cannot locate any program like this.

Can anyone provide any suggestions here?

Other ideas:

  • Jellyfin's HA integration doesn't let me pause/play from it, and that still doesn't handle Hulu/Netflix.
  • I was able to get this working through SSH and there are tools like ydotool/wtype here that work, but I found waiting for SSH to be a bit slow to connect.

Update: I got frustrated and coded up a solution: https://gitlab.com/neilsimp1/kbsrv

top 10 comments
sorted by: hot top controversial new old
[-] Hailey312@kbin.social 3 points 9 months ago* (last edited 9 months ago)

Have you tried KDE Connect?

I have only used it to control my TV computer from my phone, but I can't see why it wouldn't work between 2 computers.
There is a 'Multimedia control' feature that allows pause/play/stop and volume control, the 'Remote Input' feature has a keyboard (so you should be able to trigger the space button) and if you want to do something more complicated you can set up and run commands.

[-] headmetwall@lemmy.dbzer0.com 1 points 9 months ago

X2 on kde connect, I regularly use it to control my desktop with my laptop

[-] Hailey312@kbin.social 1 points 9 months ago

Good to hear. I set it up on desktop and the controls work, other than Virtual monitor.

Have you had any luck getting Virtual monitor to run?
I think I need to open some ports but if you've got it running, any tips you could offer would be great.

[-] athos77@kbin.social 2 points 9 months ago
[-] key@lemmy.keychat.org 2 points 9 months ago

Of you're fine with proprietary there's Unified Remote.

[-] Kalkaline@lemmy.zip 1 points 9 months ago

Where is the machine located compared to the viewing room? Could you not use a wireless keyboard?

[-] spacemanspiffy@lemmy.world 1 points 9 months ago

I have a wireless keyboard. I want to be able to send a key event from CLI on another PC, though.

[-] CameronDev@programming.dev 2 points 9 months ago

If your willing to write a little code, you could get an esp32, and use on of the keyboard libraries to make it appear as a keyboard?

https://hackaday.com/2021/03/26/usb-comes-to-the-esp32/

Very roundabout solution though.

[-] spacemanspiffy@lemmy.world 2 points 9 months ago

I am fine with a little coding (see update in my post)

[-] CameronDev@programming.dev 1 points 9 months ago

Thats definitely better than using a separate esp32. Nice!

this post was submitted on 15 Jan 2024
5 points (100.0% liked)

Linux Questions

1060 readers
1 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 1 year ago
MODERATORS