diff --git a/flake.lock b/flake.lock index 2f733a2..0d2edea 100644 --- a/flake.lock +++ b/flake.lock @@ -443,12 +443,13 @@ ] }, "locked": { - "dirtyRev": "f32b4175fbc25bf9cf022c8edffe74696ecb5abb-dirty", - "dirtyShortRev": "f32b417-dirty", - "lastModified": 1709821149, - "narHash": "sha256-ZBKOlWd8sBG3bArCVM6squuJkVblGn3p0gy176KRoxg=", + "lastModified": 1709945683, + "narHash": "sha256-4mU58/em5UccBXrCBNds7heuoL5TTE4DTFQFsQDcCmY=", + "ref": "refs/heads/master", + "rev": "46d15228a690cd0a515f2baf4d94c6875a83686e", + "revCount": 95, "type": "git", - "url": "file:///home/admin/programming/outfoxxed/qtshell" + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" }, "original": { "type": "git", diff --git a/modules/hyprland/default.nix b/modules/hyprland/default.nix index cb87464..ab64692 100644 --- a/modules/hyprland/default.nix +++ b/modules/hyprland/default.nix @@ -52,10 +52,6 @@ in { wrapper hyprpaper - pamtester # quickshell lockscreen - quickshell.packages.${system}.default - (writeShellScriptBin "quickshell-lock" "quickshell -c ${impurity.link ./lockscreen/shell.qml}") - # environment programs wl-clipboard grim diff --git a/modules/hyprland/hyprland.conf b/modules/hyprland/hyprland.conf index 4edfe64..68fc4fd 100644 --- a/modules/hyprland/hyprland.conf +++ b/modules/hyprland/hyprland.conf @@ -146,7 +146,7 @@ bind = ,XF86AudioPrev, exec, playerctl previous bind = $mod+SHIFT, s, exec, grim -g "$(slurp)" - | wl-copy -bind = $mod, PERIOD, exec, quickshell-lock +bind = $mod, PERIOD, exec, quickshell -c lockscreen bind = $mod, h, hy3:movefocus, l bind = $mod, j, hy3:movefocus, d diff --git a/modules/hyprland/lockscreen/shell.qml b/modules/hyprland/lockscreen/shell.qml deleted file mode 100644 index b9abc68..0000000 --- a/modules/hyprland/lockscreen/shell.qml +++ /dev/null @@ -1,33 +0,0 @@ -import QtQuick -import QtQuick.Controls -import Quickshell -import Quickshell.Wayland - -ShellRoot { - AuthContext { - id: authContext - onSuccess: { - lock.locked = false; - Qt.quit() - } - } - - SessionLock { - id: lock - locked: true - - SessionLockSurface { - id: surface - Image { - anchors.fill: parent - source: screen.name == "DP-1" ? "../5120x1440.png" : "../1920x1080.png" - } - - Lockscreen { - anchors.fill: parent - context: authContext - } - } - } - -} diff --git a/modules/user/modules/quickshell/default.nix b/modules/user/modules/quickshell/default.nix new file mode 100644 index 0000000..e77107a --- /dev/null +++ b/modules/user/modules/quickshell/default.nix @@ -0,0 +1,9 @@ +{ inputs, pkgs, lib, system, impurity, ... }: let + inherit (inputs) quickshell; +in { + home.packages = [ quickshell.packages.${system}.default ]; + + xdg.configFile."quickshell/manifest.conf".text = lib.generators.toKeyValue {} { + lockscreen = impurity.link ./lockscreen; + }; +} diff --git a/modules/hyprland/lockscreen/AuthContext.qml b/modules/user/modules/quickshell/lockscreen/AuthContext.qml similarity index 80% rename from modules/hyprland/lockscreen/AuthContext.qml rename to modules/user/modules/quickshell/lockscreen/AuthContext.qml index 53ba63d..f5c5745 100644 --- a/modules/hyprland/lockscreen/AuthContext.qml +++ b/modules/user/modules/quickshell/lockscreen/AuthContext.qml @@ -3,11 +3,11 @@ import Quickshell import Quickshell.Io QtObject { - property int status: AuthContext.Status.FirstEntry - signal success(); + property int status: AuthContext.Status.FirstLogin + signal unlocked(); enum Status { - FirstEntry, + FirstLogin, Authenticating, LoginFailed } @@ -28,9 +28,9 @@ QtObject { onExited: { if (failed) { - status = AuthContext.Status.LoginFailed + status = AuthContext.Status.LoginFailed; } else { - success(); + unlocked(); } } } diff --git a/modules/hyprland/lockscreen/Lockscreen.qml b/modules/user/modules/quickshell/lockscreen/Lockscreen.qml similarity index 87% rename from modules/hyprland/lockscreen/Lockscreen.qml rename to modules/user/modules/quickshell/lockscreen/Lockscreen.qml index 28f424d..83693f1 100644 --- a/modules/hyprland/lockscreen/Lockscreen.qml +++ b/modules/user/modules/quickshell/lockscreen/Lockscreen.qml @@ -1,7 +1,5 @@ import QtQuick -import QtQuick.Controls.Universal -import QtQuick.Layouts -import Quickshell +import QtQuick.Controls.Basic Item { required property AuthContext context @@ -43,7 +41,7 @@ Item { text: { switch (context.status) { - case AuthContext.Status.FirstEntry: return "" + case AuthContext.Status.FirstLogin: return "" case AuthContext.Status.Authenticating: return "Authenticating" case AuthContext.Status.LoginFailed: return "Login Failed" } diff --git a/modules/user/modules/quickshell/lockscreen/shell.qml b/modules/user/modules/quickshell/lockscreen/shell.qml new file mode 100644 index 0000000..2a36ac8 --- /dev/null +++ b/modules/user/modules/quickshell/lockscreen/shell.qml @@ -0,0 +1,38 @@ +import QtQuick +import QtQuick.Controls.Basic +import Quickshell +import Quickshell.Wayland + +ShellRoot { + AuthContext { + id: authContext + onUnlocked: lock.locked = false + } + + SessionLock { + id: lock + locked: true + + onLockedChanged: { + if (!locked) Qt.quit(); + } + + SessionLockSurface { + // You probably want to replace this with an image. + color: "#303030" + + // For your own sanity you should probably keep this + // while working on the lockscreen. + Button { + text: "Help! I misconfigured my lockscreen!" + onClicked: lock.locked = false + } + + Lockscreen { + anchors.fill: parent + context: authContext + } + } + } + +} diff --git a/modules/hyprland/lockscreen/test.qml b/modules/user/modules/quickshell/lockscreen/test.qml similarity index 65% rename from modules/hyprland/lockscreen/test.qml rename to modules/user/modules/quickshell/lockscreen/test.qml index 4710ae3..2917665 100644 --- a/modules/hyprland/lockscreen/test.qml +++ b/modules/user/modules/quickshell/lockscreen/test.qml @@ -4,14 +4,11 @@ import Quickshell ShellRoot { AuthContext { id: authContext - onSuccess: Qt.quit() + onUnlocked: Qt.quit() } FloatingWindow { - Image { - anchors.fill: parent - source: "../1920x1080.png" - } + color: "#303030" Lockscreen { anchors.fill: parent