Support a user defined screenlocker
We have to get screen locking working in sddm first I think.
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-sessionand deactivated withloginctl 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.
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).
https://github.com/lxqt/lxqt/wiki/ConfigScreensavers#other-screenlockers-using-xautolock