From 56dc79816b69ac0fb91ee4e92197ec9d0bfda6b3 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Fri, 8 Mar 2024 03:42:49 -0800 Subject: [PATCH] lockscreen: add example --- lockscreen/AuthContext.qml | 43 +++++++++++++++++++++++++++++++ lockscreen/Lockscreen.qml | 51 +++++++++++++++++++++++++++++++++++++ lockscreen/README.md | 10 ++++++++ lockscreen/image.png | Bin 0 -> 22081 bytes lockscreen/shell.qml | 38 +++++++++++++++++++++++++++ lockscreen/test.qml | 18 +++++++++++++ 6 files changed, 160 insertions(+) create mode 100644 lockscreen/AuthContext.qml create mode 100644 lockscreen/Lockscreen.qml create mode 100644 lockscreen/README.md create mode 100644 lockscreen/image.png create mode 100644 lockscreen/shell.qml create mode 100644 lockscreen/test.qml diff --git a/lockscreen/AuthContext.qml b/lockscreen/AuthContext.qml new file mode 100644 index 0000000..f5c5745 --- /dev/null +++ b/lockscreen/AuthContext.qml @@ -0,0 +1,43 @@ +import QtQuick +import Quickshell +import Quickshell.Io + +QtObject { + property int status: AuthContext.Status.FirstLogin + signal unlocked(); + + enum Status { + FirstLogin, + Authenticating, + LoginFailed + } + + property string password + + property var pamtester: Process { + property bool failed: true + + command: ["pamtester", "login", Quickshell.env("USER"), "authenticate"] + + onStarted: this.write(`${password}\n`) + + stdout: SplitParser { + // fails go to stderr + onRead: pamtester.failed = false + } + + onExited: { + if (failed) { + status = AuthContext.Status.LoginFailed; + } else { + unlocked(); + } + } + } + + function tryLogin(password: string) { + this.password = password + status = AuthContext.Status.Authenticating; + pamtester.running = true; + } +} diff --git a/lockscreen/Lockscreen.qml b/lockscreen/Lockscreen.qml new file mode 100644 index 0000000..83693f1 --- /dev/null +++ b/lockscreen/Lockscreen.qml @@ -0,0 +1,51 @@ +import QtQuick +import QtQuick.Controls.Basic + +Item { + required property AuthContext context + + Item { + anchors.centerIn: parent + scale: 2 + + TextField { + id: entryBox + anchors.centerIn: parent + width: 300 + + enabled: context.status != AuthContext.Status.Authenticating + focus: true + horizontalAlignment: TextInput.AlignHCenter + echoMode: TextInput.Password + inputMethodHints: Qt.ImhSensitiveData + placeholderText: "Enter password" + + onAccepted: { + if (text != "") context.tryLogin(text) + } + + onEnabledChanged: { + if (enabled) text = "" + } + } + + Text { + id: status + color: "white" + + anchors { + horizontalCenter: entryBox.horizontalCenter + top: entryBox.bottom + topMargin: 20 + } + + text: { + switch (context.status) { + case AuthContext.Status.FirstLogin: return "" + case AuthContext.Status.Authenticating: return "Authenticating" + case AuthContext.Status.LoginFailed: return "Login Failed" + } + } + } + } +} diff --git a/lockscreen/README.md b/lockscreen/README.md new file mode 100644 index 0000000..dfed773 --- /dev/null +++ b/lockscreen/README.md @@ -0,0 +1,10 @@ +# Lockscreen + +This is a barebones lockscreen with a password input box. +Note that you MUST have `pamtester` installed or you won't be able to log in. + +You can run the lockscreen with `quickshell -c shell.qml`. + +You can run the lockscreen in test mode (as a window) with `quickshell -c test.qml`. + +![](./image.png) diff --git a/lockscreen/image.png b/lockscreen/image.png new file mode 100644 index 0000000000000000000000000000000000000000..956c8aac5bc2bfd1af34a1fc74d45ea3dd008fc2 GIT binary patch literal 22081 zcmeIaX;f3$)-Ftyrv#-0s%)@8h|@k4o~vd zreSZ~eG5O$LF;{MbJvO?QEF|RIENQIZ+~@O{GJqY@BN>D+7?&-fyO|d5eRDp+8%<+QL^r1qa&q6 zNAp7QMktnooTF1>KwDZr*O3RK8}eh)jkcq8`xNZK0^GT=FwBZcOhh2kIC*DgKPbiKG3+W})=2 zB^p^L=f9L%A1-L-vMC77;mfbaJ(|6l_|)Aa$t+I!ebK7zGc(-zDvpbnDPu}ar(8p` zk61O`%CG%pfHH}Rv>qn*A$j*BGLIaC0w>wcKBGDF>!`lRB5qoj52}&IUiMqxt&rYR z6)9A~%b_SKRMJl7vUq!Fxu^&fqt3wkZsldrrgd?P9qIHq1@l|=CwLuO&tC?hdVkyd zk<_o;OW%hDka+UlNjX<=kKve``TGl^-AkfWN#U@{>6VGI-p(P468{@hN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PSf6StDnHi{b-%2>5@t_%U_frgF13u`(sitj;mC@|n`nu) zaw@pUi01ex6zcx{bIxh0mPJf!6`{P@ z_IRh8Yi;7bd_-SKB zGdNIa|7vCXQo(SR~}Yog9H8AXL=E|l+_PWU=90uL7$`F>j4nd%>H$}=M2qqayVCn*#Y_Y4ng=$aZq3QKh`o4au1hCtTGzlbUJQCS!0pWMTkj`ux4CF8WBh1Qul_2~0k5 zi0!e`*JOZV?hu1>UFvuEZ<5GXisP)AJ_xFz44REmoQ%`UOZm^bnj0jw2@L1*BJWcW zT0NJa=3?x}qmP{avwxocez&>4~c)k%WS|F*W_Xr0Tb9 zs4Ai1TBMOba^juq9VIBs0JOn*D5>rw*hsd#Szua_Jq$T2ERfJ?1r~Gi^8Y&(%l}IR zmKqNHd#O(i!JD(~eA6E!BG}#U^gktV<9{vmo?rx0F5m4@m;Xy^oc|4F)Nil&Z>v~; z6ZJPyOB}|3kOT2eqrPd>H;wwQU>AL}tZ$a}&9c5()?T_*^7()A7e9#udy@BJ1F8L7 zx0DB7-v5x&{>Q%?%Kkej_+B%LYwe0%(Ntn^JR-_&8x9R7b~B{D!GkLDB? TnuOgfC3X9T&2_Z-Z-4v`CCu=w literal 0 HcmV?d00001 diff --git a/lockscreen/shell.qml b/lockscreen/shell.qml new file mode 100644 index 0000000..2a36ac8 --- /dev/null +++ b/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/lockscreen/test.qml b/lockscreen/test.qml new file mode 100644 index 0000000..2917665 --- /dev/null +++ b/lockscreen/test.qml @@ -0,0 +1,18 @@ +import QtQuick +import Quickshell + +ShellRoot { + AuthContext { + id: authContext + onUnlocked: Qt.quit() + } + + FloatingWindow { + color: "#303030" + + Lockscreen { + anchors.fill: parent + context: authContext + } + } +}