alright, wayland nerds. I have a question for you:

I am on Debian 13. I want to have an cronjob that turns off the monitor at midnight and turns it back on at 6:30AM.

I know how to make a cronjob, but what command do I use to turn on and off the display?

#wayland #linux #foss

Follow

@domo That's not a "Wayland question", that's "<your DE> question".

On Plasma, there's `kscreen-doctor`.

On Phosh, Sway, Wayfire and some others, there's `wlr-randr`.

On GNOME I don't think there's a tool supplied, but there's at least Mutter's DBus API that can be utilized: gitlab.gnome.org/GNOME/mutter/

@dos I'm on plasma, but I guess kscreen-doctor doesn't work without some sort of plugin config? Here's what happens for me:

$ kscreen-doctor
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: linuxfb, xcb, eglfs, wayland-egl, wayland, minimal, minimalegl, vnc, offscreen, vkkhrdisplay.

Aborted (core dumped)

@domo If you're running it remotely you have to point it to Wayland display you want it to operate on - what it tells you is that it tried to use X11 platform as a fallback and couldn't. Use `WAYLAND_DISPLAY=wayland-0` or even just `-platform wayland` parameter, as it will default to wayland-0 anyway.

@dos fuck yeah!

# turns the screen on
kscreen-doctor -platform wayland --dpms on

# turns the screen off
kscreen-doctor -platform wayland --dpms off

You are an ADHD life saver! My only other option if this didn't work was to put the monitor on a smart outlet, control it via home assistant and just hope I never shorted the monitor permanently. This kicks so much more ass though. Thank you!

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml