15

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?

Nathaniel M. Beaver
  • 1,478
  • 12
  • 32
  • Did you look at https://www.nixgh.com/linux/2018/03/03/disable-media-controls-on-kde-5-lock-screen/? But even if that works, you'll need to make the change each time the file is updated. I don't know what effect the other changes you've made to various other *rc files will have. I'd be cautious there. – DK Bose Mar 20 '19 at 03:54
  • 1
    Yes, I read that, but that's for older versions. My `LockScreenUI.qml` file has `active: config.showMediaControls` (I'll update the question to make this explicit). And I've reverted the changes to the config files after verifying they didn't have any effect. – Nathaniel M. Beaver Mar 20 '19 at 13:34
  • Purely speculating here … what about commenting out that particular Loader section if you have the OS in a VM? – DK Bose Mar 20 '19 at 13:56
  • I know I can make the media controls go away if I set "active: false" by editing LockScreenUi.qml. Doing this changes the setting for all users, requires root privileges, is difficult to script, diverges my system from distro and upstream, and more generally makes upstream more likely to ignore my bug reports. So I want to actually use the setting in the config file as intended by upstream. – Nathaniel M. Beaver Mar 20 '19 at 14:09

1 Answers1

21

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://i.stack.imgur.com/MywR0.jpg Ubuntu - not working: https://i.stack.imgur.com/SygOr.jpg Neon - working: https://i.stack.imgur.com/RCYog.jpg ... 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

user26687
  • 14,874
  • 1
  • 38
  • 43
  • I'm using kubuntu 18.04.3 LTS with Plasma 5.12.8 and It worked like a charm, thanks @user26687 – Paco Orozco Sep 02 '19 at 08:16
  • It would seem this bug never got fixed upstream (i.e. by the KDE developers) or got reintroduced somewhere down the road. I just had to apply the `./config/kscreenlockerrc` fix on **Plasma 5.19.5** as I couldn't find any configuration option to configure this. – Fonic Oct 24 '20 at 08:11
  • I was not able to find any setting in 5.26.5, so it appears the issue remains. But changing the config file still works perfectly. – fin444 Feb 02 '23 at 23:18