noctalia-shell/shell.qml

81 lines
1.8 KiB
QML

import Quickshell
import Quickshell.Io
import Quickshell.Services.Pipewire
import Quickshell.Services.Notifications
import QtQuick
import QtCore
import qs.Bar
import qs.Bar.Modules
import qs.Widgets
import qs.Widgets.Notification
import qs.Settings
import qs.Helpers
Scope {
id: root
property alias appLauncherPanel: appLauncherPanel
function updateVolume(vol) {
volume = vol;
if (defaultAudioSink && defaultAudioSink.audio) {
defaultAudioSink.audio.volume = vol / 100;
}
}
Component.onCompleted: {
Quickshell.shell = root;
}
Bar {
id: bar
shell: root
}
Applauncher {
id: appLauncherPanel
visible: false
}
LockScreen {
id: lockScreen
}
NotificationServer {
id: notificationServer
onNotification: function (notification) {
console.log("Notification received:", notification.appName);
notification.tracked = true;
notificationPopup.addNotification(notification);
}
}
NotificationPopup {
id: notificationPopup
barVisible: bar.visible
}
property var defaultAudioSink: Pipewire.defaultAudioSink
property int volume: defaultAudioSink && defaultAudioSink.audio && defaultAudioSink.audio.volume ? Math.round(defaultAudioSink.audio.volume * 100) : 0
PwObjectTracker {
objects: [Pipewire.defaultAudioSink]
}
IPCHandlers {
appLauncherPanel: appLauncherPanel
lockScreen: lockScreen
}
Connections {
function onReloadCompleted() {
Quickshell.inhibitReloadPopup();
}
function onReloadFailed() {
Quickshell.inhibitReloadPopup();
}
target: Quickshell
}
}