Disable display of media controls on lock screen (showMediaControls) on KDE Plasma 5.12.7

The KDE lock screen has media player controls that look like this:

Aquarela do Linux! Jonathan Lewis back pause forward Switch User

I would like to turn this feature off, as described in D9685 (Add config for the lockscreen to toggle media controls) and KDE Bug 384264.

I am running KUbuntu 18.04 with KDE Plasma 5.12.7, and my lock screen config file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
      http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
  <kcfgfile name=""/>

  <group name="General">
    <entry name="showMediaControls" type="Bool">
      <label>If true, shows any currently playing media along with controls to pause it.</label>
      <default>true</default>
    </entry>
  </group>

</kcfg>

/usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/lockscreen/config.xml

Unlike older versions, the media controls are configurable in Plasma 5.12.7:

$ grep -B 3 -A 2 config.showMediaControls /usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/lockscreen/LockScreenUi.qml
Loader {
    Layout.fillWidth: true
    Layout.preferredHeight: item ? item.implicitHeight : 0
    active: config.showMediaControls
    source: "MediaControls.qml"
}

Accordingly, I have tried to change the showMediaControls setting, but the setting is not available in the screenlocker menu:

$ kcmshell5 screenlocker

Configure Screen Locking Appearance Wallpaper Type Plain Color Black

Changing the theme from KUbuntu to Breeze or Breeze Dark had no effect.

I also tried changing the configuration from the command line. Since the name attribute of the kcfgfile element is empty, I would expect the config file to be lockscreenrc, so I used this command:

kwriteconfig5 --file lockscreenrc --group 'General' --key 'showMediaControls' --type 'bool' 'false'

However, this had no effect. Even after writing this setting to all these files:

  • breezerc
  • kcmshell5rc
  • kdeglobals
  • lockscreenrc
  • plasmarc

the player controls are still visible on the lock screen. How can I actually remove the controls from the lock screen?


Solution 1:

KDE/Plasma Music Controls in Lock Screen

By https://kde.org/announcements/plasma-5.12.0.php :

Media controls have been added to the lock screen. For added privacy, they can be disabled in Plasma 5.12.

but: https://bugs.kde.org/show_bug.cgi?id=389483#c4

Urgh, there's a bug.

If the "Appareance" tab is not the active tab on load, then it doesn't render the second QtQuick UI

Fixed with the Plasma 5.12.2 or later...

But: https://bugs.kde.org/show_bug.cgi?id=389483#c17

A quick test with the Debian, Ubuntu and the Neon:

Debian - not working: https://imgur.com/oluO1Tu Ubuntu - not working: https://imgur.com/tu1q2iL Neon - working: https://imgur.com/57EgU2d ... This seems to be an Debian/Ubuntu problem. Maybe a bug repot in the Debian/Ubuntu bug tracking system will help.

This is still broken in the Kubuntu 18.04. With the Kubuntu 18.10 the configuration option is there.

Manual configuration

The KDE screen locker configuration file is:

$ locate screenlocker
/home/<usernamehere>/.config/kscreenlockerrc

the kscreenlockerrc.

The configuration option is (true/false):

[Greeter][LnF][General]
showMediaControls=false

This can be added with the kwriteconfig5:

kwriteconfig5 --file kscreenlockerrc --group Greeter --group LnF --group General --key showMediaControls --type bool false

Testing

Without: enter image description here

With the 'false':

enter image description here