Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Options to choose Power Buttons shown on the Menu Footer. Code Examples included. #53

Open
dowoco opened this issue Nov 19, 2024 · 0 comments

Comments

@dowoco
Copy link

dowoco commented Nov 19, 2024

Would it be possible to add options to the Configuration page to choose which Power Buttons get displayed on the Footer?

Lock and Shutdown seem limiting to me.

Also get rid of the pmEngine code and replace it with the code from . This has many more Power Button Options.

I added a reboot button and it seemed to work fine with the code.

import org.kde.plasma.private.sessions as Sessions

        Sessions.SessionManagement {
            id: sm
        }


    PlasmaComponents3.ToolButton {
        icon.name:  "system-reboot"
        onClicked: sm.requestReboot(0)
        //Layout.rightMargin: 10
        ToolTip.delay: 1000
        ToolTip.timeout: 1000
        ToolTip.visible: hovered
        ToolTip.text: i18n("Reboot")
    }

The other options that can be added are below:

onClicked: sm.lock()
onClicked: sm.requestLogout(0)
onClicked: sm.requestReboot(0) // do not show the Leave screen
onClicked: sm.requestShutdown(0) // do not show the Leave screen
onClicked: sm.suspend()
onClicked: sm.suspendThenHibernate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant