picom icon indicating copy to clipboard operation
picom copied to clipboard

Add a --replace option to replace existing compositor.

Open Asmageddon opened this issue 2 years ago • 8 comments

Many other compositors support this option - it's invaluable for experimenting with replacing your DE's current compositor without having to modify unusual config files and re-login.

Asmageddon avatar Dec 31 '22 12:12 Asmageddon

Totally unnecessary. Kill picom and start again, not that hard. Just bind it to a key.

FT-Labs avatar Dec 31 '22 12:12 FT-Labs

Some DEs restart their compositor automatically, e.g. xfce4 and xfwm, making it impossible to start picom without modifying configuration that you usually have no good reason to touch.

Asmageddon avatar Dec 31 '22 15:12 Asmageddon

Totally unnecessary. Kill picom and start again, not that hard. Just bind it to a key.

Why not? It may appear useless, but I'd like to see it too.

Monsterovich avatar Dec 31 '22 19:12 Monsterovich

alias pic="pidof -s picom && killall -9 picom || picom &; disown"

Use this to toggle it

FT-Labs avatar Jan 01 '23 01:01 FT-Labs

Again, what about replacing a compositor that the DE automatically respawns? You can't just kill it and spawn a picom process. You need --replace for that

Asmageddon avatar Jan 02 '23 10:01 Asmageddon

Hmm, maybe it would allow new usecases like picom on Gnome with mutter as WM only.

clapbr avatar Jan 08 '23 04:01 clapbr

Some DEs restart their compositor automatically, e.g. xfce4 and xfwm, making it impossible to start picom without modifying configuration that you usually have no good reason to touch.

in xfce toggling the compositor is just toggling it's checkbox: image

Again, what about replacing a compositor that the DE automatically respawns? You can't just kill it and spawn a picom process. You need --replace for that

in theory, a good compositor won’t start if there is another one running, so you can kill a compositor and immediately start picom, it should do the trick

btw, i’d like to hear what are those «many other compositors» that support this option

absolutelynothelix avatar Jan 09 '23 02:01 absolutelynothelix

btw, i’d like to hear what are those «many other compositors» that support this option

It appears compiz has/had support for --replace.

Ideally something like this works by forcefully acquiring the _NET_WM_CM_Sn selection. Any compositor that follows the spec should free its resources and stop once it looses this selection. picom follows the spec since https://github.com/chjj/compton/pull/320 has been merged.

Hmm, maybe it would allow new usecases like picom on Gnome with mutter as WM only.

This is really dependent on whether these WMs/compositors follow the spec the way you interpret them. I am not sure if mutter is able to let go of just the _NET_WM_CM_Sn selection without also stopping the window managing part... This needs more research. E.g. it appears that compiz stops completely (WM and compositing) when it looses any selection. Haven't tested it but this is what the code implies.

tryone144 avatar Jan 09 '23 15:01 tryone144