Files
custum-hyprpanel/widget/settings/pages/config/menus/clock.ts
Jas Singh c1bbb11b86 Added the ability to provide a path to a json file for the weather API key. (#374)
* Added the ability to provide a path to a json file for the weather API key.

* Update weather api key subtitle.

* Add jsdoc to methods and consolidate.
2024-10-26 14:32:40 -07:00

49 lines
1.9 KiB
TypeScript

import { Option } from 'widget/settings/shared/Option';
import { Header } from 'widget/settings/shared/Header';
import options from 'options';
import Scrollable from 'types/widgets/scrollable';
import { Attribute, Child } from 'lib/types/widget';
export const ClockMenuSettings = (): Scrollable<Child, Attribute> => {
return Widget.Scrollable({
vscroll: 'automatic',
child: Widget.Box({
class_name: 'bar-theme-page paged-container',
vertical: true,
children: [
Header('Time'),
Option({ opt: options.menus.clock.time.military, title: 'Use 24hr time', type: 'boolean' }),
Option({ opt: options.menus.clock.time.hideSeconds, title: 'Hide seconds', type: 'boolean' }),
Header('Weather'),
Option({ opt: options.menus.clock.weather.enabled, title: 'Enabled', type: 'boolean' }),
Option({
opt: options.menus.clock.weather.location,
title: 'Location',
subtitle: 'Zip Code, Postal Code, City, etc.',
type: 'string',
}),
Option({
opt: options.menus.clock.weather.key,
title: 'Weather API Key',
subtitle: "API Key or path to a JSON file that contains a 'weather_api_key' variable.",
type: 'string',
}),
Option({
opt: options.menus.clock.weather.unit,
title: 'Units',
type: 'enum',
enums: ['imperial', 'metric'],
}),
Option({
opt: options.menus.clock.weather.interval,
title: 'Weather Fetching Interval (ms)',
subtitle: 'May require AGS restart.',
type: 'number',
}),
],
}),
});
};