diff --git a/config/Dimensions.qml b/config/Dimensions.qml index afaa224..ff30181 100644 --- a/config/Dimensions.qml +++ b/config/Dimensions.qml @@ -18,7 +18,6 @@ Singleton { property Cpu cpu: Cpu {} property Gpu gpu: Gpu {} property Caffeine caffeine: Caffeine {} - property Notifications notifications: Notifications {} property Workspace workspace: Workspace {} property Tray tray: Tray {} property TrayMenu trayMenu: TrayMenu {} @@ -101,13 +100,6 @@ Singleton { property int verticalPadding: 6 } - component Notifications: QtObject { - property int fontSize: 16 - property int height: 30 - property int horizontalPadding: 8 - property int verticalPadding: 6 - } - component Workspace: QtObject { property int spacing: 5 property int iconSize: 16 diff --git a/constants/Icons.qml b/constants/Icons.qml index f484252..c58b16c 100644 --- a/constants/Icons.qml +++ b/constants/Icons.qml @@ -3,8 +3,6 @@ pragma Singleton import Quickshell Singleton { - property string bell: "\u{E05d}" - property string bellRing: "\u{E224}" property string brickWall: "\u{E586}" property string coffee: "\u{E09a}" property string cpu: "\u{E0ad}" diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 5577879..f4ec4e0 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -59,9 +59,9 @@ Scope { anchors.verticalCenter: parent.verticalCenter } - // Tray { - // anchors.verticalCenter: parent.verticalCenter - // } + Tray { + anchors.verticalCenter: parent.verticalCenter + } } Row { @@ -127,10 +127,6 @@ Scope { Clock { anchors.verticalCenter: parent.verticalCenter } - - Notifications { - anchors.verticalCenter: parent.verticalCenter - } } } } diff --git a/modules/bar/components/Notifications.qml b/modules/bar/components/Notifications.qml deleted file mode 100644 index c9c2b27..0000000 --- a/modules/bar/components/Notifications.qml +++ /dev/null @@ -1,44 +0,0 @@ -import QtQuick -import Quickshell.Io -import "../../../config/" -import "../../../constants/" -import "../../../services/" -import "../../../styled/" - -Clickable { - id: clickable - - implicitWidth: text.width - implicitHeight: Dimensions.notifications.height - - onClicked: { - Notifications.clear(); - } - - StyledText { - id: text - - font.family: Theme.lucide.font.family - font.pixelSize: Dimensions.notifications.fontSize - font.bold: true - text: Icons.bell - - color: clickable.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent - - anchors.verticalCenter: parent.verticalCenter - topPadding: Dimensions.notifications.verticalPadding - bottomPadding: Dimensions.notifications.verticalPadding - leftPadding: Dimensions.notifications.horizontalPadding - rightPadding: Dimensions.notifications.horizontalPadding - - states: State { - when: Notifications.hasNotifications - PropertyChanges { - text { - text: Icons.bellRing - color: clickable.containsMouse ? Theme.palette.base300 : Theme.palette.secondary - } - } - } - } -} diff --git a/modules/bar/components/Pipewire.qml b/modules/bar/components/Pipewire.qml index 631ca03..0a864ed 100644 --- a/modules/bar/components/Pipewire.qml +++ b/modules/bar/components/Pipewire.qml @@ -17,14 +17,11 @@ Clickable { } onClicked: mouse => { - if (!sink) { - return - } if (mouse.button == Qt.LeftButton) { - sink.audio.muted = !sink?.audio.muted; - } else if (mouse.button == Qt.RightButton) - // show menu - {} + sink.audio.muted = !sink.audio.muted; + } else if (mouse.button == Qt.RightButton) { + // show menu + } } onWheel: event => { @@ -38,7 +35,7 @@ Clickable { states: [ State { name: "muted" - when: clickable.sink?.audio.muted ?? false + when: clickable.sink.audio.muted PropertyChanges { text { icon: " " @@ -47,7 +44,7 @@ Clickable { }, State { name: "off" - when: clickable.sink?.audio.volume <= 0 + when: clickable.sink.audio.volume <= 0 PropertyChanges { text { icon: " " @@ -61,7 +58,7 @@ Clickable { property string icon: " " - text: `${icon} ${(clickable.sink?.audio.volume * 100).toFixed()}%` + text: `${icon} ${(Pipewire.defaultAudioSink.audio.volume * 100).toFixed()}%` font.pixelSize: Dimensions.pipewire.fontSize color: clickable.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent diff --git a/services/Notifications.qml b/services/Notifications.qml deleted file mode 100644 index d860b2a..0000000 --- a/services/Notifications.qml +++ /dev/null @@ -1,25 +0,0 @@ -pragma Singleton - -import Quickshell -import Quickshell.Services.Notifications - -Singleton { - id: root - - property bool hasNotifications: notifications.length > 0 - property list notifications: [] - - function clear() { - notifications.forEach(notification => { - notification.dismiss(); - }); - notifications = []; - } - - NotificationServer { - onNotification: event => { - event.tracked = true; - root.notifications.push(event); - } - } -}