summaryrefslogtreecommitdiff
path: root/home-configuration/config/quickshell/shell.qml
diff options
context:
space:
mode:
Diffstat (limited to 'home-configuration/config/quickshell/shell.qml')
-rw-r--r--home-configuration/config/quickshell/shell.qml124
1 files changed, 124 insertions, 0 deletions
diff --git a/home-configuration/config/quickshell/shell.qml b/home-configuration/config/quickshell/shell.qml
new file mode 100644
index 0000000..a1356b1
--- /dev/null
+++ b/home-configuration/config/quickshell/shell.qml
@@ -0,0 +1,124 @@
+import Quickshell
+import Quickshell.Wayland
+import Quickshell.Services.Notifications
+import QtQuick
+import QtQuick.Layouts
+
+import "config.js" as Config
+
+Scope {
+ id: root
+
+ NotificationServer {
+ id: server
+ actionsSupported: true
+ bodySupported: true
+ imageSupported: true
+
+ onNotification: n => {
+ n.tracked = true
+ }
+ }
+
+ PanelWindow {
+ anchors { top: true; right: true }
+ margins { top: 56; right: 12 }
+
+ implicitWidth: 380
+ implicitHeight: Math.max(1, column.implicitHeight)
+ color: "transparent"
+ exclusionMode: ExclusionMode.Ignore
+
+ ColumnLayout {
+ id: column
+ width: parent.width
+ spacing: 10
+
+ Repeater {
+ model: server.trackedNotifications
+
+ delegate: Rectangle {
+ id: card
+ required property var modelData
+
+ Timer {
+ running: card.modelData.urgency !== NotificationUrgency.Critical
+ interval: Config.notifications.timeout
+ repeat: false
+ onTriggered: card.modelData.dismiss()
+ }
+
+ Layout.fillWidth: true
+ implicitHeight: layout.implicitHeight + 20
+
+ radius: 12
+ color: Config.colors.bgDark
+
+ Rectangle {
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ width: 4
+ radius: 12
+ color: card.modelData.urgency === NotificationUrgency.Critical
+ ? Config.colors.red
+ : Config.colors.purple
+ }
+
+ RowLayout {
+ id: layout
+ anchors.fill: parent
+ anchors.margins: 10
+ anchors.leftMargin: 18
+ spacing: 10
+
+ Image {
+ Layout.preferredWidth: 36
+ Layout.preferredHeight: 36
+ Layout.alignment: Qt.AlignTop
+ fillMode: Image.PreserveAspectFit
+ visible: source.toString() !== ""
+ source: card.modelData.image || card.modelData.appIcon || ""
+ }
+
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 2
+
+ Text {
+ Layout.fillWidth: true
+ text: card.modelData.summary
+ color: Config.colors.cyan
+
+ font.family: Config.bar.fontFamily
+ font.pixelSize: Config.bar.fontSize
+ font.bold: true
+
+ elide: Text.ElideRight
+ }
+
+ Text {
+ Layout.fillWidth: true
+ visible: text !== ""
+ text: card.modelData.body
+ color: Config.colors.fg
+
+ font.family: Config.bar.fontFamily
+ font.pixelSize: Config.bar.fontSize - 1
+
+ wrapMode: Text.WordWrap
+ }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ cursorShape: Qt.PointingHandCursor
+ onClicked: card.modelData.dismiss()
+ }
+ }
+ }
+ }
+ }
+}