usable
This commit is contained in:
39
config/aurora-greeter/Bar.qml
Normal file
39
config/aurora-greeter/Bar.qml
Normal file
@@ -0,0 +1,39 @@
|
||||
import Quickshell // for PanelWindow
|
||||
import QtQuick // for Text
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Services.Greetd
|
||||
import Quickshell.Services.Pam
|
||||
import qs.modules
|
||||
|
||||
PanelWindow {
|
||||
|
||||
id: root
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
left: true
|
||||
right: true
|
||||
bottom: true
|
||||
}
|
||||
|
||||
margins {
|
||||
top: root.screen.height * 0.4
|
||||
bottom: root.screen.height * 0.4
|
||||
left: root.screen.width * 0.4
|
||||
right: root.screen.width * 0.4
|
||||
}
|
||||
|
||||
focusable: true
|
||||
|
||||
color: "transparent"
|
||||
|
||||
Lock {
|
||||
}
|
||||
|
||||
}
|
||||
25
config/aurora-greeter/default.nix
Normal file
25
config/aurora-greeter/default.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{ ... }: {
|
||||
|
||||
|
||||
perSystem = { self', pkgs, system, ... }: {
|
||||
packages = {
|
||||
|
||||
aurora-greeter-dots = pkgs.stdenv.mkDerivation {
|
||||
|
||||
name = "aurora-greeter-dots";
|
||||
|
||||
src = ./.;
|
||||
|
||||
buildInputs = [];
|
||||
|
||||
buildPhase = ''
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share
|
||||
cp -r $src/* $out/share
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
41
config/aurora-greeter/modules/Lock.qml
Normal file
41
config/aurora-greeter/modules/Lock.qml
Normal file
@@ -0,0 +1,41 @@
|
||||
import Quickshell // for PanelWindow
|
||||
import QtQuick // for Text
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Services.Greetd
|
||||
import Quickshell.Services.Pam
|
||||
|
||||
ClippingWrapperRectangle {
|
||||
|
||||
anchors.fill: parent
|
||||
radius: 10
|
||||
|
||||
color: Pywal.special.background
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
Text {
|
||||
text: "User"
|
||||
}
|
||||
TextInput {
|
||||
text: "guest"
|
||||
}
|
||||
Text {
|
||||
text: "Password"
|
||||
}
|
||||
TextInput {
|
||||
text: "test"
|
||||
echoMode: TextInput.Password
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Login"
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
58
config/aurora-greeter/modules/Pywal.qml
Normal file
58
config/aurora-greeter/modules/Pywal.qml
Normal file
@@ -0,0 +1,58 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
|
||||
Singleton {
|
||||
|
||||
property string wallpaper: json.wallpaper
|
||||
|
||||
property string alpha: json.alpha
|
||||
|
||||
property JsonObject special: json.special
|
||||
property JsonObject colors: json.colors
|
||||
|
||||
FileView {
|
||||
|
||||
path: "/home/nathan/.cache/wal/colors.json"
|
||||
|
||||
watchChanges: true
|
||||
|
||||
onFileChanged: reload()
|
||||
|
||||
JsonAdapter {
|
||||
id: json
|
||||
property string wallpaper: "/home/nathan/Pictures/Wallpaper/bluescape.jpg"
|
||||
|
||||
property string alpha: "100"
|
||||
|
||||
property JsonObject special: JsonObject {
|
||||
property string background: "transparent"
|
||||
property string foreground: "transparent"
|
||||
property string cursor: "transparent"
|
||||
}
|
||||
|
||||
property JsonObject colors: JsonObject {
|
||||
property string color0: "transparent"
|
||||
property string color1: "transparent"
|
||||
property string color2: "transparent"
|
||||
property string color3: "transparent"
|
||||
|
||||
property string color4: "transparent"
|
||||
property string color5: "transparent"
|
||||
property string color6: "transparent"
|
||||
property string color7: "transparent"
|
||||
|
||||
property string color8: "transparent"
|
||||
property string color9: "transparent"
|
||||
property string color10: "transparent"
|
||||
property string color11: "transparent"
|
||||
|
||||
property string color12: "transparent"
|
||||
property string color13: "transparent"
|
||||
property string color14: "transparent"
|
||||
property string color15: "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
config/aurora-greeter/shell.qml
Normal file
18
config/aurora-greeter/shell.qml
Normal file
@@ -0,0 +1,18 @@
|
||||
//@ pragma Env QS_NO_RELOAD_POPUP=1
|
||||
//@ pragma Env QSG_RENDER_LOOP=threaded
|
||||
//@ pragma Env QT_QUICK_FLICKABLE_WHEEL_DECELERATION=10000
|
||||
|
||||
//@ pragma UseQApplication
|
||||
|
||||
import QtQuick
|
||||
import Quickshell // for ShellRoot
|
||||
import Quickshell.Hyprland
|
||||
import qs.modules
|
||||
|
||||
ShellRoot {
|
||||
|
||||
Bar {
|
||||
id: bar
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,13 +21,32 @@ PanelWindow {
|
||||
bottom: true
|
||||
}
|
||||
|
||||
Lock {
|
||||
id: lock
|
||||
bg_path: "/tmp/nathan/tmp.jpg"
|
||||
//locked: true
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: lt
|
||||
interval: 30000
|
||||
|
||||
running: false
|
||||
|
||||
repeat: false
|
||||
|
||||
onTriggered: lock.locked = false
|
||||
}
|
||||
|
||||
|
||||
Component.onCompleted: {
|
||||
|
||||
Hyprland.dispatch("exec hyprctl keyword monitor " + Hyprland.monitorFor(root.screen).name + ",addreserved," + topEx + "," + botEx + "," + leftEx + "," + rightEx)
|
||||
Hyprland.dispatch("exec hyprctl keyword decoration:rounding " + radius)
|
||||
|
||||
|
||||
for(let toplv = 0; toplv < Hyprland.toplevels.values.length; toplv++) {
|
||||
//console.log(Hyprland.toplevels.values[toplv].title)
|
||||
}
|
||||
}
|
||||
|
||||
property int topEx: topRect.reserve
|
||||
@@ -72,6 +91,18 @@ PanelWindow {
|
||||
BarLeft {
|
||||
id: leftRect
|
||||
window: root
|
||||
|
||||
Button {
|
||||
implicitWidth: 30
|
||||
implicitHeight: 30
|
||||
|
||||
x: leftRect.x + leftRect.width / 2 - width / 2
|
||||
y: 200
|
||||
onClicked: {
|
||||
lock.locked = true
|
||||
lt.running = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BarRight {
|
||||
|
||||
@@ -189,7 +189,8 @@ Item {
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
radius: root.radius
|
||||
color: index + 9 == selected ? Pywal.colors.color13 : Pywal.colors.color4
|
||||
property bool use: false
|
||||
color: use ? Pywal.colors.color13 : Pywal.colors.color4
|
||||
//Launcher { anchors.centerIn: parent }
|
||||
Text {
|
||||
font.pointSize: 14
|
||||
@@ -219,11 +220,24 @@ Item {
|
||||
color: Pywal.colors.color0
|
||||
}
|
||||
}
|
||||
onEntered: child.color = Qt.binding(() => index + 9 == selected ? Pywal.colors.color13 : Pywal.colors.color12)
|
||||
onExited: child.color = Qt.binding(() => index + 9 == selected ? Pywal.colors.color13 : Pywal.colors.color4)
|
||||
onEntered: child.color = Qt.binding(() => child.use ? Pywal.colors.color13 : Pywal.colors.color12)
|
||||
onExited: child.color = Qt.binding(() => child.use ? Pywal.colors.color13 : Pywal.colors.color4)
|
||||
onClicked: {
|
||||
selected = index + 9
|
||||
child.color = Qt.binding(() => index + 9 == selected ? Pywal.colors.color13 : Pywal.colors.color12)
|
||||
child.use = !child.use
|
||||
|
||||
switch(index) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
hoverEnabled: true
|
||||
}
|
||||
|
||||
86
config/aurora/modules/Lock.qml
Normal file
86
config/aurora/modules/Lock.qml
Normal file
@@ -0,0 +1,86 @@
|
||||
import Quickshell // for PanelWindow
|
||||
import QtQuick // for Text
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Services.Pam
|
||||
|
||||
Item {
|
||||
|
||||
id: root
|
||||
|
||||
property bool locked: false
|
||||
|
||||
required property string bg_path
|
||||
|
||||
required property LockCtx ctx
|
||||
|
||||
LockCtx {
|
||||
id: ctx
|
||||
|
||||
lock: root.lock
|
||||
}
|
||||
|
||||
WlSessionLock {
|
||||
|
||||
id: lock
|
||||
|
||||
locked: root.locked
|
||||
|
||||
|
||||
WlSessionLockSurface {
|
||||
color: "transparent"
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
|
||||
source: Qt.resolvedUrl(bg_path)
|
||||
|
||||
ClippingWrapperRectangle {
|
||||
|
||||
|
||||
anchors.centerIn: parent
|
||||
radius: 10
|
||||
|
||||
color: Pywal.special.background
|
||||
|
||||
RowLayout {
|
||||
ClippingWrapperRectangle {
|
||||
color: Pywal.colors.color1
|
||||
implicitWidth: 200
|
||||
TextInput {
|
||||
text: ""
|
||||
|
||||
onTextChanged: {
|
||||
ctx.pass = text
|
||||
}
|
||||
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
|
||||
font.pointSize: 30
|
||||
//echoMode: TextInput.Password
|
||||
color: Pywal.special.foreground
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "unlock"
|
||||
onClicked: {
|
||||
ctx.unlock()
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "exit"
|
||||
onClicked: root.locked = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
58
config/aurora/modules/LockCtx.qml
Normal file
58
config/aurora/modules/LockCtx.qml
Normal file
@@ -0,0 +1,58 @@
|
||||
import Quickshell // for PanelWindow
|
||||
import QtQuick // for Text
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Services.Pam
|
||||
|
||||
Scope {
|
||||
|
||||
id: root
|
||||
|
||||
property string pass
|
||||
|
||||
property bool busy: false
|
||||
|
||||
property bool failed: false
|
||||
|
||||
required property WlSessionLock lock
|
||||
|
||||
onPassChanged: failed = false
|
||||
|
||||
function unlock() {
|
||||
if(pass == "") return;
|
||||
|
||||
if(!busy) {
|
||||
root.busy = true
|
||||
pam.start()
|
||||
} else return;
|
||||
}
|
||||
|
||||
PamContext {
|
||||
|
||||
id: pam
|
||||
|
||||
onPamMessage: {
|
||||
if (this.responseRequired) {
|
||||
this.respond(root.pass);
|
||||
}
|
||||
}
|
||||
|
||||
onCompleted: result => {
|
||||
if (result == PamResult.Success) {
|
||||
lock.locked = false
|
||||
} else {
|
||||
root.pass = "";
|
||||
root.failed = true;
|
||||
}
|
||||
|
||||
root.busy = false;
|
||||
}
|
||||
|
||||
config: "aurora-lock.conf"
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ Item {
|
||||
implicitWidth: 20
|
||||
implicitHeight: 20
|
||||
|
||||
color: Pywal.colors.color1
|
||||
color: Pywal.colors.color4
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -31,6 +31,23 @@
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
in {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
swww
|
||||
|
||||
bluez
|
||||
bluez-tools
|
||||
|
||||
wl-clipboard
|
||||
|
||||
brightnessctl
|
||||
|
||||
hyprpicker
|
||||
|
||||
hyprsunset
|
||||
|
||||
wf-recorder
|
||||
];
|
||||
|
||||
programs.quickshell = {
|
||||
enable = cfg.enable;
|
||||
|
||||
|
||||
49
nix/nixosModule.nix
Normal file
49
nix/nixosModule.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{ self, ... }: {
|
||||
|
||||
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;
|
||||
|
||||
greeter-conf = pkgs.writeText "greeter.conf" ''
|
||||
exec-once=${self.packages.${system}.aurora-greeter}
|
||||
'';
|
||||
in {
|
||||
|
||||
services = {
|
||||
upower.enable = true;
|
||||
gvfs.enable = true;
|
||||
power-profiles-daemon.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
self.packages.${system}.aurora-greeter
|
||||
|
||||
];
|
||||
|
||||
environment.etc."pam.d/aurora-lock.conf".text = ''
|
||||
auth required pam_unix.so
|
||||
'';
|
||||
|
||||
services.greetd = {
|
||||
enable = cfg.enable;
|
||||
|
||||
settings = {
|
||||
|
||||
terminal.vt = 1;
|
||||
|
||||
default_session = {
|
||||
command = "Hyprland -c ${greeter-conf}/greeter.conf";
|
||||
#user = "greeter";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user