nixos-configs/modules/ags/config/ts/bar/items/tablet-toggle.ts

25 lines
543 B
TypeScript
Raw Normal View History

const { Box, Label } = Widget;
import Tablet from '../../../services/tablet.ts';
import CursorBox from '../../misc/cursorbox.ts';
export default () => CursorBox({
2023-12-18 18:00:30 -05:00
class_name: 'toggle-off',
on_primary_click_release: () => Tablet.toggleMode(),
setup: (self) => {
self.hook(Tablet, () => {
self.toggleClassName('toggle-on', Tablet.tabletMode);
}, 'mode-toggled');
},
child: Box({
2023-12-18 18:00:30 -05:00
class_name: 'tablet-toggle',
vertical: false,
children: [Label(' 󰦧 ')],
}),
2023-12-18 18:00:30 -05:00
});