quickshell: soft-reload on config change so the tray host survives (fixes vesktop crash); suppress toast while popup open; animated hover states

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-06-11 14:49:07 +01:00
parent d24a51b0af
commit db99982c79

View file

@ -31,8 +31,12 @@ in
}; };
xdg.configFile = let xdg.configFile = let
# Soft-reload quickshell in place: the process (and its DBus services —
# tray host, notification daemon) stays alive, so Electron apps with
# tray icons (vesktop) don't crash like they do on a hard restart.
# Falls back to a unit restart if the IPC socket isn't up.
qsRestart = '' qsRestart = ''
${pkgs.systemd}/bin/systemctl --user restart quickshell.service 2>/dev/null || true ${pkgs.quickshell}/bin/qs ipc call shell reload 2>/dev/null || ${pkgs.systemd}/bin/systemctl --user restart quickshell.service 2>/dev/null || true
''; '';
wifiConnectScript = pkgs.writeShellScript "wifi-connect" '' wifiConnectScript = pkgs.writeShellScript "wifi-connect" ''
ssid="$1" ssid="$1"
@ -131,6 +135,13 @@ in
function powermenu(): void { launcher.toggleMode("power"); } function powermenu(): void { launcher.toggleMode("power"); }
} }
// Soft reload, used by the nix onChange hook keeps the
// process and its DBus services (tray host) alive.
IpcHandler {
target: "shell"
function reload(): void { Quickshell.reload(false); }
}
NotificationServer { NotificationServer {
id: _notifServer id: _notifServer
bodySupported: true bodySupported: true
@ -328,6 +339,7 @@ in
height: 32 height: 32
radius: 6 radius: 6
color: list.currentIndex === index ? Theme.base02 : "transparent" color: list.currentIndex === index ? Theme.base02 : "transparent"
Behavior on color { ColorAnimation { duration: 100 } }
Row { Row {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -1143,7 +1155,7 @@ in
} }
Behavior on height { Behavior on height {
NumberAnimation { duration: 220; easing.type: Easing.OutCubic } NumberAnimation { duration: 280; easing.type: Easing.OutExpo }
} }
Item { Item {
@ -1213,6 +1225,7 @@ in
height: modelData.isSeparator ? 9 : 28 height: modelData.isSeparator ? 9 : 28
color: !modelData.isSeparator && itemMouse.containsMouse && modelData.enabled color: !modelData.isSeparator && itemMouse.containsMouse && modelData.enabled
? Theme.base02 : "transparent" ? Theme.base02 : "transparent"
Behavior on color { ColorAnimation { duration: 120 } }
radius: modelData.isSeparator ? 0 : 4 radius: modelData.isSeparator ? 0 : 4
Rectangle { Rectangle {
@ -1336,6 +1349,7 @@ in
width: parent.width width: parent.width
height: 28 height: 28
color: masterMuteMa.containsMouse ? Theme.base02 : "transparent" color: masterMuteMa.containsMouse ? Theme.base02 : "transparent"
Behavior on color { ColorAnimation { duration: 120 } }
radius: 4 radius: 4
Text { Text {
@ -1485,6 +1499,7 @@ in
width: parent.width width: parent.width
height: 28 height: 28
color: disconnectMouse.containsMouse ? Theme.base02 : "transparent" color: disconnectMouse.containsMouse ? Theme.base02 : "transparent"
Behavior on color { ColorAnimation { duration: 120 } }
radius: 4 radius: 4
Text { Text {
@ -1534,6 +1549,7 @@ in
width: 220 width: 220
height: 32 height: 32
color: netItemMouse.containsMouse ? Theme.base02 : "transparent" color: netItemMouse.containsMouse ? Theme.base02 : "transparent"
Behavior on color { ColorAnimation { duration: 120 } }
radius: 4 radius: 4
Row { Row {
@ -1674,6 +1690,7 @@ in
color: batteryWidget.powerProfile === modelData.name color: batteryWidget.powerProfile === modelData.name
? Theme.base02 : profMouse.containsMouse ? Theme.base02 : profMouse.containsMouse
? Theme.base01 : "transparent" ? Theme.base01 : "transparent"
Behavior on color { ColorAnimation { duration: 120 } }
border.width: batteryWidget.powerProfile === modelData.name ? 1 : 0 border.width: batteryWidget.powerProfile === modelData.name ? 1 : 0
border.color: Theme.base03 border.color: Theme.base03
@ -1831,6 +1848,7 @@ in
width: 28; height: 28; radius: 6 width: 28; height: 28; radius: 6
anchors.left: parent.left anchors.left: parent.left
color: calPrevMa.containsMouse ? Theme.base02 : "transparent" color: calPrevMa.containsMouse ? Theme.base02 : "transparent"
Behavior on color { ColorAnimation { duration: 120 } }
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: "\u{f0141}" text: "\u{f0141}"
@ -1865,6 +1883,7 @@ in
width: 28; height: 28; radius: 6 width: 28; height: 28; radius: 6
anchors.right: parent.right anchors.right: parent.right
color: calNextMa.containsMouse ? Theme.base02 : "transparent" color: calNextMa.containsMouse ? Theme.base02 : "transparent"
Behavior on color { ColorAnimation { duration: 120 } }
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: "\u{f0142}" text: "\u{f0142}"
@ -2063,6 +2082,7 @@ in
required property var modelData required property var modelData
width: 28; height: 28; radius: 14 width: 28; height: 28; radius: 14
color: mediaBtnMa.containsMouse ? Theme.base02 : "transparent" color: mediaBtnMa.containsMouse ? Theme.base02 : "transparent"
Behavior on color { ColorAnimation { duration: 120 } }
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: mediaBtn.modelData.glyph text: mediaBtn.modelData.glyph
@ -2199,6 +2219,7 @@ in
height: actionText.height + 4 height: actionText.height + 4
radius: 4 radius: 4
color: actionMa.containsMouse ? Theme.base03 : Theme.base02 color: actionMa.containsMouse ? Theme.base03 : Theme.base02
Behavior on color { ColorAnimation { duration: 120 } }
border.width: 1 border.width: 1
border.color: Theme.base03 border.color: Theme.base03
Text { Text {
@ -2268,7 +2289,9 @@ in
Connections { Connections {
target: bar.shellRoot target: bar.shellRoot
function onNotificationReceived() { function onNotificationReceived() {
if (toastItem.isPrimary) { // No toast while the calendar popup is open the
// notification list is already on screen there.
if (toastItem.isPrimary && !calPopup.visible) {
toastItem.showToast(bar.shellRoot.latestNotification); toastItem.showToast(bar.shellRoot.latestNotification);
} }
} }
@ -2402,7 +2425,7 @@ in
} }
Behavior on height { Behavior on height {
NumberAnimation { duration: 220; easing.type: Easing.OutCubic } NumberAnimation { duration: 280; easing.type: Easing.OutExpo }
} }
Column { Column {
@ -2446,6 +2469,7 @@ in
height: toastActionText.height + 6 height: toastActionText.height + 6
radius: 4 radius: 4
color: toastActionMa.containsMouse ? Theme.base02 : Theme.base01 color: toastActionMa.containsMouse ? Theme.base02 : Theme.base01
Behavior on color { ColorAnimation { duration: 120 } }
border.width: 1 border.width: 1
border.color: Theme.base02 border.color: Theme.base02
Text { Text {