feat(greetd): focus password first
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
ce451079d8
commit
51e4988599
1 changed files with 18 additions and 4 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
const { idle } = Utils;
|
||||||
const greetd = await Service.import('greetd');
|
const greetd = await Service.import('greetd');
|
||||||
|
|
||||||
const name = Widget.Entry({
|
const name = Widget.Entry({
|
||||||
|
@ -9,8 +10,12 @@ const password = Widget.Entry({
|
||||||
placeholder_text: 'Password',
|
placeholder_text: 'Password',
|
||||||
visibility: false,
|
visibility: false,
|
||||||
on_accept: () => {
|
on_accept: () => {
|
||||||
greetd.login(name.text || '', password.text || '', 'Hyprland')
|
greetd.login(
|
||||||
.catch((err) => {
|
name.text || '',
|
||||||
|
password.text || '',
|
||||||
|
'Hyprland',
|
||||||
|
|
||||||
|
).catch((err) => {
|
||||||
response.label = JSON.stringify(err);
|
response.label = JSON.stringify(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -19,8 +24,17 @@ const password = Widget.Entry({
|
||||||
const response = Widget.Label();
|
const response = Widget.Label();
|
||||||
|
|
||||||
const win = Widget.Window({
|
const win = Widget.Window({
|
||||||
|
name: 'greeter',
|
||||||
css: 'background-color: transparent;',
|
css: 'background-color: transparent;',
|
||||||
anchor: ['top', 'left', 'right', 'bottom'],
|
anchor: ['top', 'left', 'right', 'bottom'],
|
||||||
|
keymode: 'exclusive',
|
||||||
|
|
||||||
|
setup: () => {
|
||||||
|
idle(() => {
|
||||||
|
password.grab_focus();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
child: Widget.Box({
|
child: Widget.Box({
|
||||||
vertical: true,
|
vertical: true,
|
||||||
hpack: 'center',
|
hpack: 'center',
|
||||||
|
|
Loading…
Reference in a new issue