feat(greetd): focus password first
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-02-06 13:31:36 -05:00
parent ce451079d8
commit 51e4988599

View file

@ -1,3 +1,4 @@
const { idle } = Utils;
const greetd = await Service.import('greetd');
const name = Widget.Entry({
@ -9,8 +10,12 @@ const password = Widget.Entry({
placeholder_text: 'Password',
visibility: false,
on_accept: () => {
greetd.login(name.text || '', password.text || '', 'Hyprland')
.catch((err) => {
greetd.login(
name.text || '',
password.text || '',
'Hyprland',
).catch((err) => {
response.label = JSON.stringify(err);
});
},
@ -19,8 +24,17 @@ const password = Widget.Entry({
const response = Widget.Label();
const win = Widget.Window({
name: 'greeter',
css: 'background-color: transparent;',
anchor: ['top', 'left', 'right', 'bottom'],
keymode: 'exclusive',
setup: () => {
idle(() => {
password.grab_focus();
});
},
child: Widget.Box({
vertical: true,
hpack: 'center',