This forum has been archived. All content is frozen. Please use KDE Discuss instead.

No screensaver in KDE?

Tags: None
(comma "," separated)
wie
Registered Member
Posts
14
Karma
0

No screensaver in KDE?

Thu Dec 15, 2016 6:36 pm
When I lock the screen, the login windows stays open all the time.
I cannot find a screensaver option.
Is this correct?

I'm using Fedora 25 with KDE.
User avatar
Rog131
Registered Member
Posts
828
Karma
10

Re: No screensaver in KDE?

Thu Dec 15, 2016 6:53 pm
wie wrote:When I lock the screen, the login windows stays open all the time.
I cannot find a screensaver option.
Is this correct?

I'm using Fedora 25 with KDE.



From the Plasma 5.8 onwards - https://www.kde.org/announcements/plasma-5.8.0.php

New in Plasma 5.8

...all Plasma wallpaper plugins, such as slideshows and animated wallpapers, can now be used on the lock screen.


Image


Other options - KDE Forums - Screensaver: viewtopic.php?f=289&t=124413
wie
Registered Member
Posts
14
Karma
0

Re: No screensaver in KDE?

Thu Dec 15, 2016 7:11 pm
Interesting, I have Plasma 5.8.4 and don't have all these options, only 4.

I simply want that the screen goes black after a short while.
I thought this is normal, bot obviously not?
Do I have to install additional things?
User avatar
Rog131
Registered Member
Posts
828
Karma
10

Re: No screensaver in KDE?

Thu Dec 15, 2016 9:46 pm
wie wrote:When I lock the screen, the login windows stays open all the time.
.
.
.
Interesting, I have Plasma 5.8.4 and don't have all these options, only 4.

I simply want that the screen goes black after a short while.
I thought this is normal, bot obviously not?
Do I have to install additional things?



Hiding the lock screen ui

As default the lock screen user interface is displayed but the clock/id/new session/etc. can be moved out of sight.

The lock screen qml code is part of the plasma look and feel theme. Editing Breeze Plasma 5.8.4 LockScreenUi.qml:

Image

Full code:

