diff --git a/config/aurora-greeter/default.nix b/config/aurora-greeter/default.nix index a853721..0281834 100644 --- a/config/aurora-greeter/default.nix +++ b/config/aurora-greeter/default.nix @@ -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"; + }; + }; + }; }; }; } diff --git a/config/aurora-greeter/modules/Lock.qml b/config/aurora-greeter/modules/Lock.qml index a896407..f998daa 100644 --- a/config/aurora-greeter/modules/Lock.qml +++ b/config/aurora-greeter/modules/Lock.qml @@ -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) + } + } } } } diff --git a/config/aurora/default.nix b/config/aurora/default.nix index 5df3478..1306fd3 100644 --- a/config/aurora/default.nix +++ b/config/aurora/default.nix @@ -1,4 +1,9 @@ -{ ... }: { +{ self, inputs, ... }: { + + imports = [ + inputs.home-manager.flakeModules.home-manager + ]; + perSystem = { self', pkgs, system, ... }: { @@ -27,4 +32,85 @@ default = self'.packages.aurora; }; }; + + flake.nixosModules.default = { config, lib, pkgs, ... }: { + + config = { + + services = { + upower.enable = true; + gvfs.enable = true; + power-profiles-daemon.enable = true; + }; + + environment.etc."pam.d/aurora-lock.conf".text = '' + auth required pam_unix.so + ''; + }; + }; + + flake.homeModules.default = { config, lib, pkgs, ... }: { + + options.programs.aurora = with lib; { + enable = mkEnableOption "aurora"; + + package = mkPackageOption self.packages.${pkgs.stdenv.hostPlatform.system} "aurora" { + default = [ "aurora" ]; + + example = ''aurora.packages."x86_64-linux".hybar''; + }; + + systemd = { + enable = mkEnableOption "aurora systemd unit"; + + target = mkOption { + type = types.str; + default = "hyprland-session.target"; + }; + }; + }; + + config = let + cfg = config.programs.aurora; + + 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; + + package = cfg.package; + + activeConfig = "aurora"; + + configs = { + default = "${self.packages.${system}.aurora-dots}/share"; + aurora = "${self.packages.${system}.aurora-dots}/share"; + hybar = "${self.packages.${system}.hybar-dots}/share"; + }; + + systemd = { + enable = cfg.systemd.enable; + target = cfg.systemd.target; + }; + }; + }; + }; } diff --git a/config/aurora/modules/Bar.qml b/config/aurora/modules/Bar.qml index 9f008db..034f766 100644 --- a/config/aurora/modules/Bar.qml +++ b/config/aurora/modules/Bar.qml @@ -12,7 +12,22 @@ PanelWindow { property real radius: 10 - onRadiusChanged: Hyprland.dispatch("exec hyprctl keyword decoration:rounding " + radius) + property list hyprcmds: [ + "exec hyprctl --batch '" + + "keyword general:gaps_out 5;" + + "keyword general:border_size 1;" + + "keyword windowrule match:title lockscreen, no_blur on, fullscreen on;" + + "keyword misc:session_lock_xray true;" + + "keyword decoration:blur:enabled true;" + + "keyword decoration:active_opacity 0.96;" + + "keyword decoration:inactive_opacity 0.96;" + + "keyword decoration:rounding " + radius + ";" + + "keyword monitor " + Hyprland.monitorFor(root.screen).name + ",1920x1080@60,0x0,1" + ";" + + "keyword monitor " + Hyprland.monitorFor(root.screen).name + ",addreserved," + topEx + "," + botEx + "," + leftEx + "," + rightEx + ";" + + "'" + ] + + onRadiusChanged: root.hyprcmds.forEach((c) => Hyprland.dispatch(c)) anchors { top: true @@ -21,32 +36,10 @@ 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) - } + root.hyprcmds.forEach((c) => { Hyprland.dispatch(c) }) } property int topEx: topRect.reserve @@ -55,6 +48,7 @@ PanelWindow { property int leftEx: leftRect.reserve property int rightEx: rightRect.reserve + property color bg: (Pywal.special.background) id: root @@ -81,43 +75,47 @@ PanelWindow { Region { item: dash.visible ? dash : leftRect } + + Region { + item: botRect + } + + Region { + item: botRect.midFO.visible ? botRect.midFO : botRect + } } BarBottom { id: botRect + radius: root.radius + hyprcmds: root.hyprcmds + x: leftRect.x + leftRect.width + implicitWidth: rightRect.x - (leftRect.x + leftRect.width) + color: root.bg } 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 - } - } + color: root.bg } BarRight { id: rightRect + color: root.bg } Shape { - x: leftRect.x + leftRect.width - 1 + x: leftRect.cornerX y: topRect.cornerY ShapePath { - strokeWidth: 4 - strokeColor: Pywal.special.background - fillColor: Pywal.special.background + strokeWidth: 1 + + strokeColor: "transparent" + fillColor: Pywal.argb(Pywal.special.background) startX: 0; startY: 0 PathLine { relativeX: 0; relativeY: radius } @@ -132,13 +130,15 @@ PanelWindow { } Shape { - x: rightRect.x + 1 + x: rightRect.x y: topRect.cornerY ShapePath { - strokeWidth: 4 - strokeColor: Pywal.special.background - fillColor: Pywal.special.background + strokeWidth: 1 + + strokeColor: "transparent" + fillColor: Pywal.argb(Pywal.special.background) + startX: 0; startY: 0 PathLine { relativeX: 0; relativeY: radius } @@ -154,13 +154,15 @@ PanelWindow { } Shape { - x: leftRect.x + leftRect.width - 1 - y: botRect.y + 1 + x: leftRect.cornerX + y: botRect.cornerY ShapePath { - strokeWidth: 4 - strokeColor: Pywal.special.background - fillColor: Pywal.special.background + strokeWidth: 1 + + strokeColor: "transparent" + fillColor: Pywal.argb(Pywal.special.background) + startX: 0; startY: 0 PathLine { relativeX: 0; relativeY: -radius } @@ -176,13 +178,14 @@ PanelWindow { } Shape { - x: rightRect.x + 1 - y: botRect.y + 1 + x: rightRect.x + y: botRect.cornerY ShapePath { - strokeWidth: 4 - strokeColor: Pywal.special.background - fillColor: Pywal.special.background + strokeWidth: 1 + strokeColor: "transparent" + fillColor: Pywal.argb(Pywal.special.background) + startX: 0; startY: 0 PathLine { relativeX: 0; relativeY: -radius } @@ -203,6 +206,7 @@ PanelWindow { //y: topRect.y + topRect.height - 1 window: root radius: root.radius + color: root.bg onShowDashChanged: dash.visible = showDash } diff --git a/config/aurora/modules/BarBottom.qml b/config/aurora/modules/BarBottom.qml index e9c9716..0e32a61 100644 --- a/config/aurora/modules/BarBottom.qml +++ b/config/aurora/modules/BarBottom.qml @@ -9,11 +9,49 @@ import Quickshell.Wayland import Quickshell.Hyprland -Rectangle { - property real reserve: height - id: botRect +ColumnLayout { + id: root + + property real reserve: botRectArea.height + + required property real radius + required property color color + + property real cornerY: y + botRectArea.y + + required property list hyprcmds + + property Item midFO: midFO + y: parent.height - height - color: Pywal.special.background - implicitHeight: 10 + implicitWidth: parent.width + spacing: -10 + + Launcher { + id: midFO + radius: root.radius + Layout.alignment: Qt.AlignHCenter + hyprcmds: root.hyprcmds + color: root.color + } + + WrapperMouseArea { + id: botRectArea + Rectangle { + id: botRect + color: root.color + anchors.fill: parent + } + implicitHeight: 10 + implicitWidth: parent.width + + hoverEnabled: true + onEntered: { + midFO.visible = true + } + } + + } + diff --git a/config/aurora/modules/BarLeft.qml b/config/aurora/modules/BarLeft.qml index a8c1ffe..4ec6478 100644 --- a/config/aurora/modules/BarLeft.qml +++ b/config/aurora/modules/BarLeft.qml @@ -14,6 +14,7 @@ Rectangle { id: leftRect property real reserve: width + property real cornerX: width required property QsWindow window @@ -21,10 +22,7 @@ Rectangle { implicitWidth: 40 - color: Pywal.special.background - - - Launcher { + LauncherButton { id: launcher x: parent.width / 2 - implicitWidth / 2 y: implicitWidth / 3 diff --git a/config/aurora/modules/BarRight.qml b/config/aurora/modules/BarRight.qml index d86de4b..5593768 100644 --- a/config/aurora/modules/BarRight.qml +++ b/config/aurora/modules/BarRight.qml @@ -13,7 +13,6 @@ Rectangle { property real reserve: width id: rightRect x: parent.width - width - color: Pywal.special.background implicitWidth: 10 implicitHeight: parent.height } diff --git a/config/aurora/modules/BarTop.qml b/config/aurora/modules/BarTop.qml index 1e2570e..43e5d05 100644 --- a/config/aurora/modules/BarTop.qml +++ b/config/aurora/modules/BarTop.qml @@ -10,15 +10,16 @@ import Quickshell.Hyprland ColumnLayout { - spacing: -1 + spacing: 0 id: root + required property color color WrapperMouseArea { id: topRectArea Rectangle { id: topRect - color: Pywal.special.background + color: root.color anchors.fill: parent } implicitHeight: 10 @@ -34,7 +35,7 @@ ColumnLayout { required property real radius - property real cornerY: topRectArea.height - 1 + property real cornerY: topRectArea.height //property real reserve: midFO.visible ? root.height : topRectArea.height property real reserve: topRectArea.height @@ -52,7 +53,7 @@ ColumnLayout { Layout.alignment: Qt.AlignHCenter - color: Pywal.special.background + color: root.color visible: true diff --git a/config/aurora/modules/Battery.qml b/config/aurora/modules/Battery.qml index 82ad37f..ff4478e 100644 --- a/config/aurora/modules/Battery.qml +++ b/config/aurora/modules/Battery.qml @@ -19,7 +19,7 @@ ClippingWrapperRectangle { Text { id: text - text: UPower.displayDevice.percentage * 100 + "%" + text: Math.round(UPower.displayDevice.percentage * 100) + "%" padding: 10 diff --git a/config/aurora/modules/Clock.qml b/config/aurora/modules/Clock.qml index 9ec19c3..58c443c 100644 --- a/config/aurora/modules/Clock.qml +++ b/config/aurora/modules/Clock.qml @@ -19,6 +19,7 @@ WrapperMouseArea { horizontalAlignment: Text.AlignHCenter text: Qt.formatDateTime(clock.date, "dddd HH:mm:ss MM/dd/yyyy") font.pointSize: 11 + color: Pywal.special.background SystemClock { id: clock diff --git a/config/aurora/modules/Dashboard.qml b/config/aurora/modules/Dashboard.qml index 2c83c90..c2cb216 100644 --- a/config/aurora/modules/Dashboard.qml +++ b/config/aurora/modules/Dashboard.qml @@ -23,6 +23,19 @@ Item { property int selected: 0 + IpcHandler { + target: "dashboard" + + function show() { root.visible = true; } + function hide() { root.visible = false; } + function toggle() { root.visible = !root.visible; } + } + + Power { + id: power + visible: false + } + VFlyoutDown { @@ -68,7 +81,7 @@ Item { implicitHeight: 40 radius: root.radius color: index == selected ? Pywal.colors.color13 : Pywal.colors.color4 - //Launcher { anchors.centerIn: parent } + //LauncherButton { anchors.centerIn: parent } Text { font.pointSize: 14 text: switch(index) { @@ -128,27 +141,29 @@ Item { onNotification: (n) => { n.tracked = !n.transient + n.closed.connect(() => { console.log("notif closed") }) } } + Loader { anchors.fill: parent - readonly property Component launcher: Launcher {} + readonly property Component launcher: LauncherButton {} readonly property Component notifs: Notifications { server: nserver } readonly property Component bt: Bluetooth {} readonly property Component vol: Volume {} readonly property Component bat: PowerMode {} - readonly property Component mon: Launcher {} + readonly property Component mon: LauncherButton {} - readonly property Component net: Launcher {} - readonly property Component mus: Launcher {} + readonly property Component net: LauncherButton {} + readonly property Component mus: LauncherButton {} readonly property Component clk: Clock {} - readonly property Component wal: Launcher {} + readonly property Component wal: LauncherButton {} sourceComponent: switch(selected) { case 0: @@ -191,7 +206,7 @@ Item { radius: root.radius property bool use: false color: use ? Pywal.colors.color13 : Pywal.colors.color4 - //Launcher { anchors.centerIn: parent } + //LauncherButton { anchors.centerIn: parent } Text { font.pointSize: 14 text: switch(index) { @@ -235,6 +250,7 @@ Item { case 6: case 7: case 8: + power.visible = true default: break; } diff --git a/config/aurora/modules/Launcher.qml b/config/aurora/modules/Launcher.qml index 4afa9cb..61cac69 100644 --- a/config/aurora/modules/Launcher.qml +++ b/config/aurora/modules/Launcher.qml @@ -1,36 +1,37 @@ 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 -WrapperMouseArea { - ClippingWrapperRectangle { - radius: 3 - implicitWidth: 30; implicitHeight: 30 - Text { - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - anchors.fill: parent - text: " " - font.pointSize: 16 - color: Pywal.special.foreground - } - color: { - containsMouse - ? Pywal.colors.color12 - : Pywal.colors.color1 +VFlyoutUp { + id: midFO + + required property list hyprcmds + + visible: false + + item: content + + onExited: visible = false + + ClippingRectangle { + id: content + radius: root.radius + implicitWidth: 700 + implicitHeight: 450 + + color: Pywal.colors.color1 + + Wallpaper { + implicitWidth: 700 + //implicitHeight: 350 + hyprcmds: midFO.hyprcmds } } - - hoverEnabled: true - - Process { - id: launcher - running: false - command: ["rofi", "-show", "drun", "-show-icons" ] - } - - onClicked: launcher.running = true } diff --git a/config/aurora/modules/LauncherButton.qml b/config/aurora/modules/LauncherButton.qml new file mode 100644 index 0000000..4afa9cb --- /dev/null +++ b/config/aurora/modules/LauncherButton.qml @@ -0,0 +1,36 @@ +import Quickshell // for PanelWindow +import QtQuick // for Text +import QtQuick.Controls +import Quickshell.Io +import Quickshell.Widgets + +WrapperMouseArea { + ClippingWrapperRectangle { + radius: 3 + implicitWidth: 30; implicitHeight: 30 + Text { + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + anchors.fill: parent + text: " " + font.pointSize: 16 + + color: Pywal.special.foreground + } + color: { + containsMouse + ? Pywal.colors.color12 + : Pywal.colors.color1 + } + } + + hoverEnabled: true + + Process { + id: launcher + running: false + command: ["rofi", "-show", "drun", "-show-icons" ] + } + + onClicked: launcher.running = true +} diff --git a/config/aurora/modules/Lock.qml b/config/aurora/modules/Lock.qml index c9b765b..6f1c2c4 100644 --- a/config/aurora/modules/Lock.qml +++ b/config/aurora/modules/Lock.qml @@ -15,17 +15,19 @@ Item { property bool locked: false - onLockedChanged: lock.locked = locked + onLockedChanged: { + lock.locked = locked + } required property string bg_path - property color fieldColor: ctx.failed ? "red" : Pywal.colors.color1 + property color fieldColor: ctx.failed ? Pywal.colors.color6 : Pywal.colors.color1 IpcHandler { target: "lockscreen" - function lock() { lock.locked = true; } - function unlock() { lock.locked = false; } + function lock() { root.locked = true; } + function unlock() { root.locked = false; } } LockCtx { @@ -33,6 +35,11 @@ Item { onShouldUnlock: lock.locked = false } + + LockScreen { + id: lockscreen + visible: root.locked + } WlSessionLock { @@ -47,50 +54,52 @@ Item { WlSessionLockSurface { color: "transparent" - Image { + /*Image { anchors.fill: parent source: Qt.resolvedUrl(bg_path) - ClippingWrapperRectangle { + }*/ + ClippingWrapperRectangle { - anchors.centerIn: parent - radius: 10 + anchors.centerIn: parent + radius: 10 - color: Pywal.special.background + color: Pywal.special.background - RowLayout { - ClippingWrapperRectangle { - color: root.fieldColor - implicitWidth: 200 - TextInput { - text: "" + RowLayout { + ClippingWrapperRectangle { + color: root.fieldColor + implicitWidth: 200 + TextInput { + text: "" - onTextChanged: { - ctx.pass = text - } - - horizontalAlignment: TextInput.AlignHCenter - - font.pointSize: 30 - //echoMode: TextInput.Password - color: Pywal.special.foreground + onTextChanged: { + ctx.pass = text } - } - Button { - text: "unlock" - onClicked: { - ctx.doUnlock() - } - } + echoMode: TextInput.Password - Button { - text: "exit" - onClicked: root.locked = false + horizontalAlignment: TextInput.AlignHCenter + verticalAlignment: TextInput.AlignVCenter + + font.pointSize: 30 + color: Pywal.special.foreground } } + + Button { + text: "unlock" + onClicked: { + ctx.doUnlock() + } + } + + Button { + text: "exit" + onClicked: root.locked = false + } } } } diff --git a/config/aurora/modules/LockScreen.qml b/config/aurora/modules/LockScreen.qml new file mode 100644 index 0000000..9edeacd --- /dev/null +++ b/config/aurora/modules/LockScreen.qml @@ -0,0 +1,17 @@ +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 + +FloatingWindow { + title: "lockscreen" + + visible: false + + color: "transparent" +} diff --git a/config/aurora/modules/Power.qml b/config/aurora/modules/Power.qml index 51b7775..7ed5498 100644 --- a/config/aurora/modules/Power.qml +++ b/config/aurora/modules/Power.qml @@ -1,120 +1,126 @@ -import Quickshell +import Quickshell // for PanelWindow import QtQuick // for Text +import QtQuick.Shapes import QtQuick.Controls import QtQuick.Layouts -import Quickshell.Hyprland import Quickshell.Io import Quickshell.Widgets +import Quickshell.Wayland +import Quickshell.Hyprland -Item { - width: 30 - height: 30 +PanelWindow { + + anchors { + top: true + left: true + right: true + bottom: true + } + + exclusionMode: ExclusionMode.Ignore + WlrLayershell.layer: WlrLayer.Overlay id: root - required property PanelWindow window - required property real popupOffset - - ClippingWrapperRectangle { - radius: 5 - width: 30; height: 30 - Button { - id: button - text: " " - font.pointSize: 16 - - onClicked: { - menu.visible = true - grab.active = true - } - implicitHeight: parent.height - } + mask: Region { + item: out } - PopupWindow { - - id: menu + color: "#99000000" - anchor.window: window - anchor.rect.x: popupOffset - anchor.rect.y: 50 - implicitWidth: 150 - implicitHeight: 250 - visible: false + Lock { + id: lock + bg_path: "/tmp/nathan/tmp.jpg" + //locked: true + } - color: "transparent" - - ClippingWrapperRectangle { - radius: 5 + MouseArea { - implicitHeight: parent.height - 20 - implicitWidth: parent.width - - ColumnLayout { + id: out - spacing: 0 + anchors.fill: parent - Button { - Layout.topMargin: 5 - x: (parent.width - width) / 2 - implicitWidth: parent.width - 10 - implicitHeight: parent.height / 5 - parent.spacing + onClicked: { + root.visible = false + } - text: 'shutdown' - onClicked: shutdown.running = true - Process { - id: shutdown - running: false - command: ["systemctl", "poweroff"] - } - } - - Button { - x: (parent.width - width) / 2 - implicitWidth: parent.width - 10 - implicitHeight: parent.height / 5 - parent.spacing - text: 'reboot' - onClicked: reboot.running = true - Process { - id: reboot - running: false - command: ["systemctl", "reboot"] - } - } - - Button { - x: (parent.width - width) / 2 - implicitWidth: parent.width - 10 - implicitHeight: parent.height / 5 - parent.spacing - text: 'logout' - onClicked: logout.running = true - Process { - id: logout - running: false - command: ["loginctl", "kill-session", "self" ] - } - } - - Button { - Layout.bottomMargin: 10 - x: (parent.width - width) / 2 - implicitWidth: parent.width - 10 - implicitHeight: parent.height / 5 - parent.spacing - text: 'sleep' - onClicked: sleep.running = true - Process { - id: sleep - running: false - command: ["systemctl", "sleep"] + ClippingRectangle { + implicitWidth: 200 + implicitHeight: 200 + id: main + anchors.centerIn: parent + radius: 10 + color: "transparent" + GridLayout { + columns: 2 + rows: 2 + + Repeater { + model: 4 + WrapperMouseArea { + ClippingWrapperRectangle { + radius: 10 + Text { + text: switch(index) { + case 0: + return "󰍃" + case 1: + return " " + case 2: + return " " + case 3: + return " " + default: + return " " + break; + } + font.pointSize: 16 + + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + + color: Pywal.special.foreground + } + + implicitHeight: 60 + implicitWidth: 60 + color: parent.contansMouse ? Pywal.colors.color12 : Pywal.colors.color4 + } + + hoverEnabled: true + + onEntered: { + child.color = Pywal.colors.color12 + } + + onExited: { + child.color = Pywal.colors.color4 + } + + onClicked: { + root.visible = false + switch(index) { + case 0: + Hyprland.dispatch("exec loginctl kill-session self") + break; + case 1: + Hyprland.dispatch("exec systemctl reboot") + break; + case 2: + Hyprland.dispatch("exec loginctl lock-session") + break; + case 3: + Hyprland.dispatch("exec systemctl poweroff") + break; + default: + lock.locked = true + break; + } + } } } } } - - HyprlandFocusGrab { - id: grab - windows: [ menu ] - onCleared: menu.visible = false - } } + } diff --git a/config/aurora/modules/PowerMode.qml b/config/aurora/modules/PowerMode.qml index 712b089..f5d97ed 100644 --- a/config/aurora/modules/PowerMode.qml +++ b/config/aurora/modules/PowerMode.qml @@ -20,6 +20,8 @@ ColumnLayout { text: 'performance' onClicked: PowerProfiles.profile = PowerProfile.Performance visible: PowerProfiles.hasPerformanceProfile + + background: Rectangle { color: PowerProfiles.profile == PowerProfile.Performance ? Pywal.colors.color13 : Pywal.colors.color4 } } Button { Layout.topMargin: 5 @@ -29,6 +31,7 @@ ColumnLayout { text: 'balanced' onClicked: PowerProfiles.profile = PowerProfile.Balanced + background: Rectangle { color: PowerProfiles.profile == PowerProfile.Balanced ? Pywal.colors.color13 : Pywal.colors.color4 } } Button { Layout.topMargin: 5 @@ -38,5 +41,6 @@ ColumnLayout { text: 'power saver' onClicked: PowerProfiles.profile = PowerProfile.PowerSaver + background: Rectangle { color: PowerProfiles.profile == PowerProfile.PowerSaver ? Pywal.colors.color13 : Pywal.colors.color4 } } } diff --git a/config/aurora/modules/Pywal.qml b/config/aurora/modules/Pywal.qml index 5fcf2c8..bc0d7db 100644 --- a/config/aurora/modules/Pywal.qml +++ b/config/aurora/modules/Pywal.qml @@ -7,11 +7,15 @@ Singleton { property string wallpaper: json.wallpaper - property string alpha: json.alpha + property string alpha: Math.round(parseInt(json.alpha, 10) * 0xFF / 100).toString(16) property JsonObject special: json.special property JsonObject colors: json.colors + function argb(c) { + return c.slice(0, 1) + Pywal.alpha + c.slice(1) + } + FileView { path: "/home/nathan/.cache/wal/colors.json" diff --git a/config/aurora/modules/VFlyoutDown.qml b/config/aurora/modules/VFlyoutDown.qml index a4a3845..c873d5a 100644 --- a/config/aurora/modules/VFlyoutDown.qml +++ b/config/aurora/modules/VFlyoutDown.qml @@ -17,7 +17,7 @@ MouseArea { Component.onCompleted: { - item.y = pad + item.y = root.y + pad } width: shape.width @@ -30,8 +30,8 @@ MouseArea { ShapePath { id: path - strokeWidth: 4 - strokeColor: root.color + strokeWidth: 1 + strokeColor: "transparent" fillColor: root.color startX: -root.radius - pad; startY: 0 diff --git a/config/aurora/modules/VFlyoutLeft.qml b/config/aurora/modules/VFlyoutLeft.qml index a4a3845..bb5438f 100644 --- a/config/aurora/modules/VFlyoutLeft.qml +++ b/config/aurora/modules/VFlyoutLeft.qml @@ -17,7 +17,7 @@ MouseArea { Component.onCompleted: { - item.y = pad + item.x = pad } width: shape.width @@ -34,8 +34,19 @@ MouseArea { strokeColor: root.color fillColor: root.color - startX: -root.radius - pad; startY: 0 + startX: 0; startY: -root.radius - pad + PathArc { + radiusX: root.radius + radiusY: root.radius + + direction: PathArc.Counterclockwise + + relativeX: root.radius + relativeY: root.radius + } + PathLine { x: item.width + 2 * pad - root.radius; relativeY: 0 } + PathArc { radiusX: root.radius radiusY: root.radius @@ -50,13 +61,13 @@ MouseArea { radiusX: root.radius radiusY: root.radius - direction: PathArc.Counterclockwise - - relativeX: root.radius + relativeX: -root.radius relativeY: root.radius } - PathLine { x: item.width + pad - root.radius; relativeY: 0 } + PathLine { relativeX: -item.width - 2 * pad + 2 * root.radius; relativeY: 0 } + + PathArc { radiusX: root.radius @@ -64,21 +75,12 @@ MouseArea { direction: PathArc.Counterclockwise - relativeX: root.radius - relativeY: -root.radius + relativeX: -root.radius + relativeY: root.radius } - PathLine { relativeX: 0; relativeY: -item.height + 2 * root.radius - 2 * pad } - PathArc { - radiusX: root.radius - radiusY: root.radius - - relativeX: root.radius - relativeY: -root.radius - } - - PathLine { x: -root.radius - pad; y: 0 } + PathLine { x: 0; y: -root.radius - pad } } } } diff --git a/config/aurora/modules/VFlyoutRight.qml b/config/aurora/modules/VFlyoutRight.qml index a4a3845..4ce1c98 100644 --- a/config/aurora/modules/VFlyoutRight.qml +++ b/config/aurora/modules/VFlyoutRight.qml @@ -17,7 +17,7 @@ MouseArea { Component.onCompleted: { - item.y = pad + item.x = pad } width: shape.width @@ -34,29 +34,17 @@ MouseArea { strokeColor: root.color fillColor: root.color - startX: -root.radius - pad; startY: 0 + startX: 0; startY: pad PathArc { radiusX: root.radius radiusY: root.radius relativeX: root.radius - relativeY: root.radius + relativeY: -root.radius } - - PathLine { relativeX: 0; relativeY: 2 * pad + item.height - 2 * root.radius } - - PathArc { - radiusX: root.radius - radiusY: root.radius - - direction: PathArc.Counterclockwise - - relativeX: root.radius - relativeY: root.radius - } - - PathLine { x: item.width + pad - root.radius; relativeY: 0 } + + PathLine { x: item.width + 2 * pad - root.radius; relativeY: 0 } PathArc { radiusX: root.radius @@ -68,17 +56,31 @@ MouseArea { relativeY: -root.radius } - PathLine { relativeX: 0; relativeY: -item.height + 2 * root.radius - 2 * pad } + PathLine { relativeX: 0; relativeY: 2 * pad + item.height + 2 * root.radius } PathArc { radiusX: root.radius radiusY: root.radius - relativeX: root.radius + direction: PathArc.Counterclockwise + + relativeX: -root.radius relativeY: -root.radius } - PathLine { x: -root.radius - pad; y: 0 } + PathLine { relativeX: -item.width - 2 * pad + 2 * root.radius; relativeY: 0 } + + + PathArc { + radiusX: root.radius + radiusY: root.radius + + relativeX: -root.radius + relativeY: -root.radius + } + + PathLine { x: 0; y: pad } + } } } diff --git a/config/aurora/modules/VFlyoutUp.qml b/config/aurora/modules/VFlyoutUp.qml index a4a3845..7e955ea 100644 --- a/config/aurora/modules/VFlyoutUp.qml +++ b/config/aurora/modules/VFlyoutUp.qml @@ -17,65 +17,71 @@ MouseArea { Component.onCompleted: { - item.y = pad + item.y = root.y - pad + + //console.log(height) } width: shape.width - height: shape.height + height: item.height + 2 * pad Shape { id: shape + y: root.y + root.item.height + //anchors.centerIn: parent ShapePath { id: path - strokeWidth: 4 - strokeColor: root.color + strokeWidth: 1 + strokeColor: "transparent" fillColor: root.color startX: -root.radius - pad; startY: 0 PathArc { radiusX: root.radius - radiusY: root.radius + radiusY: -root.radius relativeX: root.radius - relativeY: root.radius + relativeY: -root.radius + direction: PathArc.Counterclockwise } - PathLine { relativeX: 0; relativeY: 2 * pad + item.height - 2 * root.radius } + PathLine { relativeX: 0; relativeY: -(2 * pad + item.height - 2 * root.radius) } PathArc { radiusX: root.radius - radiusY: root.radius + radiusY: -root.radius - direction: PathArc.Counterclockwise + //direction: PathArc.Counterclockwise relativeX: root.radius - relativeY: root.radius + relativeY: -root.radius } PathLine { x: item.width + pad - root.radius; relativeY: 0 } PathArc { radiusX: root.radius - radiusY: root.radius + radiusY: -root.radius - direction: PathArc.Counterclockwise + //direction: PathArc.Counterclockwise relativeX: root.radius - relativeY: -root.radius + relativeY: root.radius } - PathLine { relativeX: 0; relativeY: -item.height + 2 * root.radius - 2 * pad } + PathLine { relativeX: 0; relativeY: -(-item.height + 2 * root.radius - 2 * pad) } PathArc { radiusX: root.radius - radiusY: root.radius + radiusY: -root.radius relativeX: root.radius - relativeY: -root.radius + relativeY: root.radius + direction: PathArc.Counterclockwise } PathLine { x: -root.radius - pad; y: 0 } diff --git a/config/aurora/modules/Wallpaper.qml b/config/aurora/modules/Wallpaper.qml index e69de29..fd15e36 100644 --- a/config/aurora/modules/Wallpaper.qml +++ b/config/aurora/modules/Wallpaper.qml @@ -0,0 +1,69 @@ +import Quickshell // for PanelWindow +import QtQuick // for Text +import QtQuick.Controls +import QtQuick.Layouts +import Quickshell.Io +import Quickshell.Widgets +import Quickshell.Hyprland +import Quickshell.Services.Pipewire + + + +ScrollView { + //anchors.fill: parent + + required property list hyprcmds + + id: root + + property string dir: "/home/nathan/Pictures/Wallpaper/" + + ScrollBar.horizontal.policy: ScrollBar.AlwaysOn + + Process { + id: ls + //command: ["find", root.dir + "*"] + command: ["ls", dir] + running: true + stdout: StdioCollector { + onStreamFinished: { + rep.model = text.split("\n").filter((s) => { return s != ""; }) + } + } + } + + RowLayout { + + Repeater { + id: rep + model: 0 + + WrapperMouseArea { + ClippingWrapperRectangle { + radius: 10 + implicitWidth: 192 * 2; implicitHeight: 108 * 2 + Image { + width: 192 * 2; height: 108 * 2 + source: Qt.resolvedUrl(root.dir + rep.model[index]) + fillMode: Image.PreserveAspectCrop + sourceSize.width: 192 * 2 + sourceSize.height: 108 * 2 + } + } + + property Process sw: Process { + command: ["setWallpaper", root.dir + rep.model[index]] + running: false + onRunningChanged: { + root.hyprcmds.forEach((c) => Hyprland.dispatch(c)) + } + } + + onClicked: { + sw.running = true + } + } + } + } +} + diff --git a/config/aurora/modules/Workspaces.qml b/config/aurora/modules/Workspaces.qml index d3da5e4..0d4b299 100644 --- a/config/aurora/modules/Workspaces.qml +++ b/config/aurora/modules/Workspaces.qml @@ -19,13 +19,15 @@ Item { Repeater { id: rep - property var ws: { - let arr = []; - Hyprland.workspaces.values.forEach((w) => { if(w.id > 0) arr.push(w) }) - return arr; - } + model: Hyprland.workspaces.values.filter((w) => { + if(w != null) { + if(w.id > 0) { + return true + } + } + return false + }) - model: ws WrapperMouseArea { Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter ClippingWrapperRectangle { @@ -34,7 +36,7 @@ Item { implicitWidth: 24 implicitHeight: 24 color: { - Hyprland.focusedWorkspace.id == rep.model[index].id + Hyprland?.focusedWorkspace?.id == rep.model[index].id ? Pywal.colors.color13 : containsMouse ? Pywal.colors.color12 @@ -48,7 +50,7 @@ Item { text: rep.model[index].id color: { - Hyprland.focusedWorkspace.id == rep.model[index].id + Hyprland?.focusedWorkspace?.id == rep.model[index].id ? Pywal.colors.color1 : Pywal.special.foreground } @@ -56,7 +58,9 @@ Item { } hoverEnabled: true onClicked: { - rep.model[index].activate() + if(Hyprland?.focusedWorkspace?.id != rep.model[index].id) { + rep.model[index].activate() + } } } } diff --git a/nix/homeManagerModule.nix b/nix/homeManagerModule.nix deleted file mode 100644 index 3846a58..0000000 --- a/nix/homeManagerModule.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ self, inputs, ... }: { - - imports = [ - inputs.home-manager.flakeModules.home-manager - ]; - - flake.homeModules.default = { config, lib, pkgs, ... }: { - - options.programs.aurora = with lib; { - enable = mkEnableOption "aurora"; - - package = mkPackageOption self.packages.${pkgs.stdenv.hostPlatform.system} "aurora" { - default = [ "aurora" ]; - - example = "aurora.packages.hybar"; - }; - - systemd = { - enable = mkEnableOption "aurora systemd unit"; - - target = mkOption { - type = types.str; - default = "hyprland-session.target"; - }; - }; - }; - - config = let - cfg = config.programs.aurora; - - 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; - - package = cfg.package; - - activeConfig = "aurora"; - - configs = { - default = "${self.packages.${system}.aurora-dots}/share"; - aurora = "${self.packages.${system}.aurora-dots}/share"; - hybar = "${self.packages.${system}.hybar-dots}/share"; - }; - - systemd = { - enable = cfg.systemd.enable; - target = cfg.systemd.target; - }; - }; - }; - }; -} diff --git a/nix/nixosModule.nix b/nix/nixosModule.nix deleted file mode 100644 index 2a96501..0000000 --- a/nix/nixosModule.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ 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}/bin/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 = 5; - - default_session = { - command = "Hyprland -c ${greeter-conf}/greeter.conf"; - #user = "greeter"; - }; - }; - }; - }; - }; -}