quickshell: notification daemon

This commit is contained in:
2025-10-13 19:09:04 +02:00
parent 1e06ae479e
commit 20821ef078
21 changed files with 1921 additions and 308 deletions

View File

@@ -1,7 +1,7 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell.Io
import Quickshell
import Quickshell.Widgets
import qs.Constants
import qs.Services
@@ -80,12 +80,6 @@ Item {
font.family: Fonts.primary
color: Colors.primary
Process {
id: action
running: false
}
MouseArea {
id: mouseArea
@@ -102,28 +96,20 @@ Item {
windowTitle.x = 0;
}
onClicked: function(mouse) {
if (mouse.button === Qt.MiddleButton) {
action.command = ["niri", "msg", "action", "close-window"];
action.startDetached();
} else if (mouse.button === Qt.LeftButton) {
action.command = ["niri", "msg", "action", "center-window"];
action.startDetached();
}
if (mouse.button === Qt.MiddleButton)
Quickshell.execDetached(["niri", "msg", "action", "close-window"]);
else if (mouse.button === Qt.LeftButton)
Quickshell.execDetached(["niri", "msg", "action", "center-window"]);
}
onWheel: function(wheel) {
if (wheel.angleDelta.y > 0) {
action.command = ["niri", "msg", "action", "set-column-width", "+10%"];
action.startDetached();
} else if (wheel.angleDelta.y < 0) {
action.command = ["niri", "msg", "action", "set-column-width", "-10%"];
action.startDetached();
} else if (wheel.angleDelta.x > 0) {
action.command = ["niri", "msg", "action", "focus-column-left"];
action.startDetached();
} else if (wheel.angleDelta.x < 0) {
action.command = ["niri", "msg", "action", "focus-column-right"];
action.startDetached();
}
if (wheel.angleDelta.y > 0)
Quickshell.execDetached(["niri", "msg", "action", "set-column-width", "+10%"]);
else if (wheel.angleDelta.y < 0)
Quickshell.execDetached(["niri", "msg", "action", "set-column-width", "-10%"]);
else if (wheel.angleDelta.x > 0)
Quickshell.execDetached(["niri", "msg", "action", "focus-column-left"]);
else if (wheel.angleDelta.x < 0)
Quickshell.execDetached(["niri", "msg", "action", "focus-column-right"]);
}
}

View File

@@ -11,8 +11,12 @@ Text {
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
PanelService.getPanel("calendarPanel")?.toggle(this)
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: (mouse) => {
if (mouse.button === Qt.LeftButton)
PanelService.getPanel("calendarPanel")?.toggle(this)
else if (mouse.button === Qt.RightButton)
PanelService.getPanel("notificationHistoryPanel")?.toggle(this)
}
}
}