Code: Select all
/********************************************************************
 This file is part of the KDE project.

Copyright (C) 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/

import QtQuick 2.5
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1

import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents

import org.kde.plasma.private.sessions 2.0
import "../components"

PlasmaCore.ColorScope {
    id: lockScreenRoot

    colorGroup: PlasmaCore.Theme.ComplementaryColorGroup

    Connections {
        target: authenticator
        onFailed: {
            root.notification = i18nd("plasma_lookandfeel_org.kde.lookandfeel","Unlocking failed");
        }
        onGraceLockedChanged: {
            if (!authenticator.graceLocked) {
                root.notification = "";
                root.clearPassword();
            }
        }
        onMessage: {
            root.notification = msg;
        }
        onError: {
            root.notification = err;
        }
    }

    SessionsModel {
        id: sessionsModel
        showNewSessionEntry: true
    }

    PlasmaCore.DataSource {
        id: keystateSource
        engine: "keystate"
        connectedSources: "Caps Lock"
    }

    Loader {
        id: changeSessionComponent
        active: false
        source: "ChangeSession.qml"
        visible: false
    }
   
        Rectangle {
        width: parent.width
        height: parent.height
        color: "transparent"

            Keys.onPressed: {
                if (event.key == Qt.Key_Up) { y = - parent.height }
                if (event.key == Qt.Key_Down) { y = 0 }
            }
           
        Clock {
            anchors.bottom: parent.verticalCenter
            anchors.bottomMargin: units.gridUnit * 13
            anchors.horizontalCenter: parent.horizontalCenter
        }
     

        ListModel {
            id: users

            Component.onCompleted: {
                users.append({name: kscreenlocker_userName,
                                realName: kscreenlocker_userName,
                                icon: kscreenlocker_userImage,

                })
                if (sessionsModel.canStartNewSession) {
                    users.append({realName: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "New Session"),
                                    name: "__new_session",
                                    iconName: "list-add"
                    })
                }
            }
        }

        StackView {
            id: mainStack
            anchors.fill: parent
            focus: true //StackView is an implicit focus scope, so we need to give this focus so the item inside will have it
            initialItem: MainBlock {
                userListModel: users
                notificationMessage: {
                    var text = ""
                    if (keystateSource.data["Caps Lock"]["Locked"]) {
                        text += i18nd("plasma_lookandfeel_org.kde.lookandfeel","Caps Lock is on")
                        if (root.notification) {
                            text += " • "
                        }
                    }
                    text += root.notification
                    return text
                }

                onNewSession: {
                    sessionsModel.startNewSession(false);
                }

                onLoginRequest: {
                    root.notification = ""
                    authenticator.tryUnlock(password)
                }

                actionItems: [
                    ActionButton {
                        text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch User")
                        iconSource: "system-switch-user"
                        onClicked: mainStack.push(switchSessionPage)
                        visible: sessionsModel.count > 1 && sessionsModel.canSwitchUser
                    }
                ]
            }
        }

        Component {
            id: switchSessionPage
            SessionManagementScreen {
                userListModel: sessionsModel

                PlasmaComponents.Button {
                    Layout.fillWidth: true
                    text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch Session")
                    onClicked: {
                        sessionsModel.switchUser(userListCurrentModelData.vtNumber)
                        mainStack.pop()
                    }
                }

                actionItems: [
                    ActionButton {
                        iconSource: "go-previous"
                        text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Back")
                        onClicked: mainStack.pop()
                    }
                ]
            }
        }
     }

    Loader {
        active: root.viewVisible
        source: "LockOsd.qml"
        anchors {
            horizontalCenter: parent.horizontalCenter
            bottom: parent.bottom
        }
    }

    RowLayout {
        id: footer
        anchors {
            bottom: parent.bottom
            left: parent.left
            right: parent.right
            margins: units.smallSpacing
        }

        KeyboardLayoutButton {
        }

        Item {
            Layout.fillWidth: true
        }

        Battery {}
    }


    Component.onCompleted: {
        // version support checks
        if (root.interfaceVersion < 1) {
            // ksmserver of 5.4, with greeter of 5.5
            root.viewVisible = true;
        }
    }
}


When the up arrow is pressed the UI is moved up - out of the sight.
When the down arrow is pressed the UI is moved down - center of the screen.

Image

The LockScreenUi.qml can be found:
Code: Select all
$ locate LockScreenUi.qml



More plasma wallpaper plugins

- Live Wallpaper Snow for Plasma 5: viewtopic.php?f=15&t=129561
- Video wallpaper: viewtopic.php?f=289&t=131783#p364090
- Video playlist player: viewtopic.php?f=289&t=131783&start=15#p365974
- With the KDE Applications 16.12 - Marble, World as your wallpaper: https://marc.info/?l=kde-announce&m=148182943521319&w=2


Black screen after a short while

Hmm - Maybe you are looking the 'Energy Saving' settings - Switch screen off after...

Image
wie
Registered Member
Posts
14
Karma
0

Re: No screensaver in KDE?

Fri Dec 16, 2016 7:35 am
Hmm, thanks ...
I see it's not so easy. :)

At work I use CentOS.
Here all energy things are turned off, but when I lock the screen it immediately goes black.
Same in Windows after about a minute.
I would say this is a good option. Perhaps it could be added to KDE?
ablake
Registered Member
Posts
7
Karma
0

Re: No screensaver in KDE?

Sat Oct 13, 2018 6:16 am
I copy/pasted the code into LockScreenUi.qml and now there is no way for me to enter the password since there is nothing at all on the screen except the picture/image! It doesn't matter when down arrow is pressed, no keys seem to bring up the lockscreen login/password. Nothing is visible, not the clock not the ID, not new session, etc.

Here is the code I entered (just above the "clock" as shown in the screenshot included in this thread):


Code: Select all
Rectangle {
        width: parent.width
        height: parent.height
        color: "transparent"

            Keys.onPressed: {
                if (event.key == Qt.Key_Up) { y = - parent.height }
                if (event.key == Qt.Key_Down) { y = 0 }
            }


How do I get back into a session?!? I'm on a laptop and getting the battery out to do a hard restart is not something I want to do unless there is another option!

Thanks
User avatar
Rog131
Registered Member
Posts
828
Karma
10

Re: No screensaver in KDE?

Sat Oct 13, 2018 7:41 am
Notes !
- This thread is a bit old - started Dec 15, 2016.
- The Plasma is evolving so these code examples could break your system with the newer plasma.
- Always test before you lock your screen.


The lock screen can be tested:

1) Locate your "kscreenlocker_greet"

Example at here with the Arch Linux:
Code: Select all
$ locate kscreenlocker_greet
/usr/lib/kscreenlocker_greet


Help at here =>
Code: Select all
$ /usr/lib/kscreenlocker_greet --help
Usage: /usr/lib/kscreenlocker_greet [options]
Greeter for the KDE Plasma Workspaces Screen locker

Options:
  -h, --help                  Displays this help.
  -v, --version               Displays version information.
  --testing                   Starts the greeter in testing mode
  --theme <theme>             Starts the greeter with the selected theme (only
                              in Testing mode)
  --immediateLock             Lock immediately, ignoring any grace time etc.
  --graceTime <milliseconds>  Delay till the lock user interface gets shown in
                              milliseconds.
  --nolock                    Don't show any lock user interface.
  --switchuser                Default to the switch user UI.
  --ksldfd <fd>               File descriptor for connecting to ksld.


Testing current lock greeter:
Code: Select all
$ /usr/lib/kscreenlocker_greet --testing


Image
Using Breeze Custom Lock Screen - https://store.kde.org/p/1216681/


Unlocking sessions: viewtopic.php?f=66&t=155313
ablake
Registered Member
Posts
7
Karma
0

Re: No screensaver in KDE?

Sat Oct 13, 2018 6:39 pm
Thank you Rog131

Is there a way to add the code snippet to allow for the up/down arrow functionality that is mentioned? (up/down arrow erases or removes and then replaces the login/password)

Also, is there a way to uninstall the Breeze Custom Lock Screen (https://store.kde.org/p/1216681/)? Thanks
User avatar
Rog131
Registered Member
Posts
828
Karma
10

Re: No screensaver in KDE?

Sun Oct 14, 2018 9:17 am
ablake wrote:Thank you Rog131

Is there a way to add the code snippet to allow for the up/down arrow functionality that is mentioned? (up/down arrow erases or removes and then replaces the login/password)

Also, is there a way to uninstall the Breeze Custom Lock Screen (https://store.kde.org/p/1216681/)? Thanks



It would help if you tell your your plasma version. The KInfoCenter will tell it: https://www.kde.org/applications/system/kinfocenter/

The Breeze Custom Lock Screen is for the Plasma 5.12.2 and later. It it using semitransparent sliding rectangle. The lock screen texts are on the rectangle and moving out the sight when not needed.

The rectangle is moving:
- up when up arrow is pressed
- down when the down arrow is pressed.
- mouse movement will also trigger the down movement.
- after configurable time the rectangle is sliding out of sight.

It can be installed and uninstalled from the System Settings Add-On Installer. Look And Feel > Get New Looks, After installation the 'Install' button should be changed to the 'Uninstall' button.

Image

Manual installation or uninstallation can be done with the kpackagetool5.

Code: Select all
$ kpackagetool5 --help
Usage: kpackagetool5 [options]
KPackage Manager

Options:
  -v, --version                       Displays version information.
  -h, --help                          Displays this help.
  --hash <path>                       Generate a SHA1 hash for the package at
                                      <path>
  -g, --global                        For install or remove, operates on
                                      packages installed for all users.
  -t, --type <type>                   The type of package, corresponding to the
                                      service type of the package plugin, e.g.
                                      KPackage/Generic, Plasma/Theme,
                                      Plasma/Wallpaper, Plasma/Applet, etc.
  -i, --install <path>                Install the package at <path>
  -s, --show <name>                   Show information of package <name>
  -u, --upgrade <path>                Upgrade the package at <path>
  -l, --list                          List installed packages
  --list-types                        List all known package types that can be
                                      installed
  -r, --remove <name>                 Remove the package named <name>
  -p, --packageroot <path>            Absolute path to the package root. If not
                                      supplied, then the standard data
                                      directories for this KDE session will be
                                      searched instead.
  --generate-index                    Recreate the plugin index. To be used in:
                                      conjunction with either the option -t or
                                      -g. Recreates the index for the given type
                                      or package root. Operates in the user
                                      directory, unless -g is used
  --remove-index                      Remove the plugin index. To be used in:
                                      conjunction with either the option -t or
                                      -g. Recreates the index for the given type
                                      or package root. Operates in the user
                                      directory, unless -g is used
  --appstream-metainfo <path>         Outputs the metadata for the package
                                      <path>
  --appstream-metainfo-output <path>  Outputs the metadata for the package into
                                      <path>


Example:
Code: Select all
$ kpackagetool5 -t Plasma/LookAndFeel -i BreezeCustomLock.tar.gz
kf5.kpackage: Generated  "/home/rog131/.local/share/plasma/look-and-feel//kpluginindex.json"  ( 7  plugins)
Successfully installed /home/rog131/Downloads/BreezeCustomLock.tar.gz

$ kpackagetool5 -t Plasma/LookAndFeel -r BreezeCustomLock
Empty filename passed to function
kf5.kpackage: Generated  "/home/rog131/.local/share/plasma/look-and-feel//kpluginindex.json"  ( 6  plugins)
Successfully uninstalled


Image
ablake
Registered Member
Posts
7
Karma
0

Re: No screensaver in KDE?

Mon Oct 15, 2018 1:56 am
Thanks, the system is running KDE Kubuntu 18.04, Plasma 5.12.6, kernel 4.15.0-36-generic 64 bit - I'm also having some problems with my audio btw
viewtopic.php?f=19&t=155309


the issue I'm having with Breeze Custom Lock is that it doesn't just change the lock screen functionality but also changes the overall theme - when it is selected, it changes the taskbar and menu colors from the dark kubuntu to the light breeze blue, here's a screenshot showing this: https://i.imgur.com/crDPHO3.png

the confusing part is that it is installed but there is no uninstall option, in the 'System Settings Add-On Installer" it shows "Install" and not "Uninstall" - here's a screenshot showing that it is installed and included in the list of themes but it is still technically allowing me to install it rather than uninstall it - to be clear, I haven't tried to install it again but not sure what to do or if this is a bug of some sort

https://i.imgur.com/kzQbDuD.png
User avatar
Rog131
Registered Member
Posts
828
Karma
10

Re: No screensaver in KDE?

Mon Oct 15, 2018 9:38 am
ablake wrote:the issue I'm having with Breeze Custom Lock is that it doesn't just change the lock screen functionality but also changes the overall theme - when it is selected, it changes the taskbar and menu colors from the dark kubuntu to the light breeze blue, here's a screenshot showing this: https://i.imgur.com/crDPHO3.png


Earlier: https://www.reddit.com/r/kde/comments/8 ... _and_lock/

Changing the Look and Feel theme defaults

You could first pick the Look and Feel theme and then change the Desktop theme, color, font, etc...

Another option is to edit the Look and Feel theme defaults. The LnF themes have the 'default' file. With the Breeze Custom Lock Screen: $HOME/.local/share/plasma/look-and-feel/BreezeCustomLock/contents/defaults. You could set the default plasma/icon/color/etc theme with it. The 'defaults' file is a simple text file and you could edit it with a text editor.

There is also a dedicated tool the 'Plasma Look and Feel Explorer'. It has button 'Defaults from current setup':
Image
Edit the Plasma theme, color, icons, etc and then click the 'Defaults from current setup' and Save:
Image

The 'Plasma Look and Feel Explorer' is part of the 'plasma-sdk': https://packages.ubuntu.com/search?keyw ... ection=all


ablake wrote:the confusing part is that it is installed but there is no uninstall option, in the 'System Settings Add-On Installer" it shows "Install" and not "Uninstall" - here's a screenshot showing that it is installed and included in the list of themes but it is still technically allowing me to install it rather than uninstall it - to be clear, I haven't tried to install it again but not sure what to do or if this is a bug of some sort


It is clear bug - KDE Bug tracker: https://bugs.kde.org

A quick search: Bug 390875 - cannot uninstall widgets installed from kde store - https://bugs.kde.org/show_bug.cgi?id=390875

It is plasma widgets but the symptoms are same: You can't uninstall with the gui. You will need to use the kpackagetool5.


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]