Move quickshell to its own module
This commit is contained in:
parent
1dd031aa6b
commit
b6bff47ed1
9 changed files with 34 additions and 30 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
homeConfig = homeInputs.config;
|
||||
in {
|
||||
imports = [
|
||||
./modules/quickshell
|
||||
./modules/fcitx5
|
||||
./modules/wofi
|
||||
./modules/dolphin
|
||||
|
|
12
modules/user/modules/quickshell/default.nix
Normal file
12
modules/user/modules/quickshell/default.nix
Normal 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;
|
||||
};
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -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 {
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue