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

24 lines
515 B
TypeScript
Raw Permalink Normal View History

const { Label } = Widget;
2023-09-04 22:27:34 -04:00
import Tablet from '../../../services/tablet.ts';
import CursorBox from '../../misc/cursorbox.ts';
2023-09-04 22:47:12 -04:00
export default () => CursorBox({
class_name: 'toggle-off',
on_primary_click_release: () => Tablet.toggleOsk(),
setup: (self) => {
self.hook(Tablet, () => {
self.toggleClassName('toggle-on', Tablet.oskState);
}, 'osk-toggled');
},
2023-12-18 18:00:30 -05:00
child: Label({
class_name: 'osk-toggle',
xalign: 0.6,
label: '󰌌 ',
}),
});