2024-02-05 12:00:25 -05:00
|
|
|
const greetd = await Service.import('greetd');
|
|
|
|
|
|
|
|
const name = Widget.Entry({
|
|
|
|
placeholder_text: 'Username',
|
|
|
|
on_accept: () => password.grab_focus(),
|
2024-02-05 22:46:43 -05:00
|
|
|
});
|
2024-02-05 12:00:25 -05:00
|
|
|
|
|
|
|
const password = Widget.Entry({
|
|
|
|
placeholder_text: 'Password',
|
|
|
|
visibility: false,
|
|
|
|
on_accept: () => {
|
|
|
|
greetd.login(name.text || '', password.text || '', 'Hyprland')
|
2024-02-05 22:46:43 -05:00
|
|
|
.catch((err) => {
|
|
|
|
response.label = JSON.stringify(err);
|
|
|
|
});
|
2024-02-05 12:00:25 -05:00
|
|
|
},
|
2024-02-05 22:46:43 -05:00
|
|
|
});
|
2024-02-05 12:00:25 -05:00
|
|
|
|
2024-02-05 22:46:43 -05:00
|
|
|
const response = Widget.Label();
|
2024-02-05 12:00:25 -05:00
|
|
|
|
|
|
|
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] };
|