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": {
"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",

View file

@ -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

View file

@ -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

View file

@ -69,6 +69,7 @@
homeConfig = homeInputs.config;
in {
imports = [
./modules/quickshell
./modules/fcitx5
./modules/wofi
./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
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();
}
}
}

View file

@ -1,7 +1,5 @@
import QtQuick
import QtQuick.Controls.Universal
import QtQuick.Layouts
import Quickshell
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"
}

View file

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

View file

@ -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