toggle dnd shortcut

This commit is contained in:
Zacharias-Brohn
2026-02-04 19:08:55 +01:00
parent 7fc0369c5e
commit fa9bdca241
3 changed files with 12 additions and 86 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ CustomRect {
Layout.fillWidth: true
textFormat: Text.MarkdownText
text: root.modelData.body.replace(/(.)\n(?!\n)/g, "$1\n\n") || qsTr("No body here! :/")
color: root.modelData.urgency === "critical" ? DynamicColors.palette.m3secondary : DynamicColors.palette.m3outline
color: root.modelData.urgency === "critical" ? DynamicColors.palette.m3secondary : DynamicColors.palette.m3onSurface
wrapMode: Text.WordWrap
onLinkActivated: link => {
@@ -4,6 +4,7 @@ import qs.Modules
import qs.Daemons
import Quickshell
import Quickshell.Bluetooth
import Quickshell.Hyprland
import QtQuick
import QtQuick.Layouts
@@ -31,6 +32,7 @@ CustomRect {
spacing: 7
Toggle {
id: toggle
icon: "notifications_off"
checked: NotifServer.dnd
onClicked: NotifServer.dnd = !NotifServer.dnd
@@ -38,6 +40,15 @@ CustomRect {
}
}
GlobalShortcut {
name: "toggle-dnd"
appid: "zshell-nc"
onPressed: {
toggle.clicked();
}
}
component Toggle: IconButton {
Layout.fillWidth: true
Layout.preferredWidth: implicitWidth + (stateLayer.pressed ? 18 : internalChecked ? 7 : 0)