feat(terra): Quickshell lock screen, Star Citizen, NexusMods, TeamSpeak

Also jellyfin-mpv-shim, mangohud logging, portal-backed xdg-open,
systemd-resolved with fallback DNS, and keyring under the user manager.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 00:37:40 +01:00
co-authored by Claude Opus 5.5
parent 7a68716c1c
commit b02d698c1a
22 changed files with 866 additions and 170 deletions
+2
View File
@@ -105,6 +105,8 @@ on it, hence the index loops in `HyprChromeShell`.
rail's monitor (`NotificationCard` is the headless-renderable card);
`Widgets/Greeter/` is the greetd login screen, run standalone via `greeter.qml`
(see `services/desktop/quickshell-greeter.nix`), NOT part of `shell.qml`;
`Widgets/Lock/` is the session lock, which reuses the greeter's
`LoginContent` over PAM and runs as its own instance via `lock.qml`;
`Theme/Theme.qml` is this tree's palette singleton. `DebugWindow.qml` stages a
single widget on the secondary monitor for eyeballing it in isolation.
@@ -10,6 +10,13 @@ Item {
property string hostName: ""
property string sessionName: ""
property string title: "SESSION // " + root.hostName.toUpperCase()
property string panelId: "LGN"
property string meta: "GREETD"
property string submitLabel: "LOG IN"
// Off for the lock screen: the session's user is the only one who unlocks.
property bool userEditable: true
property bool showPower: true
property date now: new Date()
// Label over the secret field. Empty means the plain password step; set
@@ -139,9 +146,9 @@ Item {
id: panel
width: root.width
panelId: "LGN"
title: "SESSION // " + root.hostName.toUpperCase()
meta: "GREETD"
panelId: root.panelId
title: root.title
meta: root.meta
busy: root.busy
ColumnLayout {
@@ -220,7 +227,7 @@ Item {
anchors.fill: parent
verticalAlignment: TextInput.AlignVCenter
enabled: !root.busy && root.inputPrompt === ""
enabled: root.userEditable && !root.busy && root.inputPrompt === ""
color: Theme.text
selectionColor: Theme.accent
selectedTextColor: Theme.surface
@@ -292,12 +299,12 @@ Item {
Layout.fillWidth: true
spacing: 14
MicroText { text: "ENTER LOG IN" }
MicroText { text: "TAB SWITCH FIELD" }
MicroText { text: "ENTER " + root.submitLabel }
MicroText { text: "TAB SWITCH FIELD"; visible: root.userEditable }
Item { Layout.fillWidth: true }
PowerChip { label: "REBOOT"; action: "reboot" }
PowerChip { label: "POWER OFF"; action: "poweroff" }
PowerChip { label: "REBOOT"; action: "reboot"; visible: root.showPower }
PowerChip { label: "POWER OFF"; action: "poweroff"; visible: root.showPower }
}
}
}
@@ -0,0 +1,208 @@
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import Quickshell.Services.Pam
import qs.HyprChrome.Widgets.Greeter
// ext-session-lock screen: the greeter's panel on every output, so whichever
// one Hyprland gives the keyboard has a field. Runs as its own instance
// (lock.qml) so a reload of the main shell cannot drop the lock; exits once
// unlocked.
Scope {
id: root
readonly property string userName: Quickshell.env("USER") ?? ""
readonly property string hostName: hostFile.text().trim() || "localhost"
// Typed password, held until PAM's first secret prompt arrives.
property string pendingSecret: ""
// PAM asked a follow-up (OTP etc.) that the user must answer directly.
property bool awaitingResponse: false
property bool busy: false
property bool unlocking: false
property string message: ""
property bool messageIsError: false
property bool failed: false
property string inputPrompt: ""
property bool responseVisible: false
property date now: new Date()
// Each surface keeps its own field; this resets all of them.
signal resetSecret
function setMessage(text, isError) {
root.message = text;
root.messageIsError = isError;
}
function resetToPassword() {
root.pendingSecret = "";
root.awaitingResponse = false;
root.busy = false;
root.inputPrompt = "";
root.responseVisible = false;
root.resetSecret();
}
function submit(secret) {
root.failed = false;
if (root.awaitingResponse) {
root.awaitingResponse = false;
root.busy = true;
root.resetSecret();
pam.respond(secret);
return;
}
if (pam.active)
return;
root.setMessage("", false);
root.pendingSecret = secret;
root.busy = true;
if (!pam.start()) {
root.resetToPassword();
root.setMessage("pam failed to start", true);
}
}
FileView {
id: hostFile
path: "/etc/hostname"
blockLoading: true
}
PamContext {
id: pam
// security.pam.services.hyprchrome-lock (services/desktop/desktop-hyprland.nix).
config: "hyprchrome-lock"
user: root.userName
onPamMessage: {
if (!pam.responseRequired) {
root.setMessage(pam.message, pam.messageIsError);
return;
}
// First hidden prompt is the password already typed.
if (root.pendingSecret !== "" && !pam.responseVisible) {
const secret = root.pendingSecret;
root.pendingSecret = "";
pam.respond(secret);
return;
}
root.busy = false;
root.awaitingResponse = true;
root.inputPrompt = pam.message.replace(/:\s*$/, "");
root.responseVisible = pam.responseVisible;
root.resetSecret();
}
onCompleted: result => {
if (result === PamResult.Success) {
root.setMessage("unlocked", false);
root.unlocking = true;
return;
}
root.resetToPassword();
root.failed = true;
root.setMessage(result === PamResult.MaxTries ? "too many attempts" : "authentication failed", true);
}
onError: error => {
root.resetToPassword();
root.setMessage(PamError.toString(error), true);
}
}
// Fade out, then release the outputs. The quit is deferred so the unlock
// request is flushed before the connection closes; exiting while still
// locked would leave Hyprland's "lock app died" screen up.
Timer {
running: root.unlocking
interval: 220
onTriggered: {
lock.locked = false;
quitTimer.start();
}
}
Timer {
id: quitTimer
interval: 100
onTriggered: Qt.quit()
}
Timer {
running: true
repeat: true
interval: 1000
triggeredOnStart: true
onTriggered: root.now = new Date()
}
WlSessionLock {
id: lock
locked: true
WlSessionLockSurface {
color: "transparent"
LockBackdrop {
anchors.fill: parent
}
LoginContent {
id: content
width: 640
anchors.horizontalCenter: parent.horizontalCenter
y: Math.max(32, Math.round(parent.height * 0.42 - height / 2)) + (1 - opacity) * 12
opacity: root.unlocking ? 0 : 1
Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutCubic } }
title: "LOCKED // " + root.hostName.toUpperCase()
panelId: "LCK"
meta: "PAM"
submitLabel: "UNLOCK"
userEditable: false
showPower: false
hostName: root.hostName
sessionName: "hyprland"
user: root.userName
now: root.now
busy: root.busy || root.unlocking
message: root.message
messageIsError: root.messageIsError
failed: root.failed
inputPrompt: root.inputPrompt
responseVisible: root.responseVisible
onSubmitted: (user, secret) => root.submit(secret)
Component.onCompleted: content.focusSecret()
Connections {
target: root
function onResetSecret() {
content.clearSecret();
content.focusSecret();
}
}
}
}
}
}
@@ -0,0 +1,86 @@
pragma ComponentBehavior: Bound
import QtQuick
import qs.HyprChrome.Theme
// ChromeBackdrop's drafting grid at full dim, as a plain Item: a lock surface
// cannot host a PanelWindow, and nothing behind it is shown anyway.
Item {
id: root
property int gridSpacing: 60
property real gridOpacity: 0.10
property real crossOpacity: 0.15
property int crossSize: 20
property int crossWeight: 3
readonly property color gridColor: Qt.hsla(Theme.accent.hslHue,
Theme.accent.hslSaturation * 0.45,
Theme.accent.hslLightness,
1)
Rectangle {
anchors.fill: parent
color: Theme.surface
}
Repeater {
model: Math.ceil(root.width / root.gridSpacing)
Rectangle {
required property int index
x: index * root.gridSpacing
width: 1
height: root.height
color: root.gridColor
opacity: root.gridOpacity
}
}
Repeater {
model: Math.ceil(root.height / root.gridSpacing)
Rectangle {
required property int index
y: index * root.gridSpacing
width: root.width
height: 1
color: root.gridColor
opacity: root.gridOpacity
}
}
Repeater {
id: crosses
readonly property int columns: Math.ceil(root.width / (root.gridSpacing * 2)) + 1
readonly property int rows: Math.ceil(root.height / (root.gridSpacing * 2)) + 1
model: columns * rows
Item {
required property int index
x: (index % crosses.columns) * root.gridSpacing * 2 - Math.floor(root.crossSize / 2)
y: Math.floor(index / crosses.columns) * root.gridSpacing * 2 - Math.floor(root.crossSize / 2)
width: root.crossSize
height: root.crossSize
opacity: root.crossOpacity
Rectangle {
y: Math.floor(root.crossSize / 2) - Math.floor(root.crossWeight / 2)
width: parent.width
height: root.crossWeight
color: Theme.muted
}
Rectangle {
x: Math.floor(root.crossSize / 2) - Math.floor(root.crossWeight / 2)
width: root.crossWeight
height: parent.height
color: Theme.muted
}
}
}
}
+9
View File
@@ -0,0 +1,9 @@
import Quickshell
import qs.HyprChrome.Widgets.Lock
// Session lock entry point: `qs -n -p lock.qml`, from the SUPER+L bind and
// hypridle (home/desktop/hyprland.nix). Separate from shell.qml so a shell
// reload or crash cannot take the lock down with it.
Scope {
Lock {}
}
@@ -0,0 +1,27 @@
import QtQuick
import qs.HyprChrome.Widgets.Greeter
// Offscreen render of the lock panel (Lock.qml) after a rejected password.
//
// ./tools/quickshell-preview/render.sh \
// tests/LockPanelHeadless.qml \
// .artifacts/quickshell-preview/lock-panel.png 700 340
LoginContent {
width: 640
title: "LOCKED // TERRA"
panelId: "LCK"
meta: "PAM"
submitLabel: "UNLOCK"
userEditable: false
showPower: false
sessionName: "hyprland"
now: new Date(2026, 8, 18, 21, 47, 38)
user: "darman"
response: "hunter2"
message: "authentication failed"
messageIsError: true
failed: true
}
+3 -1
View File
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
# Start both comms apps; Hyprland window rules move them to special:communications.
# Start the comms apps; Hyprland window rules move them to special:communications.
flatpak run org.telegram.desktop &
flatpak run com.discordapp.Discord &
# terra only (hosts/terra/configuration.nix).
command -v TeamSpeak >/dev/null && TeamSpeak &