compton-conf icon indicating copy to clipboard operation
compton-conf copied to clipboard

interaction with Compton at runtime

Open pmattern opened this issue 10 years ago • 2 comments

Button Apply is writing $XDG_CONFIG_HOME/compton.conf but doesn't apply the settings at once. The latter is the expected behaviour of buttons named like this, though. So either it should be made sure that "Apply" does behave the usual way which can apparently be achieved by something like kill -SIGUSR1 $(pidof compton) or the button should be renamed to e. g. "Save".

An option to en- / disable Compton at runtime is missing. Both compton -b and kill $(pidof compton) seem to work flawlessly when invoked from a virtual terminal.

There is no warning if Compton isn't running when ComptonConf gets launched. This could give rise to confusion and should be changed.

pmattern avatar Apr 25 '15 08:04 pmattern

Just for posterity's sake, I will point out that fact that the code seems to suggest that the mechanism in place to deal with restarting compton (yes, there is one) is not reliable:

  // ask compton to reload the config
  QString displayName = QString::fromLocal8Bit(qgetenv("DISPLAY"));
  for(int i = 0; i < displayName.length(); ++i) {
    if(!displayName[i].isNumber()) // replace non-numeric chars with _
      displayName[i] = QLatin1Char('_');
  }
  QString comptonServiceName = QStringLiteral(COMPTON_SERVICE_PREFIX) + displayName;
  QDBusInterface iface(comptonServiceName, QStringLiteral(COMPTON_PATH), QStringLiteral(COMPTON_INTERFACE));
  if(iface.isValid()) {
    iface.call(QStringLiteral("reset"));
    // raise ourself to the top again (we'll loosing focus after reloading compton)
    activateWindow();
  }
  // FIXME: dbus interface of compton is not always available and reset() creates
  // much flickers. Maybe we should use internal dbus method set_opts().
  // Or, we can patch compton to do what we want.

wxl avatar Aug 18 '19 20:08 wxl

So either it should be made sure that "Apply" does behave the usual way which can apparently be achieved by something like kill -SIGUSR1 $(pidof compton) or the button should be renamed to e. g. "Save".

SIGUSR1 as apply works also for me on FreeBSD

jsm222 avatar Jun 19 '20 22:06 jsm222