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

22 lines
510 B
TypeScript
Raw Normal View History

import App from 'resource:///com/github/Aylur/ags/app.js';
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('calendar'),
setup: (self) => {
self.hook(App, (_, windowName, visible) => {
if (windowName === 'calendar') {
self.toggleClassName('toggle-on', visible);
}
});
},
child: Clock(),
2023-09-05 19:22:54 -04:00
});