diff --git a/home/ags/files/config.js b/home/ags/files/config.js index 9cee57f..42ac1d1 100644 --- a/home/ags/files/config.js +++ b/home/ags/files/config.js @@ -189,17 +189,16 @@ function Right() { ] }), on_clicked: () => { - switch (powerProfiles.active_profile) { - case 'balanced': - powerProfiles.active_profile = 'performance'; - break; - case 'performance': - powerProfiles.active_profile = 'power-saver'; - break; - default: - powerProfiles.active_profile = 'balanced'; - break; - }; + let next = false + for (const profile of powerProfiles.profiles) { + if (next) { + powerProfiles.active_profile = profile["Profile"] + return + } else if (profile["Profile"] === powerProfiles.active_profile) { + next = true + } + } + powerProfiles.active_profile = powerProfiles.profiles[0]["Profile"] }, }), Widget.Label({