Huge quickshell progress dump
Was requested
This commit is contained in:
parent
57d9f9a72e
commit
945793973e
42 changed files with 2140 additions and 142 deletions
57
modules/user/modules/quickshell/shell/lock/LockContext.qml
Normal file
57
modules/user/modules/quickshell/shell/lock/LockContext.qml
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Services.Mpris
|
||||
|
||||
Scope {
|
||||
id: root
|
||||
signal unlocked();
|
||||
property string currentText: "";
|
||||
readonly property alias isUnlocking: pamtester.running;
|
||||
property bool failed: false;
|
||||
|
||||
onCurrentTextChanged: failed = false;
|
||||
|
||||
readonly property bool mediaPlaying: Mpris.players.values.some(player => {
|
||||
return player.playbackState === MprisPlaybackState.Playing && player.canPause;
|
||||
});
|
||||
|
||||
function pauseMedia() {
|
||||
Mpris.players.values.forEach(player => {
|
||||
if (player.playbackState === MprisPlaybackState.Playing && player.canPause) {
|
||||
player.playbackState = MprisPlaybackState.Paused;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function dpms() {
|
||||
Hyprland.dispatch(`dpms`);
|
||||
}
|
||||
|
||||
Process {
|
||||
id: pamtester
|
||||
property bool failed: true
|
||||
|
||||
command: ["pamtester", "login", Quickshell.env("USER"), "authenticate"]
|
||||
|
||||
onStarted: this.write(`${currentText}\n`)
|
||||
|
||||
stdout: SplitParser {
|
||||
// fails go to stderr
|
||||
onRead: pamtester.failed = false
|
||||
}
|
||||
|
||||
onExited: {
|
||||
if (failed) {
|
||||
root.failed = true;
|
||||
} else {
|
||||
root.unlocked();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function tryUnlock() {
|
||||
pamtester.running = true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue