Skip to content
This repository has been archived by the owner on Aug 20, 2023. It is now read-only.

interaction with Compton at runtime #18

Open
pmattern opened this issue Apr 25, 2015 · 2 comments
Open

interaction with Compton at runtime #18

pmattern opened this issue Apr 25, 2015 · 2 comments

Comments

@pmattern
Copy link
Contributor

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.

@wxl
Copy link
Member

wxl commented Aug 18, 2019

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.

@jsm222
Copy link

jsm222 commented Jun 19, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants