diff --git a/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml b/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml index 4636d666b..bc669c0de 100644 --- a/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml +++ b/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml @@ -177,4 +177,51 @@ ContentPage { } } } + + ContentSection { + icon: "weather_mix" + title: Translation.tr("Weather") + ConfigRow { + ConfigSwitch { + buttonIcon: "assistant_navigation" + text: Translation.tr("Enable GPS based location") + checked: Config.options.bar.weather.enableGPS + onCheckedChanged: { + Config.options.bar.weather.enableGPS = checked; + } + } + ConfigSwitch { + buttonIcon: "thermometer" + text: Translation.tr("Use USCS (°F)") + checked: Config.options.bar.weather.useUSCS + onCheckedChanged: { + Config.options.bar.weather.useUSCS = checked; + } + StyledToolTip { + text: Translation.tr("It may take a few seconds to update") + } + } + } + + MaterialTextArea { + Layout.fillWidth: true + placeholderText: Translation.tr("City name") + text: Config.options.bar.weather.city + wrapMode: TextEdit.Wrap + onTextChanged: { + Config.options.bar.weather.city = text; + } + } + ConfigSpinBox { + icon: "av_timer" + text: Translation.tr("Polling interval (m)") + value: Config.options.bar.weather.fetchInterval + from: 5 + to: 50 + stepSize: 5 + onValueChanged: { + Config.options.bar.weather.fetchInterval = value; + } + } + } } diff --git a/dots/.config/quickshell/ii/services/Weather.qml b/dots/.config/quickshell/ii/services/Weather.qml index bf6be8938..a7bb8d5ce 100644 --- a/dots/.config/quickshell/ii/services/Weather.qml +++ b/dots/.config/quickshell/ii/services/Weather.qml @@ -16,6 +16,13 @@ Singleton { readonly property bool useUSCS: Config.options.bar.weather.useUSCS property bool gpsActive: Config.options.bar.weather.enableGPS + onUseUSCSChanged: { + root.getData(); + } + onCityChanged: { + root.getData(); + } + property var location: ({ valid: false, lat: 0,