nixos-configs/modules/ags/config/greeter.ts
matt1432 eb9ba2a7a4
All checks were successful
Discord / discord commits (push) Has been skipped
refactor(greetd): move ags conf into ags module
2024-02-05 22:46:43 -05:00

38 lines
892 B
TypeScript

const greetd = await Service.import('greetd');
const name = Widget.Entry({
placeholder_text: 'Username',
on_accept: () => password.grab_focus(),
});
const password = Widget.Entry({
placeholder_text: 'Password',
visibility: false,
on_accept: () => {
greetd.login(name.text || '', password.text || '', 'Hyprland')
.catch((err) => {
response.label = JSON.stringify(err);
});
},
});
const response = Widget.Label();
const win = Widget.Window({
css: 'background-color: transparent;',
anchor: ['top', 'left', 'right', 'bottom'],
child: Widget.Box({
vertical: true,
hpack: 'center',
vpack: 'center',
hexpand: true,
vexpand: true,
children: [
name,
password,
response,
],
}),
});
export default { windows: [win] };