FrogTheFrog / moondeck-buddy

A server-side part of the MoonDeck plugin for the SteamDeck.
GNU Lesser General Public License v3.0
170 stars 10 forks source link

[New Feature] KDE/Wayland #37

Closed XenHat closed 1 year ago

XenHat commented 1 year ago

To pick up where #15 left off, I am willing to assist in developing a workaround for the moondeck-buddy under Wayland using kscreen-doctor which is the recommended way to control kwin (KDE's window manager) under Wayland.

Let me know if there's any interest. I have several monitors (3) and machines (2+1) running wayland I can test with.

Checklist:

FrogTheFrog commented 1 year ago

I will not join these efforts for now because I actually want to play some games if I'm being honest, but I can give you a few pointers.

  1. Please created a new class based on X11ResolutionHandler (maybe KdeResolutionHandler).
  2. Make the https://github.com/FrogTheFrog/moondeck-buddy/blob/main/src/lib/os/linux/nativeresolutionhandler.cpp:isWaylandSession return boost::optional<SOME_ENUM> where SOME_ENUM could be called something along the lines of like DesktopEnvironment with a single value Kde. You can then use it to determine if your implementation needs to be used. In isWaylandSession some of the ENV variables that are being checked might contain information about KDE/Gnome session?
  3. Use QProcess for invoking kscreen-doctor (see https://github.com/FrogTheFrog/moondeck-buddy/blob/main/src/lib/os/steamhandler.cpp for example). Be sure to check somehow that such tool even exists (with other QProcess query via bash maybe).
  4. Use QRegularExpression for parsing output.
FrogTheFrog commented 1 year ago

Also, FYI, Sunshine will implement a feature where it will provide you with "desired" resolution for use in the do/undo commands, therefore please stick only to the Monitor resolution change part.

I don't want to implement anything more than necessary if this can also be done with Sunshine. (https://github.com/LizardByte/Sunshine/pull/1096)

FrogTheFrog commented 1 year ago

Or maybe you could sync on that Sunshine feature and try to implement it yourself :D ?

XenHat commented 1 year ago

Having sunshine do the heavy lifting and exposing the required information for the existing code to function is certainly preferable. I shall continue using my do/undo script for the time being then!

I may re-open this in the future if more work is required.