mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-25 08:28:22 -04:00
[plasmalnf] Try to get back to the live user before changing themes
This commit is contained in:
parent
b10b19e9ee
commit
e628ddfdbf
3 changed files with 16 additions and 1 deletions
|
@ -125,6 +125,11 @@ PlasmaLnfViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
|
|
||||||
if ( m_lnfPath.isEmpty() )
|
if ( m_lnfPath.isEmpty() )
|
||||||
cDebug() << "WARNING: no lnftool given for plasmalnf module.";
|
cDebug() << "WARNING: no lnftool given for plasmalnf module.";
|
||||||
|
|
||||||
|
QString liveUser;
|
||||||
|
if ( configurationMap.contains( "liveuser" ) && configurationMap.value( "liveuser" ).type() == QVariant::String )
|
||||||
|
liveUser = configurationMap.value( "liveuser" ).toString();
|
||||||
|
m_liveUser = liveUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -133,7 +138,10 @@ PlasmaLnfViewStep::themeSelected( const QString& id )
|
||||||
m_themeId = id;
|
m_themeId = id;
|
||||||
|
|
||||||
QProcess lnftool;
|
QProcess lnftool;
|
||||||
lnftool.start( m_lnfPath, {"--resetLayout", "--apply", id} );
|
if ( !m_liveUser.isEmpty() )
|
||||||
|
lnftool.start( "sudo", {"-E", "-H", "-u", m_liveUser, m_lnfPath, "--resetLayout", "--apply", id} );
|
||||||
|
else
|
||||||
|
lnftool.start( m_lnfPath, {"--resetLayout", "--apply", id} );
|
||||||
|
|
||||||
if ( !lnftool.waitForStarted( 1000 ) )
|
if ( !lnftool.waitForStarted( 1000 ) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,6 +63,7 @@ private:
|
||||||
PlasmaLnfPage* m_widget;
|
PlasmaLnfPage* m_widget;
|
||||||
QString m_lnfPath;
|
QString m_lnfPath;
|
||||||
QString m_themeId;
|
QString m_themeId;
|
||||||
|
QString m_liveUser;
|
||||||
};
|
};
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( PlasmaLnfViewStepFactory )
|
CALAMARES_PLUGIN_FACTORY_DECLARATION( PlasmaLnfViewStepFactory )
|
||||||
|
|
|
@ -2,3 +2,9 @@
|
||||||
# Full path to the Plasma look-and-feel tool (CLI program
|
# Full path to the Plasma look-and-feel tool (CLI program
|
||||||
# for querying and applying Plasma themes).
|
# for querying and applying Plasma themes).
|
||||||
lnftool: "/usr/bin/lookandfeeltool"
|
lnftool: "/usr/bin/lookandfeeltool"
|
||||||
|
|
||||||
|
# For systems where the user Calamares runs as (usually root,
|
||||||
|
# via either sudo or pkexec) has a clean environment, set this
|
||||||
|
# to the originating username; the lnftool will be run through
|
||||||
|
# "sudo -H -u <liveuser>" instead of directly.
|
||||||
|
liveuser: "live"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue