add scrool or click actions
This commit is contained in:
parent
3dc6111825
commit
7ca7e1e952
3 changed files with 39 additions and 0 deletions
|
|
@ -28,4 +28,20 @@ M.BarIcon {
|
|||
repeat: true
|
||||
onTriggered: proc.running = true
|
||||
}
|
||||
|
||||
Process {
|
||||
id: setter
|
||||
property string next: ""
|
||||
command: ["powerprofilesctl", "set", next]
|
||||
onRunningChanged: if (!running && next !== "") proc.running = true
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
onTapped: {
|
||||
const cycle = ["performance", "balanced", "power-saver"];
|
||||
const idx = cycle.indexOf(root.profile);
|
||||
setter.next = cycle[(idx + 1) % cycle.length];
|
||||
setter.running = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue