usable
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
{ self, ... }: {
|
||||
|
||||
|
||||
perSystem = { self', pkgs, system, ... }: {
|
||||
@@ -24,6 +24,46 @@
|
||||
cp -r $src/* $out/share
|
||||
'';
|
||||
};
|
||||
|
||||
aurora-greeter-hypr-conf = pkgs.writeText "greeter-conf" ''
|
||||
exec-once=${self.packages.${system}.aurora-greeter}/bin/aurora-greeter
|
||||
'';
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
flake.nixosModules.default = { config, lib, pkgs, ... }: {
|
||||
|
||||
options.services.aurora-greeter = with lib; {
|
||||
enable = mkEnableOption "aurora-greeter";
|
||||
};
|
||||
|
||||
config = let
|
||||
cfg = config.services.aurora-greeter;
|
||||
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
in {
|
||||
|
||||
environment.systemPackages = [
|
||||
self.packages.${system}.aurora-greeter
|
||||
|
||||
self.packages.${system}.aurora-greeter-hypr-conf
|
||||
|
||||
];
|
||||
|
||||
services.greetd = {
|
||||
enable = cfg.enable;
|
||||
|
||||
settings = {
|
||||
|
||||
terminal.vt = 5;
|
||||
|
||||
default_session = {
|
||||
command = "Hyprland -c ${self.packages.${system}.aurora-greeter-hypr-conf}/greeter-conf";
|
||||
#user = "greeter";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import Quickshell.Widgets
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Services.Greetd
|
||||
import Quickshell.Services.Pam
|
||||
|
||||
ClippingWrapperRectangle {
|
||||
|
||||
@@ -19,23 +18,63 @@ ClippingWrapperRectangle {
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
Text {
|
||||
id: error
|
||||
text: ""
|
||||
color: Pywal.colors.color13
|
||||
visible: false
|
||||
}
|
||||
Text {
|
||||
text: "User"
|
||||
color: Pywal.special.foreground
|
||||
}
|
||||
TextInput {
|
||||
id: username
|
||||
text: "guest"
|
||||
color: Pywal.special.foreground
|
||||
}
|
||||
Text {
|
||||
text: "Password"
|
||||
color: Pywal.special.foreground
|
||||
}
|
||||
TextInput {
|
||||
id: password
|
||||
text: "test"
|
||||
echoMode: TextInput.Password
|
||||
color: Pywal.special.foreground
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Login"
|
||||
|
||||
onClicked: {
|
||||
if(Greetd.available) {
|
||||
Greetd.authMessage.connect((m, e, rr, er) => {
|
||||
console.log(m)
|
||||
if(e) {
|
||||
if(er) {
|
||||
error.visible = true
|
||||
error.text = m
|
||||
}
|
||||
} else if(rr) {
|
||||
console.log("send password")
|
||||
Greetd.respond(password.text)
|
||||
}
|
||||
})
|
||||
|
||||
Greetd.authFailure.connect((m) => {
|
||||
error.visible = true
|
||||
error.text = m
|
||||
})
|
||||
|
||||
Greetd.readyToLaunch.connect(() => {
|
||||
console.log("readyToLaunch")
|
||||
Greetd.launch([ "Hyprland" ])
|
||||
})
|
||||
console.log("createSession")
|
||||
Greetd.createSession(username.text)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user