diff --git a/scripts/screen_record.sh b/scripts/screen_record.sh index af09575..e677e1b 100755 --- a/scripts/screen_record.sh +++ b/scripts/screen_record.sh @@ -39,8 +39,8 @@ startRecording() { # Ensure output directory exists if [ ! -d "$outputDir" ]; then - echo "Error: Output directory '$outputDir' does not exist." - exit 1 + mkdir -p "$outputDir" + echo "Created output directory: $outputDir" fi # Generate output filename and path diff --git a/src/components/menus/calendar/weather/temperature/index.tsx b/src/components/menus/calendar/weather/temperature/index.tsx index 733ea98..82bc6f0 100644 --- a/src/components/menus/calendar/weather/temperature/index.tsx +++ b/src/components/menus/calendar/weather/temperature/index.tsx @@ -1,14 +1,10 @@ import { Gtk } from 'astal/gtk3'; import { bind } from 'astal'; import WeatherService from 'src/services/weather'; -import options from 'src/configuration'; import { toTitleCase } from 'src/lib/string/formatters'; -const { unit } = options.menus.clock.weather; const weatherService = WeatherService.getInstance(); -unit.subscribe((unitType) => (weatherService.unit = unitType)); - const WeatherStatus = (): JSX.Element => { return ( diff --git a/src/services/weather/index.ts b/src/services/weather/index.ts index f232137..68f3dfd 100644 --- a/src/services/weather/index.ts +++ b/src/services/weather/index.ts @@ -2,14 +2,14 @@ import { AstalIO, bind, interval, Variable } from 'astal'; import { getWeatherProvider } from 'src/services/weather/adapters/registry'; import { WeatherApiKeyManager } from './keyManager'; import options from 'src/configuration'; -import { Opt } from 'src/lib/options'; import { httpClient } from 'src/lib/httpClient'; import { GaugeIcon, Percentage, Weather, WeatherIcon } from './types'; import { DEFAULT_WEATHER } from './default'; import { WeatherProvider } from './adapters/types'; import { TemperatureConverter } from 'src/lib/units/temperature'; import { SpeedConverter } from 'src/lib/units/speed'; -import { UnitType } from 'src/lib/units/temperature/types'; + +const { interval: weatherInterval, location, unit } = options.menus.clock.weather; /** * Service for fetching and managing weather data from various providers @@ -19,11 +19,11 @@ export default class WeatherService { private _currentProvider = 'weatherapi'; - private readonly _location: Opt; + private readonly _location = location; + private readonly _intervalFrequency = weatherInterval; + private readonly _unitType = unit; - private readonly _intervalFrequency: Opt; private _interval: null | AstalIO.Time = null; - private _unitType: Variable = Variable('imperial'); private _weatherData: Variable = Variable(DEFAULT_WEATHER); private _temperature: Variable = Variable(this._getTemperature()); @@ -33,11 +33,6 @@ export default class WeatherService { private _gaugeIcon: Variable = Variable(this._getGaugeIcon()); private constructor() { - const { interval, location } = options.menus.clock.weather; - - this._intervalFrequency = interval; - this._location = location; - this._initializeConfigTracker(); this._initializeWeatherTracker(); } @@ -128,24 +123,6 @@ export default class WeatherService { return this._gaugeIcon; } - /** - * Gets the current temperature unit type - * - * @returns Current unit type ('imperial' or 'metric') - */ - public get unit(): UnitType { - return this._unitType.get(); - } - - /** - * Sets the temperature unit type - * - * @param unitType - New unit type ('imperial' or 'metric') - */ - public set unit(unitType: UnitType) { - this._unitType.set(unitType); - } - /** * Gets the temperature from the weather data in the specified unit. *