I’ve finally switched to using Wayland instead of X11.
(Side-notes: While it does have a bunch of issues, most of which I’ve already found a way around, it seems infinitely faster than X11 since even 4k resolution is perfectly usable now while completely unusable in X11. Even the selection rectangle on the desktop is far more responsive than it has ever been in my Plasma experience, regardless of whether I use “Software” or “Automatic” render mode.)
I’m trying to set my monitor to powersave mode with a command. When I was using X11, xset dpms force off
worked. On Wayland, it does not.
I’ve found kscreen-doctor --dpms off
, but while it does put the monitor into powersave mode (after doing a fade-to-black effect, which I’d rather not have if it can be helped), when you wake it up again, the terminal which ran the command is flooded with mysterious “ghost Enter key presses”.
Even if you close the terminal and open another, this continues in the new. No kscreen-doctor
process is running when this happens. It seems to stop after a certain amount of time, and/or if you keep pressing Ctrl + C
. I can’t make any sense of it.
I’ve also tried kscreen-doctor --dpms off &
and nohup kscreen-doctor --dpms off &
with the same result. It doesn’t seem to help to “detach” the process in that way.
What could possibly be the cause for these “ghost Enter key presses”? And is there a better command to make the monitor (instantly) go into powersave mode in Wayland mode?
Trying the answer given here: kubuntu - How to turn off the monitor via command on Wayland (KDE Plasma)? - Ask Ubuntu
worked for me:
dbus-send --session --print-reply --dest=org.kde.kglobalaccel /component/org_kde_powerdevil org.kde.kglobalaccel.Component.invokeShortcut string:'Turn Off Screen'
Sadly, the exact same thing happens with that command: seemingly forever presses “Enter” repeatedly (or newlines; it’s unclear) in the terminal where it was typed. I don’t even have a guess as to what is happening or why…
What the hell? It persists not only when I close the terminal and open another one, but also in a textarea in my webbrowser where newlines keep outputting perpetually if I switch to it, util I hit any key there. But it does not happen if I switch to a text document opened in Kate. So apparently it depends on the program. And every time you switch back to it. WTF?
Did you also try prepending sleep 0.5 &&
to those commands?
I did now. This is very strange. There are no “ghost Enter presses” when I use either of these commands:
sleep 0.5 && kscreen-doctor --dpms off
sleep 0.5 && kscreen-doctor --dpms off &
sleep 0.5 && nohup kscreen-doctor --dpms off &
However, I ran these commands many times and I noticed that, seemingly randomly, either it works with apparently no issues, or (far more common) it moves my wastebin icon (there’s always something with that damn wastebin icon for me, isn’t it?) around on the desktop: sometimes it’s moved to the location where new icons appear when they are put on the desktop, and sometimes it just moves one “tile” to the right or down from where it’s normally located (near the right middle part of the screen).
Also, the only output is this oddly cut-off message:
qt.qpa.wayland: Creating a fake screen in order for
I tried using 2, 5 and 10 instead of 0.5 for the sleep command, and then I got this interesting output:
a@debian:~$ sleep 2 && kscreen-doctor --dpms
qt.qpa.wayland: Creating a fake screen in or
qt.qpa.wayland: Creating a fake screen in or
qt.qpa.wayland: Creating a fake screen in or
qt.qpa.wayland: Creating a fake screen in or
^C
a@debian:~$ sleep 5 && kscreen-doctor --dpms
qt.qpa.wayland: Creating a fake screen in or
qt.qpa.wayland: Creating a fake screen in or
qt.qpa.wayland: Creating a fake screen in or
qt.qpa.wayland: Creating a fake screen in or
^C
a@debian:~$ sleep 10 && kscreen-doctor --dpm
qt.qpa.wayland: Creating a fake screen in or
qt.qpa.wayland: Creating a fake screen in or
qt.qpa.wayland: Creating a fake screen i
qt.qpa.wayland: Creating a fake screen i
^C
The full commands were typed, such as sleep 10 && kscreen-doctor --dpms off
, but even the command input lines get cut off after running them. As you can see in the last attempt, the messages aren’t consistently cut off to the same length…
Same thing with the moving wastebin icon also happens with: sleep 0.5 && dbus-send --session --print-reply --dest=org.kde.kglobalaccel /component/org_kde_powerdevil org.kde.kglobalaccel.Component.invokeShortcut string:'Turn Off Screen'
I feel like a bug-magnet.
See Desktop icons are surprisingly hard!
If you’re still on Debian Stable, then you’ll experience:
- The bugs that currently exist in up-to-date KDE software
- Plus all of the bugs that have been fixed in between Debian’s snapshot and now
- Minus the bugs that have been introduced between Debian’s snapshot and now
- Minus the bugs that have had fixes backported by Debian maintainers
Distributions that adopt upstream updates relatively quickly only have #1.
The Debian approach assumes that #3 will outweigh #2 (which feels pessimistic to me), and that #4 will be significant (when in practicality, it’s negligible).
Folks will also experience more bugs if they use their devices in uncommon ways - what is a natural way of working for one person might in fact be rare across the broader population, or at least those who volunteer to test and report/fix bugs in new versions as they are developed.
I hope you can find an easier, less frustrating setup.
1 Like
FWIW I can’t reproduce this at all with current git master on top of Fedora KDE 41; bog-standard kscreen-doctor --dpms off
in a terminal window results in no unexpected keypresses anywhere.
You might try doing this in a new clean user account. If it doesn’t happen there, then the culprit will be one of the other customizations you’ve applied to your normal user account.
That link was an interesting read. I like it when there are blog posts related to something that I’ve experienced, clearing up some of the mystery of the inner workings.
I’ve been forced to revert back to X11 from Wayland due to the numerous issues that kept popping up, even with things like dragging and dropping files into Audacity (which no longer worked at all). So I can’t use 4k resolution anymore. But it’s a small price to pay to not have to deal with all those glitches with Wayland. Perhaps it’s not Wayland itself to blame, but rather software authors not wanting to support it. Even though it’s now been out for 16 years… And if updates have been made to programs to support Wayland since Debian 12 was released, meaning that it works for those using more updated versions, that’s still too early for me to feel comfortable using it. It feels like many programs will never support Wayland, and if they do, only “unwillingly” and “barely”.
I wish I had picked Fedora right from the start. Would’ve likely spared me a ton of headaches. I’m convinced that it’s far better at this point, and it’s only the lack of energy that prevents me from immediately going through with the switch; changing Linux distros feels almost like switching OSes. (It’s also likely/possible that updated GPU drivers would allow me to use 4k in X11 mode without extreme lag.)
I should also point out that I’m not somebody with a ton of random icons polluting my desktop. In fact, I only have one dir called “tmp” as well as the wastebin icon. Any other objects are only there temporarily for “handling”, such as when downloading new images, videos or temporarily juggling backups or archives. It’s my “workspace”. So it’s not due to a habit of having a “messy desktop full of icons” that I’ve triggered these bugs on the desktop. I just wanted to clarify this.
Kind of an aside from the original topic, but - if you’re interested in testing out a different operating system on “bare metal” to see how it handles your device (which I don’t blame at all - a virtual machine can only tell you so much), and if you have ~$30 USD available to spend, then in my opinion an additional, small SSD is worth it for the reduced aggravation from messing with your existing installation. I added this one to my kids’ laptop so I can use it to play around with an OS install when I want, without touching anything about the existing one - no repartitioning, etc. (That’s actually how I started trying out Fedora KDE, if I remember correctly, before deciding to use it as a primary OS)
If you like the new OS you try on that extra drive…you can just start booting from it, or transfer it over to your main drive, etc. And if you don’t like it - wipe it and just go back to your existing setup, no harm done.