This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Inhibit sleep in powerdevil from cron

Tags: None
(comma "," separated)
User avatar
Terminus
Registered Member
Posts
24
Karma
0
OS
Hey, I am looking for a way to temporarily block the computer from going to sleep, I already have a cron job setup to check every 5 minutes to check their is an active ssh connection. I don't want my computer to sleep when I am using it remotely. But want to save eremotlynergy when I am away. I tried using
Code: Select all
systemd-inhibit --mode block --what=sleep sleep 600

and it blocked systemdevil from sleeping. But after the block ended powerdevil never tried to sleep again. Is there anyway I can temporary disable sleep programmically.
User avatar
Terminus
Registered Member
Posts
24
Karma
0
OS
Code: Select all
##! /bin/bash
kwriteconfig5 --file powermanagementprofilesrc --group AC --group SuspendSession --key suspendType 0
kwriteconfig5 --file powermanagementprofilesrc --group AC --group SuspendSession --key idleTime 86400000
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement refreshStatus


this seems to "disable" it quite nicely, I did not want to stop screen dimming however any better ways would be appreciated as I really have no idea what I am doing other then google-fu and tinkinering


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]