On 27/12/23 at 21:54, Valerio Vanni wrote:
Il 25/12/2023 04:25, Valerio Vanni ha scritto:
Is there any way to change the way system is suspended from kde menu and from power saving in kde settings?

I mean changing the command issued.

I don't know exactly what the default command is, probably systemctl.

/usr/sbin/pm-suspend works better with kernel modules, and I'd like to use that

It seems that kde uses "systemctl suspend": if I use it from shell, result is bad as if I suspend from menu.

The defective kernel module cx23885: it doesn't support suspend and resume.
It's a module for a DVB-T PCIe card.

If I'm using kaffeine to watch DVB-T channels, I have to close it before suspending.
If I leave it opened, kernel module comes up in a broken state.
Closing and opening again kaffeine doesn't help, I have to
-close kaffeine
-rmmod cx23885
-modprobe cx23885
-open kaffeine

This happens suspending with pm-suspend.

Using systemctl, kernel module is broken after every suspend, even if kaffeine is not running.


My system, if I don't restart Picom, freeze after a resume from suspend. To fix it I've placed this shell script in "/usr/lib/systemd/system-sleep/" directory

~$ cat /usr/lib/systemd/system-sleep/00_sleep.sh
#!/bin/sh

################################################################################
# Run from systemd-suspend.service to place under /usr/lib/systemd/system-sleep/
################################################################################


PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
    pre)
            #code execution BEFORE sleeping/hibernating/suspending
    ;;
    post)
            #code execution AFTER resuming
            /usr/bin/sleep 5
            /usr/bin/touch /home/frank/.config/picom.conf
            /usr/bin/sleep 1
    ;;
esac

exit 0

So I think you've to do the same once you'll have a system that suspend to RAM properly.

kind regards
--
Franco Martelli

Reply via email to