diff --git a/nixosModules/ags/config/configurations/greeter.ts b/nixosModules/ags/config/configurations/greeter.ts index ad2517eb..0a3933bd 100644 --- a/nixosModules/ags/config/configurations/greeter.ts +++ b/nixosModules/ags/config/configurations/greeter.ts @@ -1,4 +1,4 @@ -import { execAsync } from 'astal'; +import { subprocess } from 'astal'; import { App } from 'astal/gtk3'; import Greeter from '../widgets/greeter/main'; @@ -12,9 +12,7 @@ export default () => { instanceName: 'greeter', main: () => { - execAsync('hyprpaper').catch(() => { /**/ }); - - Greeter(); + Greeter(subprocess('hyprpaper')); }, }); }; diff --git a/nixosModules/ags/config/widgets/bar/fullscreen.tsx b/nixosModules/ags/config/widgets/bar/fullscreen.tsx index d9c52d89..1f53a6ea 100644 --- a/nixosModules/ags/config/widgets/bar/fullscreen.tsx +++ b/nixosModules/ags/config/widgets/bar/fullscreen.tsx @@ -1,5 +1,5 @@ import { App, Astal, Gdk, Gtk, Widget } from 'astal/gtk3'; -import { bind, Variable } from 'astal'; +import { bind, idle, Variable } from 'astal'; import AstalHyprland from 'gi://AstalHyprland'; const Hyprland = AstalHyprland.get_default(); @@ -65,7 +65,7 @@ export default ({ gdkmonitor?: Gdk.Monitor } & Widget.WindowProps) => { const monitor = get_hyprland_monitor_desc(gdkmonitor); - const BarVisible = Variable(true); + const BarVisible = Variable(false); FullscreenState.subscribe((v) => { BarVisible.set(!v.monitors.includes(monitor)); @@ -183,5 +183,9 @@ export default ({ App.add_window(win); + idle(() => { + BarVisible.set(true); + }); + return win; }; diff --git a/nixosModules/ags/config/widgets/greeter/main.tsx b/nixosModules/ags/config/widgets/greeter/main.tsx index 668cd050..472f17f4 100644 --- a/nixosModules/ags/config/widgets/greeter/main.tsx +++ b/nixosModules/ags/config/widgets/greeter/main.tsx @@ -1,10 +1,12 @@ -import { idle, readFile } from 'astal'; +import { idle, readFile, Process } from 'astal'; import { App, Astal, Gtk, Widget } from 'astal/gtk3'; import AstalGreet from 'gi://AstalGreet'; +import { centerCursor } from '../../lib'; -export default () => { + +export default (hyprpaper: InstanceType) => { const DEFAULT_NAME = 'matt'; const PARSED_INDEX = { name: 0, @@ -67,7 +69,12 @@ export default () => { (_, res) => { try { AstalGreet.login_finish(res); - App.quit(); + App.get_window('greeter')?.set_visible(false); + hyprpaper.kill(); + + setTimeout(() => { + App.quit(); + }, 500); } catch (error) { response.label = JSON.stringify(error); @@ -81,7 +88,16 @@ export default () => { return ( { + centerCursor(); + setTimeout(() => { + self.visible = true; + password.grab_focus(); + }, 1000); + }} > /tmp/ags-greetd.log; hyprctl dispatch exit"