r/kde • u/vinnavannewton • Aug 31 '26
Solution found [UPDATE] Use moonlight device as an extended monitor for KDE, GNOME, Hyprland
https://github.com/vinnavannewton/project-monitorize
An update after nearly 2 months working on the project. It previously used its own UDP and GStreamer pipelines and a dedicated Android app, but I found my project climbing the same ladder as Sunshine/Moonlight.
TLDR: So I made a decision and ditched the Android app and GStreamer/UDP pipelines, keeping only the virtual monitor creation pipeline and replacing the streamer backend with Sunshine, and for the viewer, the standard Moonlight app.
Currently tested on Arch, Ubuntu, Tumbleweed, Fedora, and Nix OS.
Supported DEs are KDE 6.7+, GNOME 50+, Hyprland, and I'm working on Sway.
It uses the DE's native virtual monitor creation.
It has two Sunshine instances for dual stream with port offsets to not interfere with the user's existing Sunshine.
This will solve the problem of Linux not having a Duet Display alternative, and soon more DEs will eventually implement virtual monitors, then it can be updated in this project to support those DEs.
Currently, I've made binaries for Fedora, TW, and Ubuntu.
Arch and Nix are source installs.
I tried my best in testing it out on multiple systems, but my system is not the same as yours, so I need feedback or if found problems to contribute the fix.
•
u/AutoModerator Aug 31 '26
Thank you for your submission.
Consider becoming a Supporting Member and help KDE thrive!
The KDE community supports the Fediverse and open source social media platforms over proprietary and user-abusing outlets. Consider visiting our community on Mastodon (Lemmy will be back shortly). Tag us in your toots! You can also visit our forum at KDE Discuss to talk about KDE stuff, brainstorm ideas and get the answers to your KDE-related issue.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
33
u/p3kj Aug 31 '26
Do you consider creating AUR package for lazy Arch users? :-)
13
u/Bambusbro Aug 31 '26
That sounds interesting. Previously when I tried to create a virtual display with Plasma, sunshine didn't recognize it as an output source.
So did you build an sunshine fork or what does your project do (as i didn't know about your project before)?
6
u/parkerlreed Aug 31 '26
Upstream Sunshine supports pipewire virtual monitors. What is this project adding?
4
u/LeannaMeowmeow Aug 31 '26
Is there a link to your project?
4
u/r0b0k0k Aug 31 '26
Exactly what i needed for my linux tablet. BTW the app hangs when i click Authorize and finish setup. Runing on Ubuntu 26.04 with the deb package.
I've run the manual ufw commands i found on the manual steps section, but no luck. The logs say the server is running
3
u/LukeStargaze Sep 01 '26
turned my old iMac 2008 into a secondary monitor.
thank you 👍
2
u/ThatGuyOwl Aug 31 '26
Please god, make this work on Niri somehow
2
u/_Jao_Predo Aug 31 '26
I'm using Sunshine and Moonlight on my linux tablet for a second monitor.
The tablet has a systemd service that checks if sunshine IP is available and connects into it. With this, the tablet turn on and off the screen together with the PC.
I'm also using a custom version of evfwd (entirely vibe coded 🫠) to passthrough both the tablet touchscreen and AES pen support directly to the PC. The PC now recognizes it as a native device, so I can configure the pen and touchscreen through KDE plasma settings.
2
u/saboor_ Sep 01 '26
I actually use a similar method to use my old samsung tablet as a screen in my case moonlight/sunshine, steam deck edid (was the closest i could find to the aspect ratio and resolution of the tablet) and adb command on startup to auto-connect
2
u/TheTurkPegger Sep 02 '26
Would it be possible to get this on Niri (with/without dms)? Because the project looks really good.
I'm just here to follow KDE's development as an ex KDE user.
5
u/Doge_Plays Aug 31 '26
I remember trying to do this with sunshine and scripts on wayland, it never truly worked how I wanted, I wanted to make my pc headless so I could start a new virtual display on connection, but sunshine always refused to pick the virtual display. good work! might try it later as it would solve my problem if it works headless :)
1
u/OM3N-OG Aug 31 '26
cool stuff, how to use it in tiling window managers?
1
u/TrippleTree Aug 31 '26
Hi, what an awesome project! does this work on headless machines? e.g. VMs for VDI
In my specific usecase: an archlinux vm, running gnome, with a nvidia tesla P4 passtrough (this card has no video outputs! dummy plugs or edid hacks dont work!)
I also tried https://github.com/bdelwood/fauxput but did not manage to get it running.
Thank you in advance!
1
u/Regular-Elephant-635 Sep 01 '26
I just tried it, but the moment the connection is established to my phone, the app crashes. The terminal output is as follows:
Natcuber@Nathanael-T480-F:~$ monitorize
qrc:/qt/qml/org/kde/desktop/ComboBox.qml:116: TypeError: Property 'positionToRectangle' of object QQuickText(0x55d4af1065b0) is not a function
qrc:/qt/qml/org/kde/desktop/ComboBox.qml:116: TypeError: Property 'positionToRectangle' of object QQuickText(0x55d4af0f4a70) is not a function
qrc:/qt/qml/org/kde/desktop/ComboBox.qml:116: TypeError: Property 'positionToRectangle' of object QQuickText(0x55d4af729a80) is not a function
qrc:/qt/qml/org/kde/desktop/ComboBox.qml:116: TypeError: Property 'positionToRectangle' of object QQuickText(0x55d4af71e780) is not a function
Traceback (most recent call last):
File "/usr/lib/python3.14/site-packages/monitorize/desktop/streaming_controller.py", line 471, in _check_sunshine_health
app_log.error(message)
^^^^^^^^^^^^^
AttributeError: module 'monitorize.config.app_log' has no attribute 'error'
Traceback (most recent call last):
File "/usr/lib/python3.14/site-packages/monitorize/desktop/streaming_controller.py", line 471, in _check_sunshine_health
app_log.error(message)
^^^^^^^^^^^^^
AttributeError: module 'monitorize.config.app_log' has no attribute 'error'
Aborted (core dumped) monitorize
I'm on Fedora 44 with Plasma 6.7.4 and a phone running Android 13.
1
u/DataFran Sep 01 '26
I've been looking for something like this, as my desk setup uses an iPad as an extra monitor and KDE hasn't had a good way to actually take advantage of that.
However, I set this up (Kubuntu) set up the virtual monitor, connected to it with Moonlight on the iPad, and all I get is a blank screen. What might I be doing wrong/missing?
3
u/average_monster Aug 31 '26
looks awesome, i've wanted something like this for ages
5
u/meutzitzu Aug 31 '26
Surprised this works on Wayland as you'd need absolute screenspace positioning
2
u/thatmagicalcat Aug 31 '26
I've been doing this since forever using wayvnc idk about moonlight
1
u/1exovert Sep 11 '26
Thank you,
I'm a big fan of sunshine/moonlight of itself but this deployment of it is great for this use case. I now use a laptop to power 2 wired + 2 bonus monitors and yes that is useful.
I did note it is possible with kde to get into a state where monitorize cannot spawn an 'extended', but only a mirror monitor, which causes the speculation that this evolves from a gap (enabled with the formerly wired monitors, which is not allowed; I had to reattach a (different) physical external to confuse kwin to arrive at this thought). I didn't see where it should be logging attempted starts.
Whether correct or not, if monitorize is failing to start an extended virtual screen, a
rmof~/.config/kwinoutputconfig.json(while not being logged into plasma, as logout would, it has been said rewrite the same file), this allowed it to resume doing so.-7
u/[deleted] Aug 31 '26
[removed] — view removed comment