this post was submitted on 19 Sep 2024
19 points (100.0% liked)

KDE

4829 readers
109 users here now

KDE is an international technology team creating user-friendly free and open source software for desktop and portable computing. KDE’s software runs on GNU/Linux, BSD and other operating systems, including Windows.

Plasma 6 Bugs

If you encounter a bug, proceed to https://bugs.kde.org, check whether it has been reported.

If it hasn't, report it yourself.

PLEASE THINK CAREFULLY BEFORE POSTING HERE.

Developers do not look for reports on social media, so they will not see it and all it does is clutter up the feed.

founded 1 year ago
MODERATORS
 

I know how to do it in the battery section through the GUI, but I'd like to set it up through a command, for automation purposes, and particularly for KDE Connect commands.

top 9 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 3 days ago (1 children)

There is kde-inhibit --screenSaver <command> provided by KDE.

But these days, I would just recommend everyone to use systemd-inhibit --what=idle --why=<because> --who=<myself> <command> instead. Works across desktops and does the same thing.

[–] [email protected] 2 points 3 days ago (1 children)

What should I put in the <command> part?

[–] [email protected] 1 points 2 days ago* (last edited 2 days ago) (2 children)

Anything that runs as long as you want the block to be. Usually sleep is a good one, use sleep infinity if you want the blocker to never go away until the systemd-inhibit process is killed manually.

[–] [email protected] 1 points 2 days ago

Would yes command work ?

[–] [email protected] 1 points 2 days ago

Aaaah, that's probably what Plasma is doing.

[–] dbx12 3 points 4 days ago (1 children)

Not KDE but might be similar: For the MATE desktop it is mate-screensaver-command --inhibit. I would expect something similar for KDE.

[–] [email protected] 1 points 3 days ago

@dbx12 @unknowing8343 you can also use the battery applet in your task bar!

[–] [email protected] 1 points 3 days ago (1 children)

I don't know if this fits your use case (you didn't describe what you want to achieve in detail), but commands that can possible help if the screen did lock (or turn off):

  • Unlock the lockscreen: loginctl unlock-screen
  • Turn on the screen: kscreen-doctor --dpms on
[–] [email protected] 1 points 3 days ago

Wasn't that. I want to keep the screen on. No sleep, no lockscreen, no blackscreen, etc.