Move quickshell to its own module

This commit is contained in:
outfoxxed 2024-03-08 17:24:47 -08:00
parent 1dd031aa6b
commit b6bff47ed1
Signed by: outfoxxed
GPG Key ID: 4C88A185FB89301E
9 changed files with 34 additions and 30 deletions

View File

@ -443,12 +443,13 @@
] ]
}, },
"locked": { "locked": {
"dirtyRev": "f32b4175fbc25bf9cf022c8edffe74696ecb5abb-dirty", "lastModified": 1709945683,
"dirtyShortRev": "f32b417-dirty", "narHash": "sha256-4mU58/em5UccBXrCBNds7heuoL5TTE4DTFQFsQDcCmY=",
"lastModified": 1709821149, "ref": "refs/heads/master",
"narHash": "sha256-ZBKOlWd8sBG3bArCVM6squuJkVblGn3p0gy176KRoxg=", "rev": "46d15228a690cd0a515f2baf4d94c6875a83686e",
"revCount": 95,
"type": "git", "type": "git",
"url": "file:///home/admin/programming/outfoxxed/qtshell" "url": "https://git.outfoxxed.me/outfoxxed/quickshell"
}, },
"original": { "original": {
"type": "git", "type": "git",

View File

@ -52,10 +52,6 @@ in {
wrapper wrapper
hyprpaper hyprpaper
pamtester # quickshell lockscreen
quickshell.packages.${system}.default
(writeShellScriptBin "quickshell-lock" "quickshell -c ${impurity.link ./lockscreen/shell.qml}")
# environment programs # environment programs
wl-clipboard wl-clipboard
grim grim

View File

@ -146,7 +146,7 @@ bind = ,XF86AudioPrev, exec, playerctl previous
bind = $mod+SHIFT, s, exec, grim -g "$(slurp)" - | wl-copy 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, h, hy3:movefocus, l
bind = $mod, j, hy3:movefocus, d bind = $mod, j, hy3:movefocus, d

View File

@ -69,6 +69,7 @@
homeConfig = homeInputs.config; homeConfig = homeInputs.config;
in { in {
imports = [ imports = [
./modules/quickshell
./modules/fcitx5 ./modules/fcitx5
./modules/wofi ./modules/wofi
./modules/dolphin ./modules/dolphin

View File

@ -0,0 +1,12 @@
{ inputs, pkgs, lib, system, impurity, ... }: let
inherit (inputs) quickshell;
in {
home.packages = [
quickshell.packages.${system}.default
pamtester # lockscreen
];
xdg.configFile."quickshell/manifest.conf".text = lib.generators.toKeyValue {} {
lockscreen = impurity.link ./lockscreen;
};
}

View File

@ -3,11 +3,11 @@ import Quickshell
import Quickshell.Io import Quickshell.Io
QtObject { QtObject {
property int status: AuthContext.Status.FirstEntry property int status: AuthContext.Status.FirstLogin
signal success(); signal unlocked();
enum Status { enum Status {
FirstEntry, FirstLogin,
Authenticating, Authenticating,
LoginFailed LoginFailed
} }
@ -28,9 +28,9 @@ QtObject {
onExited: { onExited: {
if (failed) { if (failed) {
status = AuthContext.Status.LoginFailed status = AuthContext.Status.LoginFailed;
} else { } else {
success(); unlocked();
} }
} }
} }

View File

@ -1,7 +1,5 @@
import QtQuick import QtQuick
import QtQuick.Controls.Universal import QtQuick.Controls.Universal
import QtQuick.Layouts
import Quickshell
Item { Item {
required property AuthContext context required property AuthContext context
@ -43,7 +41,7 @@ Item {
text: { text: {
switch (context.status) { switch (context.status) {
case AuthContext.Status.FirstEntry: return "" case AuthContext.Status.FirstLogin: return ""
case AuthContext.Status.Authenticating: return "Authenticating" case AuthContext.Status.Authenticating: return "Authenticating"
case AuthContext.Status.LoginFailed: return "Login Failed" case AuthContext.Status.LoginFailed: return "Login Failed"
} }

View File

@ -1,26 +1,25 @@
import QtQuick import QtQuick
import QtQuick.Controls
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
ShellRoot { ShellRoot {
AuthContext { AuthContext {
id: authContext id: authContext
onSuccess: { onUnlocked: lock.locked = false
lock.locked = false;
Qt.quit()
}
} }
SessionLock { SessionLock {
id: lock id: lock
locked: true locked: true
onLockedChanged: {
if (!locked) Qt.quit();
}
SessionLockSurface { SessionLockSurface {
id: surface
Image { Image {
anchors.fill: parent anchors.fill: parent
source: screen.name == "DP-1" ? "../5120x1440.png" : "../1920x1080.png" source: `../../../../hyprland/${screen.name == "DP-1" ? "5120x1440" : "1920x1080"}.png`
} }
Lockscreen { Lockscreen {

View File

@ -4,14 +4,11 @@ import Quickshell
ShellRoot { ShellRoot {
AuthContext { AuthContext {
id: authContext id: authContext
onSuccess: Qt.quit() onUnlocked: Qt.quit()
} }
FloatingWindow { FloatingWindow {
Image { color: "#303030"
anchors.fill: parent
source: "../1920x1080.png"
}
Lockscreen { Lockscreen {
anchors.fill: parent anchors.fill: parent