forked from Shinonome/dots-hyprland
feat: sound alerts for battery and pomodoro (#2223)
This commit is contained in:
@@ -245,6 +245,7 @@ Singleton {
|
||||
property JsonObject battery: JsonObject {
|
||||
property int low: 20
|
||||
property int critical: 5
|
||||
property int full: 101
|
||||
property bool automaticSuspend: true
|
||||
property int suspend: 3
|
||||
}
|
||||
@@ -418,13 +419,18 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
property JsonObject sounds: JsonObject {
|
||||
property bool battery: false
|
||||
property bool pomodoro: false
|
||||
property string theme: "freedesktop"
|
||||
}
|
||||
|
||||
property JsonObject time: JsonObject {
|
||||
// https://doc.qt.io/qt-6/qtime.html#toString
|
||||
property string format: "hh:mm"
|
||||
property string shortDateFormat: "dd/MM"
|
||||
property string dateFormat: "ddd, dd/MM"
|
||||
property JsonObject pomodoro: JsonObject {
|
||||
property string alertSound: ""
|
||||
property int breakTime: 300
|
||||
property int cyclesBeforeLongBreak: 4
|
||||
property int focus: 1500
|
||||
|
||||
@@ -113,6 +113,20 @@ ContentPage {
|
||||
}
|
||||
}
|
||||
}
|
||||
ConfigRow {
|
||||
uniform: true
|
||||
ConfigSpinBox {
|
||||
icon: "charger"
|
||||
text: Translation.tr("Full warning")
|
||||
value: Config.options.battery.full
|
||||
from: 0
|
||||
to: 101
|
||||
stepSize: 5
|
||||
onValueChanged: {
|
||||
Config.options.battery.full = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ContentSection {
|
||||
@@ -241,6 +255,30 @@ ContentPage {
|
||||
}
|
||||
}
|
||||
|
||||
ContentSection {
|
||||
icon: "notification_sound"
|
||||
title: Translation.tr("Sounds")
|
||||
ConfigRow {
|
||||
uniform: true
|
||||
ConfigSwitch {
|
||||
buttonIcon: "battery_android_full"
|
||||
text: Translation.tr("Battery")
|
||||
checked: Config.options.sounds.battery
|
||||
onCheckedChanged: {
|
||||
Config.options.sounds.battery = checked;
|
||||
}
|
||||
}
|
||||
ConfigSwitch {
|
||||
buttonIcon: "av_timer"
|
||||
text: Translation.tr("Pomodoro")
|
||||
checked: Config.options.sounds.pomodoro
|
||||
onCheckedChanged: {
|
||||
Config.options.sounds.pomodoro = checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ContentSection {
|
||||
icon: "nest_clock_farsight_analog"
|
||||
title: Translation.tr("Time")
|
||||
|
||||
Reference in New Issue
Block a user