5

I had the following setup:

  • For my screensaver, I used xscreensaver (because it's beautiful)
  • To lock my screen, I used light-locker (because it's more secure then xscreensaver)

Recenctly, xscreensaver started binding to org.freedesktop.ScreenSaver on dbus. As a consequence, I cannot run them both anymore in parallel, cause the one I started after the other complains that a screensaver is already running.

I read in the ArchWiki that there is some possibility to override services. But it is very vague and I'm not familiar with d-bus.

Is there a way to have the two side-by-side without tampering with the source code of one of them?

For the record: unsetting the DBUS_SESSION_BUS_ADDRESS environment variable before starting ether screensaver does not work.

Edit: As far as I've seen in my research, it does not seem to be possible to prevent a program to listen to a d-bus service without causing trouble to this program. If someone can confirm me this, it would make a very good answer.

ixolius
  • 157
  • 7

1 Answers1

1

The unpleasant part of answer is that you can try to again run both of them in parallel, but you are most likely to face things broken. D-bus works as bus, and hence there are senders and receivers of messages with certain discipline. In case of screensaver, most likely assumed discipline is that screensaver is only one on system, and other software uses D-bus to signal whether it want to prevent invocation of screensaver or other standard function.

That said, of you want to try cowboy way and learn some D-Bus basics via trial and error, typically directory /usr/share/dbus-1/services/ has bunch of text files named exactly after D-Bus service names with .service in end of name. There you may find also org.freedesktop.ScreenSaver.service file.

Be prepared that editing might break system, so you know how to revert it in case of broken system. But here be dragons, you try it at own risk and most likely you will break working system.

AdminBee
  • 21,637
  • 21
  • 47
  • 71
ayvtill
  • 11
  • 3
  • There is no `org.freedesktop.ScreenSaver.service` in `/usr/share/dbus-1/services/`. And if I look at the files located there, I feel unable to deduct how to do what I want to do. But thanks for the warnings, traveller! – ixolius Nov 07 '22 at 17:57
  • xscreensaver source code on github says it keeps `.service` file as `xscreensaver-dbus.service` named - if you look at its [content](https://github.com/google/xscreensaver-dbus/blob/main/xscreensaver-dbus.service), you might recognize some lines and check whether you can deduce what to do about it. – ayvtill Nov 07 '22 at 21:33
  • I think the link you posted links to a project that achieved the thing `xscreensaver` does now out of the box and causes my problem. But I will look at it. – ixolius Nov 07 '22 at 22:04