nixos-configs/nixosModules/ags-v2/v1/config/ts/on-screen-keyboard/main.ts
matt1432 ab8bb48feb
All checks were successful
Discord / discord commits (push) Has been skipped
refactor(ags): remove unneeded agsV1 stuff
2024-11-12 16:55:57 -05:00

32 lines
780 B
TypeScript

const { Window } = Widget;
const { execAsync } = Utils;
import Tablet from '../../services/tablet.ts';
import Gesture from './gesture.ts';
import Keyboard from './keyboard.ts';
/* Types */
import { OskWindow } from 'global-types';
// Start ydotool daemon
execAsync('ydotoold').catch(print);
// Window
export default () => {
const window = Window({
name: 'osk',
layer: 'overlay',
anchor: ['left', 'bottom', 'right'],
})
.hook(Tablet, (self: OskWindow, state) => {
self.attribute.setVisible(state);
}, 'osk-toggled')
.hook(Tablet, () => {
window.visible = !(!Tablet.tabletMode && !Tablet.oskState);
}, 'mode-toggled');
window.child = Keyboard(window);
return Gesture(window);
};