regolith-linux / regolith-compositor-picom-glx

GLX backend Picom configuration for Regolith
2 stars 3 forks source link

Implement automatic restarts. Picom crashes frequently. #4

Open cjthompson opened 1 year ago

cjthompson commented 1 year ago

It would be great if picom was started using systemd or another way to have it automatically restart after a crash. In my experience, picom crashes frequently, especially when resuming from suspend.

Here's a sample user picom.service

[Unit]
Description=Picom compositor fork
Documentation=man:picom(1)
PartOf=graphical-session.target
# Try to restart up to 3 times
StartLimitBurst=3
# Don't try to restart after 60 seconds
StartLimitIntervalSec=60

[Service]
ExecStart=/usr/bin/picom --config %h/.config/regolith2/picom/config --experimental-backends --dbus
ExecReload=/usr/bin/kill -SIGUSR1 $MAINPID
# Try to restart no matter how the process ended
Restart=always
# Restart in 5 second intervals
RestartSec=5

[Install]
WantedBy=graphical-session.target
kgilmer commented 1 year ago

Interesting idea @cjthompson . I don't have any experience w/ systemd services. Do you have any links to recommend to get up to speed on the relevant parts as it relates to your suggestion?

mfisher87 commented 1 year ago

Since doing a CPU upgrade and a fresh OS install (with Regolith 2.2) I'm not noticing picom crashing like it used to. I'm not sure if it's thanks to 2.2 or if the crashes were a quirk of my old system.

FWIW back when I needed it, I used this bash script to check if picom is running and if not, start it. I'd run it any time I noticed screen tearing. I haven't needed it for a while though (:fist_right: :wood:) ! https://github.com/mfisher87/picom-ensure