spotify: start after keyring unlock, not at hyprland startup
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
e9ab223891
commit
888eedad39
2 changed files with 31 additions and 6 deletions
|
|
@ -617,6 +617,9 @@ in
|
|||
property alias locked: lock.locked
|
||||
property string password: ""
|
||||
property bool failed: false
|
||||
// True only for the once-per-session lock below, so a later
|
||||
// manual lock/unlock does not re-launch spotify.
|
||||
property bool bootLock: false
|
||||
|
||||
function submit(pw) {
|
||||
if (pam.active || pw === "") return;
|
||||
|
|
@ -632,7 +635,7 @@ in
|
|||
Process {
|
||||
running: true
|
||||
command: ["mkdir", Quickshell.env("XDG_RUNTIME_DIR") + "/qs-boot-lock"]
|
||||
onExited: code => { if (code === 0) lock.locked = true; }
|
||||
onExited: code => { if (code === 0) { root.bootLock = true; lock.locked = true; } }
|
||||
}
|
||||
|
||||
// Chromium/Electron apps ask the Secret Service for their
|
||||
|
|
@ -668,6 +671,23 @@ in
|
|||
// EOF, or the daemon blocks on that read forever.
|
||||
stdinEnabled = false;
|
||||
}
|
||||
// The Secret Service is up and unlocked by the time the
|
||||
// parent exits (it forks, then exits 0 once the child
|
||||
// signals ready). Only now is it safe to start spotify —
|
||||
// see the note in settings/hyprland.nix's startup handler
|
||||
// for why it no longer autostarts there.
|
||||
onExited: {
|
||||
if (!root.bootLock) return;
|
||||
root.bootLock = false;
|
||||
spotifyStart.running = true;
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: spotifyStart
|
||||
// Via hyprland, not as a child of quickshell: a shell
|
||||
// restart on rebuild must not take spotify down with it.
|
||||
command: ["hyprctl", "dispatch", "exec", "spotify"]
|
||||
}
|
||||
|
||||
PamContext {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue