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
@@ -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)