qunxyz / plasma-applet-caffeine-plus

Disable screensaver and auto suspend
GNU General Public License v2.0
35 stars 5 forks source link

Takes two clicks to enable caffeine #12

Open Mr-Monkey opened 4 years ago

Mr-Monkey commented 4 years ago

On gnome the icon is the toggle button. On KDE it takes me two clicks: the first to open a small screen listing all the windows, the second to check "Inhibit suspend globablly". I would love to see the window list removed and have the icon "widget" be the toggle.

image

giugrilli commented 4 years ago

exactly my same need, I don't get why the window list is there anyway, what am I missing?

kupiqu commented 4 years ago

I "fixed" this in my fork by modifying the MouseArea in main.qml as follows:

      MouseArea {
            id: mouseArea
            anchors.fill: parent
            acceptedButtons: Qt.LeftButton | Qt.MiddleButton
            onClicked: {
                if ( mouse.button == Qt.LeftButton ){
                    plasmoid.configuration.enableRestore = !plasmoid.configuration.enableRestore
                    caffeinePlus.toggle(plasmoid.configuration.enableRestore)
                    plasmoid.expanded = false
                }
                else
                    if( mouse.button == Qt.MiddleButton)
                        plasmoid.expanded = !plasmoid.expanded
            }
            hoverEnabled: true
        }

So left click toggles the status of inhibit power saving globally (and middle click keeps previous behavior of windows list display)

Davincible commented 3 years ago

Can this pleaaaase be merged into the main branch

peterhoeg commented 3 years ago

It looks like @qunxyz hasn't been active in a very long time. If somebody has some extra time, maybe do a friendly fork for now until the original author resurfaces.

qunxyz commented 3 years ago

sorry guys! I am preparing legal qualification exam. maybe not have much time to manage this project. but I would merged any PL while I saw it.