fix(session): logout cleanly through UWSM
This commit is contained in:
parent
b4c222d1aa
commit
2939012b63
1 changed files with 5 additions and 4 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.I3
|
|
||||||
import Quickshell.Networking
|
import Quickshell.Networking
|
||||||
import Quickshell.Bluetooth
|
import Quickshell.Bluetooth
|
||||||
import "../components"
|
import "../components"
|
||||||
|
|
@ -28,7 +27,8 @@ PopupWindow {
|
||||||
command: ["systemctl", "suspend"] },
|
command: ["systemctl", "suspend"] },
|
||||||
{ id: "logout", label: "Déconnexion", icon: "", accent: Theme.urgent,
|
{ id: "logout", label: "Déconnexion", icon: "", accent: Theme.urgent,
|
||||||
confirmTitle: "Se déconnecter ?",
|
confirmTitle: "Se déconnecter ?",
|
||||||
description: "La session SwayFX en cours sera fermée.", command: null },
|
description: "La session SwayFX en cours sera fermée.",
|
||||||
|
command: ["uwsm", "stop"] },
|
||||||
{ id: "reboot", label: "Redémarrer", icon: "", accent: Theme.warning,
|
{ id: "reboot", label: "Redémarrer", icon: "", accent: Theme.warning,
|
||||||
confirmTitle: "Redémarrer l'ordinateur ?",
|
confirmTitle: "Redémarrer l'ordinateur ?",
|
||||||
description: "La session en cours sera fermée.",
|
description: "La session en cours sera fermée.",
|
||||||
|
|
@ -63,8 +63,9 @@ PopupWindow {
|
||||||
if (!selected) return;
|
if (!selected) return;
|
||||||
// Fermer le popup avant toute commande qui peut verrouiller ou terminer la session.
|
// Fermer le popup avant toute commande qui peut verrouiller ou terminer la session.
|
||||||
visible = false;
|
visible = false;
|
||||||
if (id === "logout") I3.dispatch("exit");
|
// CONTRACT: UWSM possède le cycle de vie de Sway ; son arrêt doit donc
|
||||||
else Quickshell.execDetached(selected.command);
|
// passer par la commande déclarée, comme les autres actions de session.
|
||||||
|
if (selected.command) Quickshell.execDetached(selected.command);
|
||||||
}
|
}
|
||||||
|
|
||||||
anchor.window: barWindow
|
anchor.window: barWindow
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue