Since weeks (or months?) or so my monitor and pc does not go to sleep automatically anymore. The System Settings module is not loaded in and the service is not running.
It works until someday it suddenly stops working and I only notice it after some time passed and the system is still up and running. The packages powerdevil power-profiles-daemon are installed. To solve this, I have to run the desktop file manually once: /etc/xdg/autostart/powerdevil.desktop and then it would persist working even after a restart of the system and after updates I think… until it breaks days and weeks later for unknown reasons again.
For whatever reason the program does not start with the xdg autostart located at: “/etc/xdg/autostart/powerdevil.desktop”
For the time being, I run the executable path that is found in the Exec= line of .desktop entry manually. I don’t know if there are side effects, because it does not run with root privileges (which it would at xdg autostart). I simply added an autostart entry with the executable /usr/lib/org_kde_powerdevil to System Settings > Startup and Shutdown > Autostart > +Add… > + Add Application…
How long has it been since you last updated? I only ask because you mention you may have had this issue for a while - and i remember a bug in ddcutil recently that caused an issue like you describe.
If you haven’t updated in a while, just opening a terminal:
I update all the time, mostly daily or a few days at least, especially when there is a problem. Otherwise I would not have the at the time up to date Kernel version. The current version of ddcutil I have is 2.1.3-1 .
(never mind, I deleted this paragraph)
I will remove the manual added autostart entry I described earlier, to see if this problem happens again. If not, then it might work forever and you won’t hear anything from me again.
Update: a few minutes later
So I restarted the system and the Power Management is broken, it does not load, even with ddcutil 2.1.3-1. I will restart with LTS Kernel now and report back. Edit: Well, it does not load up with LTS Kernel either, so this is not the problem.
I just wake up my system from sleep BTW, so it works with my “workaround”. This is the output (note, /usr/lib/org_kde_powerdevil is currently manually started and running):
$ systemctl status upower
â—Ź upower.service - Daemon for power management
Loaded: loaded (/usr/lib/systemd/system/upower.service; disabled; preset: disabled)
Active: active (running) since Sun 2024-02-18 07:31:22 CET; 19h ago
Docs: man:upowerd(8)
Main PID: 950 (upowerd)
Tasks: 4 (limit: 37454)
Memory: 13.3M (peak: 14.0M)
CPU: 3.181s
CGroup: /system.slice/upower.service
└─950 /usr/lib/upowerd
Feb 18 07:31:22 Batman systemd[1]: Starting Daemon for power management...
Feb 18 07:31:22 Batman systemd[1]: Started Daemon for power management.
I will re-login in my session without manually starting /usr/lib/org_kde_powerdevil and post the results here too in hot minute. Edit: Oh okay, the output is the same. But now my KDE module does not run anymore and my system would not go to sleep.
I should note something else that is important too, and linked to this issue. When I logout while the powerdevil service is NOT running, then I can’t login into my KDE session anymore and need to restart the entire PC instead. I don’t have the exact message at hand (need to make a photo, or type it with a pen and paper to capture output, like in stone age), unless it is logged somewhere. This issue does not happen if powerdevil is running.
Thank you for having patience and taking the time to help me with suggestions. The command created a symlink, but after reboot problem persists. My PC is build about in summer 2023 and I never updated the BIOS, because of bad experience from prior system. The power management problem started maybe after 2024, so I’m hesitant to upgrade BIOS (if any available). But will look into it in the future with proper preparation.
For now I will continue with manual autostart entry, as it works well it seems.
I can confirm this to be working, thank you! But as @pebcak suggested, I would like to edit with the systemctl command. But sudo systemctl edit plasma-powerdevil (with or without .service part) results in following message:
No files found for plasma-powerdevil.service.
Run 'systemctl edit --force --full plasma-powerdevil.service' to create a new unit.
But the file is in “/usr/lib/systemd/user/plasma-powerdevil.service” and I just edited it as suggested and restarted with a success. Why don’t systemctl find the file?
EDIT: Turns out I need the --user flag and it does only work without sudo it seems. I did not edit the file this way yet, as I don’t know if this is correct. Notice the path, it’s in /user/ subdirectory.
$ systemctl status plasma-powerdevil
Unit plasma-powerdevil.service could not be found.
$ systemctl --user status plasma-powerdevil
â—Ź plasma-powerdevil.service - Powerdevil
Loaded: loaded (/usr/lib ...
$ sudo systemctl --user edit plasma-powerdevil
[sudo] password for tuncay:
Failed to connect to bus: No medium found
$ systemctl --user edit plasma-powerdevil
So the last command systemctl --user edit plasma-powerdevil will open the file to edit in my neovim with current configuration. Is this the correct way?