lxqt-config icon indicating copy to clipboard operation
lxqt-config copied to clipboard

Support a user defined screenlocker

Open paulolieuthier opened this issue 10 years ago • 4 comments

paulolieuthier avatar Sep 30 '15 16:09 paulolieuthier

We have to get screen locking working in sddm first I think.

jleclanche avatar Oct 17 '15 14:10 jleclanche

Just want to point out that there exists xss-lock which listens on two sources of events:

  • Native X screensaver (not xscreensaver) which can be triggered by xset s activate
  • logind session locking which can be activated with loginctl lock-session and deactivated with loginctl unlock-session

it is successfully triggered back and forth when, for example dm-tool switch-to-greeter is being used to spawn new lightdm greeter and session is then ulocked via lightdm greeter.

Vladimir-csp avatar Jul 06 '17 18:07 Vladimir-csp

Actually there is (undocumented?) option to provide user defined actions to trigger each of the "power actions":

bool CustomProvider::canAction(Power::Action action) const
{   
    switch (action)
    {
    case Power::PowerShutdown:
        return mSettings.contains("shutdownCommand");

    case Power::PowerReboot:
        return mSettings.contains("rebootCommand");

    case Power::PowerHibernate:
        return mSettings.contains("hibernateCommand");

    case Power::PowerSuspend:
        return mSettings.contains("suspendCommand");

    case Power::PowerLogout:
        return mSettings.contains("logoutCommand");

    default:
        return false;
    }
}

bool CustomProvider::doAction(Power::Action action)
{
    QString command;

    switch(action)
    {
    case Power::PowerShutdown:
        command = mSettings.value("shutdownCommand").toString();
        break;

    case Power::PowerReboot:
        command = mSettings.value("rebootCommand").toString();
        break;

    case Power::PowerHibernate:
        command = mSettings.value("hibernateCommand").toString();
        break;

    case Power::PowerSuspend:
        command = mSettings.value("suspendCommand").toString();
        break;

    case Power::PowerLogout:
        command = mSettings.value("logoutCommand").toString();
        break;

    default:
        return false;
    }

    return QProcess::startDetached(command);
}

The settings are taken from configuration file(s) .../lxqt/power.conf (the XDG_CONFIG_HOME and XDG_CONFIG_DIRS are applied here).

palinek avatar Jul 07 '17 05:07 palinek

https://github.com/lxqt/lxqt/wiki/ConfigScreensavers#other-screenlockers-using-xautolock

stefonarch avatar Jan 27 '22 07:01 stefonarch