nixos-configs/modules/ags/config/ts/bar/items/cal-opener.ts

20 lines
458 B
TypeScript
Raw Normal View History

import CursorBox from '../../misc/cursorbox.ts';
import Clock from './clock';
2023-09-11 21:10:00 -04:00
export default () => CursorBox({
class_name: 'toggle-off',
on_primary_click_release: () => App.toggleWindow('win-calendar'),
setup: (self) => {
self.hook(App, (_, windowName, visible) => {
if (windowName === 'win-calendar') {
self.toggleClassName('toggle-on', visible);
}
});
},
child: Clock(),
2023-09-05 19:22:54 -04:00
});