Renamed all services to xxxService. Moved a couple things in Commons

This commit is contained in:
quadbyte 2025-08-15 21:45:58 -04:00
parent 7e334ae768
commit 83ff5f5589
86 changed files with 275 additions and 211 deletions

View file

@ -3,6 +3,7 @@ pragma Singleton
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons
import qs.Services import qs.Services
// -------------------------------- // --------------------------------

View file

@ -4,9 +4,6 @@ import Quickshell.Io
Item { Item {
id: root id: root
// Reference to the lockscreen component
property var lockscreen: null
IpcHandler { IpcHandler {
target: "settings" target: "settings"

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons
import qs.Services import qs.Services
pragma Singleton pragma Singleton
@ -53,7 +54,7 @@ Singleton {
// Only set wallpaper on initial load, not on reloads // Only set wallpaper on initial load, not on reloads
if (isInitialLoad && adapter.wallpaper.current !== "") { if (isInitialLoad && adapter.wallpaper.current !== "") {
console.log("[Settings] Set current wallpaper", adapter.wallpaper.current) console.log("[Settings] Set current wallpaper", adapter.wallpaper.current)
Wallpapers.setCurrentWallpaper(adapter.wallpaper.current, true) WallpapersService.setCurrentWallpaper(adapter.wallpaper.current, true)
} }
isInitialLoad = false isInitialLoad = false
}) })
@ -121,9 +122,9 @@ Singleton {
property int randomInterval: 300 property int randomInterval: 300
property JsonObject swww property JsonObject swww
onDirectoryChanged: Wallpapers.loadWallpapers() onDirectoryChanged: WallpapersService.loadWallpapers()
onIsRandomChanged: Wallpapers.toggleRandomWallpaper() onIsRandomChanged: WallpapersService.toggleRandomWallpaper()
onRandomIntervalChanged: Wallpapers.restartRandomWallpaperTimer() onRandomIntervalChanged: WallpapersService.restartRandomWallpaperTimer()
swww: JsonObject { swww: JsonObject {
property bool enabled: false property bool enabled: false

View file

@ -2,6 +2,7 @@ pragma Singleton
import Quickshell import Quickshell
import QtQuick import QtQuick
import qs.Commons
import qs.Services import qs.Services
Singleton { Singleton {

View file

@ -6,6 +6,7 @@ import Quickshell
import Quickshell.Io import Quickshell.Io
import Quickshell.Wayland import Quickshell.Wayland
import Quickshell.Widgets import Quickshell.Widgets
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -15,7 +16,7 @@ import "../../Helpers/MathHelper.js" as MathHelper
NLoader { NLoader {
id: appLauncher id: appLauncher
isLoaded: false isLoaded: false
// Clipboard state is persisted in Services/Clipboard.qml // Clipboard state is persisted in Services/ClipboardService.qml
content: Component { content: Component {
NPanel { NPanel {
id: appLauncherPanel id: appLauncherPanel
@ -36,7 +37,7 @@ NLoader {
} }
function updateClipboardHistory() { function updateClipboardHistory() {
Clipboard.refresh() ClipboardService.refresh()
} }
function selectNext() { function selectNext() {
@ -119,12 +120,12 @@ NLoader {
// Handle clipboard history // Handle clipboard history
if (query.startsWith(">clip")) { if (query.startsWith(">clip")) {
if (!Clipboard.initialized) { if (!ClipboardService.initialized) {
Clipboard.refresh() ClipboardService.refresh()
} }
const searchTerm = query.slice(5).trim() const searchTerm = query.slice(5).trim()
Clipboard.history.forEach(function (clip, index) { ClipboardService.history.forEach(function (clip, index) {
let searchContent = clip.type === 'image' ? clip.mimeType : clip.content || clip let searchContent = clip.type === 'image' ? clip.mimeType : clip.content || clip
if (!searchTerm || searchContent.toLowerCase().includes(searchTerm)) { if (!searchTerm || searchContent.toLowerCase().includes(searchTerm)) {

View file

@ -1,4 +1,5 @@
import QtQuick import QtQuick
import qs.Commons
import qs.Services import qs.Services
// Not used ATM and need rework // Not used ATM and need rework

View file

@ -1,4 +1,5 @@
import QtQuick import QtQuick
import qs.Commons
import qs.Services import qs.Services
Item { Item {

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons
import qs.Services import qs.Services
Variants { Variants {
@ -8,8 +9,8 @@ Variants {
delegate: PanelWindow { delegate: PanelWindow {
required property ShellScreen modelData required property ShellScreen modelData
property string wallpaperSource: Wallpapers.currentWallpaper !== "" property string wallpaperSource: WallpapersService.currentWallpaper !== ""
&& !Settings.data.wallpaper.swww.enabled ? Wallpapers.currentWallpaper : "" && !Settings.data.wallpaper.swww.enabled ? WallpapersService.currentWallpaper : ""
visible: wallpaperSource !== "" && !Settings.data.wallpaper.swww.enabled visible: wallpaperSource !== "" && !Settings.data.wallpaper.swww.enabled

View file

@ -2,14 +2,15 @@ import QtQuick
import QtQuick.Effects import QtQuick.Effects
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
NLoader { NLoader {
active: Workspaces.isNiri active: WorkspacesService.isNiri
Component.onCompleted: { Component.onCompleted: {
if (Workspaces.isNiri) { if (WorkspacesService.isNiri) {
console.log("[Overview] Loading Overview component (Niri detected)") console.log("[Overview] Loading Overview component (Niri detected)")
} else { } else {
console.log("[Overview] Skipping Overview component (Niri not detected)") console.log("[Overview] Skipping Overview component (Niri not detected)")
@ -21,8 +22,8 @@ NLoader {
delegate: PanelWindow { delegate: PanelWindow {
required property ShellScreen modelData required property ShellScreen modelData
property string wallpaperSource: Wallpapers.currentWallpaper !== "" property string wallpaperSource: WallpapersService.currentWallpaper !== ""
&& !Settings.data.wallpaper.swww.enabled ? Wallpapers.currentWallpaper : "" && !Settings.data.wallpaper.swww.enabled ? WallpapersService.currentWallpaper : ""
visible: wallpaperSource !== "" && !Settings.data.wallpaper.swww.enabled visible: wallpaperSource !== "" && !Settings.data.wallpaper.swww.enabled
color: "transparent" color: "transparent"

View file

@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Effects import QtQuick.Effects
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -15,7 +16,7 @@ NLoader {
id: root id: root
required property ShellScreen modelData required property ShellScreen modelData
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: ScalingService.scale(screen)
screen: modelData screen: modelData
// Visible ring color // Visible ring color

View file

@ -2,6 +2,7 @@ pragma Singleton
import QtQuick import QtQuick
import Quickshell import Quickshell
import qs.Commons
import qs.Services import qs.Services
Item { Item {

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import Quickshell import Quickshell
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -29,8 +30,8 @@ Row {
target: typeof Niri !== "undefined" ? Niri : null target: typeof Niri !== "undefined" ? Niri : null
function onFocusedWindowIndexChanged() { function onFocusedWindowIndexChanged() {
// Check if window actually changed // Check if window actually changed
if (Niri.focusedWindowIndex !== lastWindowIndex) { if (NiriService.focusedWindowIndex !== lastWindowIndex) {
lastWindowIndex = Niri.focusedWindowIndex lastWindowIndex = NiriService.focusedWindowIndex
showingFullTitle = true showingFullTitle = true
fullTitleTimer.restart() fullTitleTimer.restart()
} }
@ -96,8 +97,8 @@ Row {
} }
// Get the focused window data // Get the focused window data
const focusedWindow = Niri.focusedWindowIndex >= 0 const focusedWindow = NiriService.focusedWindowIndex >= 0
&& Niri.focusedWindowIndex < Niri.windows.length ? Niri.windows[Niri.focusedWindowIndex] : null && NiriService.focusedWindowIndex < NiriService.windows.length ? NiriService.windows[NiriService.focusedWindowIndex] : null
if (!focusedWindow) { if (!focusedWindow) {
return "" return ""

View file

@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
import qs.Modules.Notification import qs.Modules.Notification
@ -13,7 +14,7 @@ Variants {
id: root id: root
required property ShellScreen modelData required property ShellScreen modelData
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: ScalingService.scale(screen)
screen: modelData screen: modelData
implicitHeight: Style.barHeight * scaling implicitHeight: Style.barHeight * scaling
@ -88,11 +89,11 @@ Variants {
tooltipText: "Screen Recording Active" tooltipText: "Screen Recording Active"
sizeMultiplier: 0.8 sizeMultiplier: 0.8
showBorder: false showBorder: false
showFilled: ScreenRecorder.isRecording showFilled: ScreenRecorderService.isRecording
visible: ScreenRecorder.isRecording visible: ScreenRecorderService.isRecording
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
ScreenRecorder.toggleRecording() ScreenRecorderService.toggleRecording()
} }
} }

View file

@ -2,6 +2,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Services.UPower import Quickshell.Services.UPower
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import qs.Modules.Settings import qs.Modules.Settings
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -1,4 +1,5 @@
import QtQuick import QtQuick
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -1,5 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -8,7 +9,7 @@ Item {
width: visible ? mediaRow.width : 0 width: visible ? mediaRow.width : 0
height: Style.barHeight * scaling height: Style.barHeight * scaling
visible: Settings.data.bar.showMedia && (MediaPlayer.canPlay || MediaPlayer.canPause) visible: Settings.data.bar.showMedia && (MediaService.canPlay || MediaService.canPause)
RowLayout { RowLayout {
id: mediaRow id: mediaRow
@ -16,18 +17,17 @@ Item {
spacing: Style.spacingTiniest * scaling spacing: Style.spacingTiniest * scaling
// NIconButton { // NIconButton {
// icon: MediaPlayer.isPlaying ? "pause" : "play_arrow" // icon: MediaService.isPlaying ? "pause" : "play_arrow"
// tooltipText: "Play/pause media" // tooltipText: "Play/pause media"
// sizeMultiplier: 0.8 // sizeMultiplier: 0.8
// showBorder: false // showBorder: false
// onClicked: MediaPlayer.playPause() // onClicked: MediaService.playPause()
// } // }
NText { NText {
text: MediaPlayer.isPlaying ? "pause" : "play_arrow" text: MediaService.isPlaying ? "pause" : "play_arrow"
font.family: "Material Symbols Outlined" font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeLarge * scaling font.pointSize: Style.fontSizeLarge * scaling
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
color: Colors.mPrimary color: Colors.mPrimary
MouseArea { MouseArea {
@ -35,21 +35,20 @@ Item {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
onClicked: MediaPlayer.playPause() onClicked: MediaService.playPause()
} }
} }
} }
// Track info // Track info
NText { NText {
text: MediaPlayer.trackTitle + (MediaPlayer.trackArtist !== "" ? ` - {MediaPlayer.trackArtist}` : "") text: MediaService.trackTitle + (MediaService.trackArtist !== "" ? ` - {MediaService.trackArtist}` : "")
color: Colors.mOnSurface color: Colors.mOnSurface
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
font.weight: Style.fontWeightBold font.weight: Style.fontWeightBold
elide: Text.ElideRight elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
Layout.maximumWidth: 200 * scaling Layout.maximumWidth: 200 * scaling
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
} }

View file

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -1,5 +1,6 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -28,7 +29,7 @@ Row {
NText { NText {
id: cpuUsageText id: cpuUsageText
text: `${SystemStats.cpuUsage}%` text: `${SystemStatsService.cpuUsage}%`
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
font.weight: Style.fontWeightBold font.weight: Style.fontWeightBold
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -51,7 +52,7 @@ Row {
} }
NText { NText {
text: `${SystemStats.cpuTemp}°C` text: `${SystemStatsService.cpuTemp}°C`
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
font.weight: Style.fontWeightBold font.weight: Style.fontWeightBold
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -74,7 +75,7 @@ Row {
} }
NText { NText {
text: `${SystemStats.memoryUsageGb}G` text: `${SystemStatsService.memoryUsageGb}G`
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
font.weight: Style.fontWeightBold font.weight: Style.fontWeightBold
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter

View file

@ -5,6 +5,7 @@ import QtQuick.Controls
import Quickshell import Quickshell
import Quickshell.Services.SystemTray import Quickshell.Services.SystemTray
import Quickshell.Widgets import Quickshell.Widgets
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -2,6 +2,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Services.Pipewire import Quickshell.Services.Pipewire
import qs.Modules.Settings import qs.Modules.Settings
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -15,15 +16,15 @@ Item {
property bool firstVolumeReceived: false property bool firstVolumeReceived: false
function getIcon() { function getIcon() {
if (Audio.muted) { if (AudioService.muted) {
return "volume_off" return "volume_off"
} }
return Audio.volume <= Number.EPSILON ? "volume_off" : (Audio.volume < 0.33 ? "volume_down" : "volume_up") return AudioService.volume <= Number.EPSILON ? "volume_off" : (AudioService.volume < 0.33 ? "volume_down" : "volume_up")
} }
// Connection used to open the pill when volume changes // Connection used to open the pill when volume changes
Connections { Connections {
target: Audio.sink?.audio ? Audio.sink?.audio : null target: AudioService.sink?.audio ? AudioService.sink?.audio : null
function onVolumeChanged() { function onVolumeChanged() {
// console.log("[Bar:Volume] onVolumeChanged") // console.log("[Bar:Volume] onVolumeChanged")
if (!firstVolumeReceived) { if (!firstVolumeReceived) {
@ -51,19 +52,19 @@ Item {
iconCircleColor: Colors.mPrimary iconCircleColor: Colors.mPrimary
collapsedIconColor: Colors.mOnSurface collapsedIconColor: Colors.mOnSurface
autoHide: false // Important to be false so we can hover as long as we want autoHide: false // Important to be false so we can hover as long as we want
text: Math.floor(Audio.volume * 100) + "%" text: Math.floor(AudioService.volume * 100) + "%"
tooltipText: "Volume: " + Math.round( tooltipText: "Volume: " + Math.round(
Audio.volume * 100) + "%\nLeft click for advanced settings.\nScroll up/down to change volume." AudioService.volume * 100) + "%\nLeft click for advanced settings.\nScroll up/down to change volume."
onWheel: function (angle) { onWheel: function (angle) {
if (angle > 0) { if (angle > 0) {
Audio.increaseVolume() AudioService.increaseVolume()
} else if (angle < 0) { } else if (angle < 0) {
Audio.decreaseVolume() AudioService.decreaseVolume()
} }
} }
onClicked: { onClicked: {
settingsPanel.requestedTab = SettingsPanel.Tab.Audio settingsPanel.requestedTab = SettingsPanel.Tab.AudioService
settingsPanel.isLoaded = true settingsPanel.isLoaded = true
} }
} }

View file

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -15,14 +16,14 @@ NIconButton {
icon: { icon: {
let connected = false let connected = false
let signalStrength = 0 let signalStrength = 0
for (const net in network.networks) { for (const net in NetworkService.networks) {
if (network.networks[net].connected) { if (NetworkService.networks[net].connected) {
connected = true connected = true
signalStrength = network.networks[net].signal signalStrength = network.networks[net].signal
break break
} }
} }
return connected ? network.signalIcon(signalStrength) : "wifi_off" return connected ? NetworkService.signalIcon(signalStrength) : "wifi_off"
} }
tooltipText: "WiFi Networks" tooltipText: "WiFi Networks"
onClicked: { onClicked: {
@ -36,20 +37,16 @@ NIconButton {
wifiMenuLoader.item.hide() wifiMenuLoader.item.hide()
} else { } else {
wifiMenuLoader.item.visible = false wifiMenuLoader.item.visible = false
network.onMenuClosed() NetworkService.onMenuClosed()
} }
} else { } else {
// Panel is hidden, show it // Panel is hidden, show it
wifiMenuLoader.item.visible = true wifiMenuLoader.item.visible = true
network.onMenuOpened() NetworkService.onMenuOpened()
} }
} }
} }
Network {
id: network
}
WiFiMenu { WiFiMenu {
id: wifiMenuLoader id: wifiMenuLoader
} }

View file

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -42,7 +43,7 @@ NLoader {
// Also handle visibility changes from external sources // Also handle visibility changes from external sources
onVisibleChanged: { onVisibleChanged: {
if (visible && Settings.data.network.wifiEnabled) { if (visible && Settings.data.network.wifiEnabled) {
network.refreshNetworks() NetworkService.refreshNetworks()
} else if (wifiMenuRect.opacityValue > 0) { } else if (wifiMenuRect.opacityValue > 0) {
// Start hide animation // Start hide animation
wifiMenuRect.scaleValue = 0.8 wifiMenuRect.scaleValue = 0.8
@ -61,16 +62,12 @@ NLoader {
onTriggered: { onTriggered: {
wifiPanel.visible = false wifiPanel.visible = false
wifiPanel.dismissed() wifiPanel.dismissed()
network.onMenuClosed() NetworkService.onMenuClosed()
} }
} }
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
Network {
id: network
}
// Timer to refresh networks when WiFi is enabled while menu is open // Timer to refresh networks when WiFi is enabled while menu is open
Timer { Timer {
id: wifiEnableRefreshTimer id: wifiEnableRefreshTimer
@ -78,7 +75,7 @@ NLoader {
repeat: false repeat: false
onTriggered: { onTriggered: {
if (Settings.data.network.wifiEnabled && wifiPanel.visible) { if (Settings.data.network.wifiEnabled && wifiPanel.visible) {
network.refreshNetworks() NetworkService.refreshNetworks()
} }
} }
} }
@ -153,7 +150,7 @@ NLoader {
value: Settings.data.network.wifiEnabled value: Settings.data.network.wifiEnabled
onToggled: function (value) { onToggled: function (value) {
Settings.data.network.wifiEnabled = value Settings.data.network.wifiEnabled = value
network.setWifiEnabled(value) NetworkService.setWifiEnabled(value)
// If enabling WiFi while menu is open, refresh after a delay // If enabling WiFi while menu is open, refresh after a delay
if (value) { if (value) {
@ -168,7 +165,7 @@ NLoader {
sizeMultiplier: 0.8 sizeMultiplier: 0.8
enabled: Settings.data.network.wifiEnabled && !network.isLoading enabled: Settings.data.network.wifiEnabled && !network.isLoading
onClicked: { onClicked: {
network.refreshNetworks() NetworkService.refreshNetworks()
} }
} }
@ -268,7 +265,7 @@ NLoader {
spacing: Style.marginSmall * scaling spacing: Style.marginSmall * scaling
NText { NText {
text: network.signalIcon(modelData.signal) text: NetworkService.signalIcon(modelData.signal)
font.family: "Material Symbols Outlined" font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeXL * scaling font.pointSize: Style.fontSizeXL * scaling
color: modelData.connected ? Colors.mSurface : (networkMouseArea.containsMouse ? Colors.mSurface : Colors.mOnSurface) color: modelData.connected ? Colors.mSurface : (networkMouseArea.containsMouse ? Colors.mSurface : Colors.mOnSurface)
@ -297,9 +294,9 @@ NLoader {
} }
NText { NText {
visible: network.connectStatusSsid === modelData.ssid && network.connectStatus === "error" visible: NetworkService.connectStatusSsid === modelData.ssid && NetworkService.connectStatus === "error"
&& network.connectError.length > 0 && network.connectError.length > 0
text: network.connectError text: NetworkService.connectError
color: Colors.mError color: Colors.mError
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
elide: Text.ElideRight elide: Text.ElideRight
@ -310,12 +307,12 @@ NLoader {
Item { Item {
Layout.preferredWidth: Style.baseWidgetSize * 0.7 * scaling Layout.preferredWidth: Style.baseWidgetSize * 0.7 * scaling
Layout.preferredHeight: Style.baseWidgetSize * 0.7 * scaling Layout.preferredHeight: Style.baseWidgetSize * 0.7 * scaling
visible: network.connectStatusSsid === modelData.ssid visible: NetworkService.connectStatusSsid === modelData.ssid
&& (network.connectStatus !== "" || network.connectingSsid === modelData.ssid) && (network.connectStatus !== "" || NetworkService.connectingSsid === modelData.ssid)
NBusyIndicator { NBusyIndicator {
visible: network.connectingSsid === modelData.ssid visible: NetworkService.connectingSsid === modelData.ssid
running: network.connectingSsid === modelData.ssid running: NetworkService.connectingSsid === modelData.ssid
color: Colors.mPrimary color: Colors.mPrimary
anchors.centerIn: parent anchors.centerIn: parent
size: Style.baseWidgetSize * 0.7 * scaling size: Style.baseWidgetSize * 0.7 * scaling
@ -323,7 +320,7 @@ NLoader {
// TBC: Does nothing on my setup // TBC: Does nothing on my setup
NText { NText {
visible: network.connectStatus === "success" && !network.connectingSsid visible: NetworkService.connectStatus === "success" && !NetworkService.connectingSsid
text: "check_circle" text: "check_circle"
font.family: "Material Symbols Outlined" font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeXL * scaling font.pointSize: Style.fontSizeXL * scaling
@ -333,7 +330,7 @@ NLoader {
// TBC: Does nothing on my setup // TBC: Does nothing on my setup
NText { NText {
visible: network.connectStatus === "error" && !network.connectingSsid visible: NetworkService.connectStatus === "error" && !NetworkService.connectingSsid
text: "error" text: "error"
font.family: "Material Symbols Outlined" font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
@ -356,8 +353,8 @@ NLoader {
hoverEnabled: true hoverEnabled: true
onClicked: { onClicked: {
if (modelData.connected) { if (modelData.connected) {
network.disconnectNetwork(modelData.ssid) NetworkService.disconnectNetwork(modelData.ssid)
} else if (network.isSecured(modelData.security) && !modelData.existing) { } else if (NetworkService.isSecured(modelData.security) && !modelData.existing) {
passwordPromptSsid = modelData.ssid passwordPromptSsid = modelData.ssid
showPasswordPrompt = true showPasswordPrompt = true
passwordInput = "" // Clear previous input passwordInput = "" // Clear previous input
@ -365,7 +362,7 @@ NLoader {
passwordInputField.forceActiveFocus() passwordInputField.forceActiveFocus()
}) })
} else { } else {
network.connectNetwork(modelData.ssid, modelData.security) NetworkService.connectNetwork(modelData.ssid, modelData.security)
} }
} }
} }
@ -413,7 +410,7 @@ NLoader {
echoMode: TextInput.Password echoMode: TextInput.Password
onTextChanged: passwordInput = text onTextChanged: passwordInput = text
onAccepted: { onAccepted: {
network.submitPassword(passwordPromptSsid, passwordInput) NetworkService.submitPassword(passwordPromptSsid, passwordInput)
showPasswordPrompt = false showPasswordPrompt = false
} }
@ -448,7 +445,7 @@ NLoader {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
network.submitPassword(passwordPromptSsid, passwordInput) NetworkService.submitPassword(passwordPromptSsid, passwordInput)
showPasswordPrompt = false showPasswordPrompt = false
} }
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor

View file

@ -5,6 +5,7 @@ import QtQuick.Window
import QtQuick.Effects import QtQuick.Effects
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons
import qs.Services import qs.Services
Item { Item {
@ -42,8 +43,8 @@ Item {
Component.onCompleted: { Component.onCompleted: {
localWorkspaces.clear() localWorkspaces.clear()
for (var i = 0; i < Workspaces.workspaces.count; i++) { for (var i = 0; i < WorkspacesService.workspaces.count; i++) {
const ws = Workspaces.workspaces.get(i) const ws = WorkspacesService.workspaces.get(i)
if (ws.output.toLowerCase() === screen.name.toLowerCase()) { if (ws.output.toLowerCase() === screen.name.toLowerCase()) {
localWorkspaces.append(ws) localWorkspaces.append(ws)
} }
@ -53,11 +54,11 @@ Item {
} }
Connections { Connections {
target: Workspaces target: WorkspacesService
function onWorkspacesChanged() { function onWorkspacesChanged() {
localWorkspaces.clear() localWorkspaces.clear()
for (var i = 0; i < Workspaces.workspaces.count; i++) { for (var i = 0; i < WorkspacesService.workspaces.count; i++) {
const ws = Workspaces.workspaces.get(i) const ws = WorkspacesService.workspaces.get(i)
if (ws.output.toLowerCase() === screen.name.toLowerCase()) { if (ws.output.toLowerCase() === screen.name.toLowerCase()) {
localWorkspaces.append(ws) localWorkspaces.append(ws)
} }
@ -181,7 +182,7 @@ Item {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
Workspaces.switchToWorkspace(model.idx) WorkspacesService.switchToWorkspace(model.idx)
} }
hoverEnabled: true hoverEnabled: true
} }

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -132,7 +133,7 @@ NLoader {
font.weight: Style.fontWeightBold font.weight: Style.fontWeightBold
} }
NText { NText {
text: `${Math.round(Scaling.overrideScale * 100)}%` text: `${Math.round(ScalingService.overrideScale * 100)}%`
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
} }
RowLayout { RowLayout {
@ -142,14 +143,14 @@ NLoader {
from: 0.6 from: 0.6
to: 1.8 to: 1.8
stepSize: 0.01 stepSize: 0.01
value: Scaling.overrideScale value: ScalingService.overrideScale
implicitWidth: bgRect.width * 0.75 implicitWidth: bgRect.width * 0.75
onMoved: { onMoved: {
} }
onPressedChanged: { onPressedChanged: {
Scaling.overrideScale = value ScalingService.overrideScale = value
Scaling.overrideEnabled = true ScalingService.overrideEnabled = true
} }
} }
NIconButton { NIconButton {
@ -157,8 +158,8 @@ NLoader {
tooltipText: "Reset Scaling" tooltipText: "Reset Scaling"
fontPointSize: Style.fontSizeLarge * scaling fontPointSize: Style.fontSizeLarge * scaling
onClicked: { onClicked: {
Scaling.overrideEnabled = false ScalingService.overrideEnabled = false
Scaling.overrideScale = 1.0 ScalingService.overrideScale = 1.0
} }
} }
} }

View file

@ -5,6 +5,7 @@ import QtQuick.Effects
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import Quickshell.Widgets import Quickshell.Widgets
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -18,7 +19,7 @@ NLoader {
id: dockWindow id: dockWindow
required property ShellScreen modelData required property ShellScreen modelData
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: ScalingService.scale(screen)
screen: modelData screen: modelData
// Auto-hide properties // Auto-hide properties

View file

@ -7,6 +7,7 @@ import Quickshell.Wayland
import Quickshell.Services.Pam import Quickshell.Services.Pam
import Quickshell.Io import Quickshell.Io
import Quickshell.Widgets import Quickshell.Widgets
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -14,7 +15,7 @@ WlSessionLock {
id: lock id: lock
// Lockscreen is a different beast, needs a capital 'S' in 'Screen' to get the current screen // Lockscreen is a different beast, needs a capital 'S' in 'Screen' to get the current screen
readonly property real scaling: Scaling.scale(Screen) readonly property real scaling: ScalingService.scale(Screen)
property string errorMessage: "" property string errorMessage: ""
property bool authenticating: false property bool authenticating: false
@ -95,7 +96,7 @@ WlSessionLock {
id: lockBgImage id: lockBgImage
anchors.fill: parent anchors.fill: parent
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
source: Wallpapers.currentWallpaper !== "" ? Wallpapers.currentWallpaper : "" source: WallpapersService.currentWallpaper !== "" ? WallpapersService.currentWallpaper : ""
cache: true cache: true
smooth: true smooth: true
mipmap: false mipmap: false

View file

@ -4,6 +4,7 @@ import Quickshell
import Quickshell.Widgets import Quickshell.Widgets
import Quickshell.Wayland import Quickshell.Wayland
import Quickshell.Services.Notifications import Quickshell.Services.Notifications
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -15,7 +16,7 @@ Variants {
id: root id: root
required property ShellScreen modelData required property ShellScreen modelData
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: ScalingService.scale(screen)
screen: modelData screen: modelData
// Access the notification model from the service // Access the notification model from the service

View file

@ -4,6 +4,7 @@ import QtQuick.Controls
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import Quickshell.Services.Notifications import Quickshell.Services.Notifications
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -4,6 +4,7 @@ import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Modules.Settings.Tabs as Tabs import qs.Modules.Settings.Tabs as Tabs
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -13,7 +14,7 @@ NLoader {
// Tabs enumeration, order is NOT relevant // Tabs enumeration, order is NOT relevant
enum Tab { enum Tab {
About, About,
Audio, AudioService,
Bar, Bar,
ColorScheme, ColorScheme,
Display, Display,
@ -119,8 +120,8 @@ NLoader {
"icon": "web_asset", "icon": "web_asset",
"source": barTab "source": barTab
}, { }, {
"id": SettingsPanel.Tab.Audio, "id": SettingsPanel.Tab.AudioService,
"label": "Audio", "label": "AudioService",
"icon": "volume_up", "icon": "volume_up",
"source": audioTab "source": audioTab
}, { }, {

View file

@ -4,15 +4,16 @@ import QtQuick.Effects
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
ColumnLayout { ColumnLayout {
id: root id: root
property string latestVersion: GitHub.latestVersion property string latestVersion: GitHubService.latestVersion
property string currentVersion: "Unknown" // Fallback version property string currentVersion: "Unknown" // Fallback version
property var contributors: GitHub.contributors property var contributors: GitHubService.contributors
spacing: 0 spacing: 0
Layout.fillWidth: true Layout.fillWidth: true

View file

@ -5,18 +5,19 @@ import Quickshell.Services.Pipewire
import qs.Modules.Settings import qs.Modules.Settings
import qs.Widgets import qs.Widgets
import qs.Commons
import qs.Services import qs.Services
ColumnLayout { ColumnLayout {
id: root id: root
property real localVolume: Audio.volume property real localVolume: AudioService.volume
// Connection used to open the pill when volume changes // Connection used to open the pill when volume changes
Connections { Connections {
target: Audio.sink?.audio ? Audio.sink?.audio : null target: AudioService.sink?.audio ? AudioService.sink?.audio : null
function onVolumeChanged() { function onVolumeChanged() {
localVolume = Audio.volume localVolume = AudioService.volume
} }
} }
@ -46,7 +47,7 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
NText { NText {
text: "Audio" text: "AudioService"
font.pointSize: Style.fontSizeXL * scaling font.pointSize: Style.fontSizeXL * scaling
font.weight: Style.fontWeightBold font.weight: Style.fontWeightBold
color: Colors.mOnSurface color: Colors.mOnSurface
@ -90,8 +91,8 @@ ColumnLayout {
running: true running: true
repeat: true repeat: true
onTriggered: { onTriggered: {
if (Math.abs(localVolume - Audio.volume) >= 0.01) { if (Math.abs(localVolume - AudioService.volume) >= 0.01) {
Audio.setVolume(localVolume) AudioService.setVolume(localVolume)
} }
} }
} }
@ -108,7 +109,7 @@ ColumnLayout {
} }
NText { NText {
text: Math.floor(Audio.volume * 100) + "%" text: Math.floor(AudioService.volume * 100) + "%"
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
color: Colors.mOnSurface color: Colors.mOnSurface
} }
@ -122,12 +123,12 @@ ColumnLayout {
Layout.topMargin: Style.marginMedium * scaling Layout.topMargin: Style.marginMedium * scaling
NToggle { NToggle {
label: "Mute Audio" label: "Mute AudioService"
description: "Mute or unmute the default audio output" description: "Mute or unmute the default audio output"
value: Audio.muted value: AudioService.muted
onToggled: function (newValue) { onToggled: function (newValue) {
if (Audio.sink && Audio.sink.audio) { if (AudioService.sink && AudioService.sink.audio) {
Audio.sink.audio.muted = newValue AudioService.sink.audio.muted = newValue
} }
} }
} }
@ -140,13 +141,13 @@ ColumnLayout {
Layout.bottomMargin: Style.marginLarge * scaling Layout.bottomMargin: Style.marginLarge * scaling
} }
// Audio Devices // AudioService Devices
ColumnLayout { ColumnLayout {
spacing: Style.marginLarge * scaling spacing: Style.marginLarge * scaling
Layout.fillWidth: true Layout.fillWidth: true
NText { NText {
text: "Audio Devices" text: "AudioService Devices"
font.pointSize: Style.fontSizeXL * scaling font.pointSize: Style.fontSizeXL * scaling
font.weight: Style.fontWeightBold font.weight: Style.fontWeightBold
color: Colors.mOnSurface color: Colors.mOnSurface
@ -180,12 +181,12 @@ ColumnLayout {
} }
Repeater { Repeater {
model: Audio.sinks model: AudioService.sinks
NRadioButton { NRadioButton {
required property PwNode modelData required property PwNode modelData
ButtonGroup.group: sinks ButtonGroup.group: sinks
checked: Audio.sink?.id === modelData.id checked: AudioService.sink?.id === modelData.id
onClicked: Audio.setAudioSink(modelData) onClicked: AudioService.setAudioSink(modelData)
text: modelData.description text: modelData.description
} }
} }
@ -219,12 +220,12 @@ ColumnLayout {
} }
Repeater { Repeater {
model: Audio.sources model: AudioService.sources
NRadioButton { NRadioButton {
required property PwNode modelData required property PwNode modelData
ButtonGroup.group: sources ButtonGroup.group: sources
checked: Audio.source?.id === modelData.id checked: AudioService.source?.id === modelData.id
onClicked: Audio.setAudioSource(modelData) onClicked: AudioService.setAudioSource(modelData)
text: modelData.description text: modelData.description
} }
} }
@ -238,20 +239,20 @@ ColumnLayout {
Layout.bottomMargin: Style.marginMedium * scaling Layout.bottomMargin: Style.marginMedium * scaling
} }
// Audio Visualizer Category // AudioService Visualizer Category
ColumnLayout { ColumnLayout {
spacing: Style.marginSmall * scaling spacing: Style.marginSmall * scaling
Layout.fillWidth: true Layout.fillWidth: true
NText { NText {
text: "Audio Visualizer" text: "AudioService Visualizer"
font.pointSize: Style.fontSizeXL * scaling font.pointSize: Style.fontSizeXL * scaling
font.weight: Style.fontWeightBold font.weight: Style.fontWeightBold
color: Colors.mOnSurface color: Colors.mOnSurface
Layout.bottomMargin: Style.marginSmall * scaling Layout.bottomMargin: Style.marginSmall * scaling
} }
// Audio Visualizer section // AudioService Visualizer section
NComboBox { NComboBox {
id: audioVisualizerCombo id: audioVisualizerCombo
label: "Visualization Type" label: "Visualization Type"

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
import Quickshell.Io import Quickshell.Io
@ -66,7 +67,7 @@ ColumnLayout {
// When the list of available schemes changes, clear the cache. // When the list of available schemes changes, clear the cache.
// The Repeater below will automatically re-create the FileViews. // The Repeater below will automatically re-create the FileViews.
Connections { Connections {
target: ColorSchemes target: ColorSchemesService
function onSchemesChanged() { function onSchemesChanged() {
schemeColorsCache = {} schemeColorsCache = {}
} }
@ -78,7 +79,7 @@ ColumnLayout {
id: fileLoaders id: fileLoaders
Repeater { Repeater {
model: ColorSchemes.schemes model: ColorSchemesService.schemes
// The delegate is a Component, which correctly wraps the non-visual FileView // The delegate is a Component, which correctly wraps the non-visual FileView
delegate: Item { delegate: Item {
@ -132,7 +133,7 @@ ColumnLayout {
onToggled: function (newValue) { onToggled: function (newValue) {
Settings.data.colorSchemes.useWallpaperColors = newValue Settings.data.colorSchemes.useWallpaperColors = newValue
if (Settings.data.colorSchemes.useWallpaperColors) { if (Settings.data.colorSchemes.useWallpaperColors) {
ColorSchemes.changedWallpaper() ColorSchemesService.changedWallpaper()
} }
} }
} }
@ -177,7 +178,7 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
Repeater { Repeater {
model: ColorSchemes.schemes model: ColorSchemesService.schemes
Rectangle { Rectangle {
id: schemeCard id: schemeCard
@ -197,9 +198,10 @@ ColumnLayout {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
// Disable useWallpaperColors when picking a predefined color scheme // Disable useWallpaperColors when picking a predefined color scheme
// TBC: broken uncheck useWallpaperColors
Settings.data.colorSchemes.useWallpaperColors = false Settings.data.colorSchemes.useWallpaperColors = false
Settings.data.colorSchemes.predefinedScheme = schemePath Settings.data.colorSchemes.predefinedScheme = schemePath
ColorSchemes.applyScheme(schemePath) ColorSchemesService.applyScheme(schemePath)
} }
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor

View file

@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
import Quickshell import Quickshell
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Bluetooth import Quickshell.Bluetooth
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -206,23 +207,23 @@ ColumnLayout {
Layout.bottomMargin: Style.marginLarge * scaling Layout.bottomMargin: Style.marginLarge * scaling
} }
// Audio Settings // AudioService Settings
ColumnLayout { ColumnLayout {
spacing: Style.marginLarge * scaling spacing: Style.marginLarge * scaling
Layout.fillWidth: true Layout.fillWidth: true
NText { NText {
text: "Audio Settings" text: "AudioService Settings"
font.pointSize: Style.fontSizeXL * scaling font.pointSize: Style.fontSizeXL * scaling
font.weight: Style.fontWeightBold font.weight: Style.fontWeightBold
color: Colors.mOnSurface color: Colors.mOnSurface
Layout.bottomMargin: Style.marginSmall * scaling Layout.bottomMargin: Style.marginSmall * scaling
} }
// Audio Source // AudioService Source
NComboBox { NComboBox {
label: "Audio Source" label: "AudioService Source"
description: "Audio source to capture during recording" description: "AudioService source to capture during recording"
model: ListModel { model: ListModel {
ListElement { ListElement {
key: "default_output" key: "default_output"
@ -243,9 +244,9 @@ ColumnLayout {
} }
} }
// Audio Codec // AudioService Codec
NComboBox { NComboBox {
label: "Audio Codec" label: "AudioService Codec"
description: "Opus is recommended for best performance and smallest audio size" description: "Opus is recommended for best performance and smallest audio size"
model: ListModel { model: ListModel {
ListElement { ListElement {

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
import Qt.labs.folderlistmodel import Qt.labs.folderlistmodel
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -48,7 +49,7 @@ Item {
id: currentWallpaperImage id: currentWallpaperImage
anchors.fill: parent anchors.fill: parent
anchors.margins: Style.marginSmall * scaling anchors.margins: Style.marginSmall * scaling
imagePath: Wallpapers.currentWallpaper imagePath: WallpapersService.currentWallpaper
fallbackIcon: "image" fallbackIcon: "image"
borderColor: Colors.mOutline borderColor: Colors.mOutline
borderWidth: Math.max(1, Style.borderThin * scaling) borderWidth: Math.max(1, Style.borderThin * scaling)
@ -96,7 +97,7 @@ Item {
icon: "refresh" icon: "refresh"
tooltipText: "Refresh wallpaper list" tooltipText: "Refresh wallpaper list"
onClicked: { onClicked: {
Wallpapers.loadWallpapers() WallpapersService.loadWallpapers()
} }
Layout.alignment: Qt.AlignTop | Qt.AlignRight Layout.alignment: Qt.AlignTop | Qt.AlignRight
} }
@ -106,14 +107,14 @@ Item {
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: { Layout.preferredHeight: {
return Math.ceil(Wallpapers.wallpaperList.length / wallpaperGridView.columns) * wallpaperGridView.cellHeight return Math.ceil(WallpapersService.wallpaperList.length / wallpaperGridView.columns) * wallpaperGridView.cellHeight
} }
GridView { GridView {
id: wallpaperGridView id: wallpaperGridView
anchors.fill: parent anchors.fill: parent
clip: true clip: true
model: Wallpapers.wallpaperList model: WallpapersService.wallpaperList
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.AutoFlickDirection flickableDirection: Flickable.AutoFlickDirection
@ -134,7 +135,7 @@ Item {
delegate: Rectangle { delegate: Rectangle {
id: wallpaperItem id: wallpaperItem
property string wallpaperPath: modelData property string wallpaperPath: modelData
property bool isSelected: wallpaperPath === Wallpapers.currentWallpaper property bool isSelected: wallpaperPath === WallpapersService.currentWallpaper
width: wallpaperGridView.itemSize width: wallpaperGridView.itemSize
height: Math.floor(wallpaperGridView.itemSize * 0.67) height: Math.floor(wallpaperGridView.itemSize * 0.67)
@ -195,7 +196,7 @@ Item {
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
hoverEnabled: true hoverEnabled: true
onClicked: { onClicked: {
Wallpapers.changeWallpaper(wallpaperPath) WallpapersService.changeWallpaper(wallpaperPath)
} }
} }
} }
@ -208,7 +209,7 @@ Item {
radius: Style.radiusMedium * scaling radius: Style.radiusMedium * scaling
border.color: Colors.mOutline border.color: Colors.mOutline
border.width: Math.max(1, Style.borderThin * scaling) border.width: Math.max(1, Style.borderThin * scaling)
visible: Wallpapers.wallpaperList.length === 0 && !Wallpapers.scanning visible: WallpapersService.wallpaperList.length === 0 && !WallpapersService.scanning
ColumnLayout { ColumnLayout {
anchors.centerIn: parent anchors.centerIn: parent

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import qs.Modules.Audio import qs.Modules.Audio
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -17,7 +18,7 @@ NBox {
// Height can be overridden by parent layout (SidePanel binds it to stats card) // Height can be overridden by parent layout (SidePanel binds it to stats card)
//implicitHeight: content.implicitHeight + Style.marginLarge * 2 * scaling //implicitHeight: content.implicitHeight + Style.marginLarge * 2 * scaling
// Component.onCompleted: { // Component.onCompleted: {
// console.log(MediaPlayer.trackArtUrl) // console.log(MediaService.trackArtUrl)
// } // }
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
@ -58,7 +59,7 @@ NBox {
ColumnLayout { ColumnLayout {
id: main id: main
visible: MediaPlayer.currentPlayer && MediaPlayer.canPlay visible: MediaService.currentPlayer && MediaService.canPlay
spacing: Style.marginMedium * scaling spacing: Style.marginMedium * scaling
// Player selector // Player selector
@ -66,10 +67,10 @@ NBox {
id: playerSelector id: playerSelector
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: Style.barHeight * 0.83 * scaling Layout.preferredHeight: Style.barHeight * 0.83 * scaling
visible: MediaPlayer.getAvailablePlayers().length > 1 visible: MediaService.getAvailablePlayers().length > 1
model: MediaPlayer.getAvailablePlayers() model: MediaService.getAvailablePlayers()
textRole: "identity" textRole: "identity"
currentIndex: MediaPlayer.selectedPlayerIndex currentIndex: MediaService.selectedPlayerIndex
background: Rectangle { background: Rectangle {
visible: false visible: false
@ -145,8 +146,8 @@ NBox {
} }
onActivated: { onActivated: {
MediaPlayer.selectedPlayerIndex = currentIndex MediaService.selectedPlayerIndex = currentIndex
MediaPlayer.updateCurrentPlayer() MediaService.updateCurrentPlayer()
} }
} }
@ -167,11 +168,11 @@ NBox {
NImageRounded { NImageRounded {
id: trackArt id: trackArt
visible: MediaPlayer.trackArtUrl.toString() !== "" visible: MediaService.trackArtUrl.toString() !== ""
anchors.fill: parent anchors.fill: parent
anchors.margins: Style.marginTiny * scaling anchors.margins: Style.marginTiny * scaling
imagePath: MediaPlayer.trackArtUrl imagePath: MediaService.trackArtUrl
fallbackIcon: "music_note" fallbackIcon: "music_note"
borderColor: Colors.mOutline borderColor: Colors.mOutline
borderWidth: Math.max(1, Style.borderThin * scaling) borderWidth: Math.max(1, Style.borderThin * scaling)
@ -196,8 +197,8 @@ NBox {
spacing: Style.marginTiny * scaling spacing: Style.marginTiny * scaling
NText { NText {
visible: MediaPlayer.trackTitle !== "" visible: MediaService.trackTitle !== ""
text: MediaPlayer.trackTitle text: MediaService.trackTitle
font.pointSize: Style.fontSizeMedium * scaling font.pointSize: Style.fontSizeMedium * scaling
font.weight: Style.fontWeightBold font.weight: Style.fontWeightBold
elide: Text.ElideRight elide: Text.ElideRight
@ -207,8 +208,8 @@ NBox {
} }
NText { NText {
visible: MediaPlayer.trackArtist !== "" visible: MediaService.trackArtist !== ""
text: MediaPlayer.trackArtist text: MediaService.trackArtist
color: Colors.mOnSurface color: Colors.mOnSurface
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
elide: Text.ElideRight elide: Text.ElideRight
@ -216,8 +217,8 @@ NBox {
} }
NText { NText {
visible: MediaPlayer.trackAlbum !== "" visible: MediaService.trackAlbum !== ""
text: MediaPlayer.trackAlbum text: MediaService.trackAlbum
color: Colors.mOnSurface color: Colors.mOnSurface
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
elide: Text.ElideRight elide: Text.ElideRight
@ -230,7 +231,7 @@ NBox {
// Progress bar // Progress bar
Rectangle { Rectangle {
id: progressBarBackground id: progressBarBackground
visible: (MediaPlayer.currentPlayer && MediaPlayer.trackLength > 0) visible: (MediaService.currentPlayer && MediaService.trackLength > 0)
width: parent.width width: parent.width
height: 4 * scaling height: 4 * scaling
radius: Style.radiusSmall * scaling radius: Style.radiusSmall * scaling
@ -238,10 +239,10 @@ NBox {
Layout.fillWidth: true Layout.fillWidth: true
property real progressRatio: { property real progressRatio: {
if (!MediaPlayer.currentPlayer || !MediaPlayer.isPlaying || MediaPlayer.trackLength <= 0) { if (!MediaService.currentPlayer || !MediaService.isPlaying || MediaService.trackLength <= 0) {
return 0 return 0
} }
return Math.min(1, MediaPlayer.currentPosition / MediaPlayer.trackLength) return Math.min(1, MediaService.currentPosition / MediaService.trackLength)
} }
Rectangle { Rectangle {
@ -261,7 +262,7 @@ NBox {
// Interactive progress handle // Interactive progress handle
Rectangle { Rectangle {
id: progressHandle id: progressHandle
visible: (MediaPlayer.currentPlayer && MediaPlayer.trackLength > 0) visible: (MediaService.currentPlayer && MediaService.trackLength > 0)
width: 16 * scaling width: 16 * scaling
height: 16 * scaling height: 16 * scaling
radius: width * 0.5 radius: width * 0.5
@ -285,17 +286,17 @@ NBox {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
enabled: MediaPlayer.trackLength > 0 && MediaPlayer.canSeek enabled: MediaService.trackLength > 0 && MediaService.canSeek
onClicked: function (mouse) { onClicked: function (mouse) {
let ratio = mouse.x / width let ratio = mouse.x / width
MediaPlayer.seekByRatio(ratio) MediaService.seekByRatio(ratio)
} }
onPositionChanged: function (mouse) { onPositionChanged: function (mouse) {
if (pressed) { if (pressed) {
let ratio = Math.max(0, Math.min(1, mouse.x / width)) let ratio = Math.max(0, Math.min(1, mouse.x / width))
MediaPlayer.seekByRatio(ratio) MediaService.seekByRatio(ratio)
} }
} }
} }
@ -312,24 +313,24 @@ NBox {
NIconButton { NIconButton {
icon: "skip_previous" icon: "skip_previous"
tooltipText: "Previous Media" tooltipText: "Previous Media"
visible: MediaPlayer.canGoPrevious visible: MediaService.canGoPrevious
onClicked: MediaPlayer.canGoPrevious ? MediaPlayer.previous() : {} onClicked: MediaService.canGoPrevious ? MediaService.previous() : {}
} }
// Play/Pause button // Play/Pause button
NIconButton { NIconButton {
icon: MediaPlayer.isPlaying ? "pause" : "play_arrow" icon: MediaService.isPlaying ? "pause" : "play_arrow"
tooltipText: MediaPlayer.isPlaying ? "Pause" : "Play" tooltipText: MediaService.isPlaying ? "Pause" : "Play"
visible: (MediaPlayer.canPlay || MediaPlayer.canPause) visible: (MediaService.canPlay || MediaService.canPause)
onClicked: (MediaPlayer.canPlay || MediaPlayer.canPause) ? MediaPlayer.playPause() : {} onClicked: (MediaService.canPlay || MediaService.canPause) ? MediaService.playPause() : {}
} }
// Next button // Next button
NIconButton { NIconButton {
icon: "skip_next" icon: "skip_next"
tooltipText: "Next Media" tooltipText: "Next Media"
visible: MediaPlayer.canGoNext visible: MediaService.canGoNext
onClicked: MediaPlayer.canGoNext ? MediaPlayer.next() : {} onClicked: MediaService.canGoNext ? MediaService.next() : {}
} }
} }
} }
@ -341,7 +342,7 @@ NBox {
sourceComponent: LinearSpectrum { sourceComponent: LinearSpectrum {
width: 300 * scaling width: 300 * scaling
height: 80 * scaling height: 80 * scaling
values: Cava.values values: CavaService.values
fillColor: Colors.mOnSurface fillColor: Colors.mOnSurface
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
} }

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Services.UPower import Quickshell.Services.UPower
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -6,6 +6,7 @@ import Quickshell.Io
import Quickshell.Widgets import Quickshell.Widgets
import qs.Modules.Settings import qs.Modules.Settings
import qs.Modules.SidePanel import qs.Modules.SidePanel
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -1,5 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -27,7 +28,7 @@ NBox {
} }
NCircleStat { NCircleStat {
value: SystemStats.cpuUsage value: SystemStatsService.cpuUsage
icon: "speed" icon: "speed"
flat: true flat: true
contentScale: 0.8 contentScale: 0.8
@ -35,7 +36,7 @@ NBox {
height: 68 * scaling height: 68 * scaling
} }
NCircleStat { NCircleStat {
value: SystemStats.cpuTemp value: SystemStatsService.cpuTemp
suffix: "°C" suffix: "°C"
icon: "device_thermostat" icon: "device_thermostat"
flat: true flat: true
@ -44,7 +45,7 @@ NBox {
height: 68 * scaling height: 68 * scaling
} }
NCircleStat { NCircleStat {
value: SystemStats.memoryUsagePer value: SystemStatsService.memoryUsagePer
icon: "memory" icon: "memory"
flat: true flat: true
contentScale: 0.8 contentScale: 0.8
@ -52,7 +53,7 @@ NBox {
height: 68 * scaling height: 68 * scaling
} }
NCircleStat { NCircleStat {
value: SystemStats.diskUsage value: SystemStatsService.diskUsage
icon: "hard_drive" icon: "hard_drive"
flat: true flat: true
contentScale: 0.8 contentScale: 0.8

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import qs.Modules.Settings import qs.Modules.Settings
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -22,10 +23,10 @@ NBox {
// Screen Recorder // Screen Recorder
NIconButton { NIconButton {
icon: "videocam" icon: "videocam"
tooltipText: ScreenRecorder.isRecording ? "Stop Screen Recording" : "Start Screen Recording" tooltipText: ScreenRecorderService.isRecording ? "Stop Screen Recording" : "Start Screen Recording"
showFilled: ScreenRecorder.isRecording showFilled: ScreenRecorderService.isRecording
onClicked: { onClicked: {
ScreenRecorder.toggleRecording() ScreenRecorderService.toggleRecording()
} }
} }

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -8,7 +9,7 @@ import qs.Widgets
NBox { NBox {
id: root id: root
readonly property bool weatherReady: (Location.data.weather !== null) readonly property bool weatherReady: (LocationService.data.weather !== null)
// TBC weatherReady is not turning to false when we reset weather... // TBC weatherReady is not turning to false when we reset weather...
Layout.fillWidth: true Layout.fillWidth: true
@ -26,7 +27,7 @@ NBox {
RowLayout { RowLayout {
spacing: Style.marginSmall * scaling spacing: Style.marginSmall * scaling
NText { NText {
text: weatherReady ? Location.weatherSymbolFromCode(Location.data.weather.current_weather.weathercode) : "" text: weatherReady ? LocationService.weatherSymbolFromCode(LocationService.data.weather.current_weather.weathercode) : ""
font.family: "Material Symbols Outlined" font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeXXL * 1.5 * scaling font.pointSize: Style.fontSizeXXL * 1.5 * scaling
color: Colors.mPrimary color: Colors.mPrimary
@ -51,10 +52,10 @@ NBox {
if (!weatherReady) { if (!weatherReady) {
return "" return ""
} }
var temp = Location.data.weather.current_weather.temperature var temp = LocationService.data.weather.current_weather.temperature
var suffix = "C" var suffix = "C"
if (Settings.data.location.useFahrenheit) { if (Settings.data.location.useFahrenheit) {
temp = Location.celsiusToFahrenheit(temp) temp = LocationService.celsiusToFahrenheit(temp)
var suffix = "F" var suffix = "F"
} }
temp = Math.round(temp) temp = Math.round(temp)
@ -65,9 +66,9 @@ NBox {
} }
NText { NText {
text: weatherReady ? `(${Location.data.weather.timezone_abbreviation})` : "" text: weatherReady ? `(${LocationService.data.weather.timezone_abbreviation})` : ""
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
visible: Location.data.weather visible: LocationService.data.weather
} }
} }
} }
@ -84,27 +85,27 @@ NBox {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
spacing: Style.marginLarge * scaling spacing: Style.marginLarge * scaling
Repeater { Repeater {
model: weatherReady ? Location.data.weather.daily.time : [] model: weatherReady ? LocationService.data.weather.daily.time : []
delegate: ColumnLayout { delegate: ColumnLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
spacing: Style.marginSmall * scaling spacing: Style.marginSmall * scaling
NText { NText {
text: Qt.formatDateTime(new Date(Location.data.weather.daily.time[index]), "ddd") text: Qt.formatDateTime(new Date(LocationService.data.weather.daily.time[index]), "ddd")
color: Colors.mOnSurface color: Colors.mOnSurface
} }
NText { NText {
text: Location.weatherSymbolFromCode(Location.data.weather.daily.weathercode[index]) text: LocationService.weatherSymbolFromCode(LocationService.data.weather.daily.weathercode[index])
font.family: "Material Symbols Outlined" font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeXL * scaling font.pointSize: Style.fontSizeXL * scaling
color: Colors.mPrimary color: Colors.mPrimary
} }
NText { NText {
text: { text: {
var max = Location.data.weather.daily.temperature_2m_max[index] var max = LocationService.data.weather.daily.temperature_2m_max[index]
var min = Location.data.weather.daily.temperature_2m_min[index] var min = LocationService.data.weather.daily.temperature_2m_min[index]
if (Settings.data.location.useFahrenheit) { if (Settings.data.location.useFahrenheit) {
max = Location.celsiusToFahrenheit(max) max = LocationService.celsiusToFahrenheit(max)
min = Location.celsiusToFahrenheit(min) min = LocationService.celsiusToFahrenheit(min)
} }
max = Math.round(max) max = Math.round(max)
min = Math.round(min) min = Math.round(min)

View file

@ -4,6 +4,7 @@ import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import Quickshell.Widgets import Quickshell.Widgets
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
import qs.Modules.LockScreen import qs.Modules.LockScreen
@ -347,9 +348,9 @@ NPanel {
// ---------------------------------- // ----------------------------------
// System functions // System functions
function logout() { function logout() {
if (Workspaces.isNiri) { if (WorkspacesService.isNiri) {
logoutProcessNiri.running = true logoutProcessNiri.running = true
} else if (Workspaces.isHyprland) { } else if (WorkspacesService.isHyprland) {
logoutProcessHyprland.running = true logoutProcessHyprland.running = true
} else { } else {
console.warn("No supported compositor detected for logout") console.warn("No supported compositor detected for logout")

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import qs.Modules.SidePanel.Cards import qs.Modules.SidePanel.Cards
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -53,7 +53,7 @@ Singleton {
function onMutedChanged() { function onMutedChanged() {
root._muted = (sink?.audio.muted ?? true) root._muted = (sink?.audio.muted ?? true)
console.log("[Audio] onMuteChanged:", root._muted) console.log("[AudioService] onMuteChanged:", root._muted)
} }
} }
@ -70,9 +70,9 @@ Singleton {
// Clamp it accordingly // Clamp it accordingly
sink.audio.muted = false sink.audio.muted = false
sink.audio.volume = Math.max(0, Math.min(1, newVolume)) sink.audio.volume = Math.max(0, Math.min(1, newVolume))
//console.log("[Audio] setVolume", sink.audio.volume); //console.log("[AudioService] setVolume", sink.audio.volume);
} else { } else {
console.warn("[Audio] No sink available") console.warn("[AudioService] No sink available")
} }
} }
@ -80,7 +80,7 @@ Singleton {
if (sink?.ready && sink?.audio) { if (sink?.ready && sink?.audio) {
sink.audio.muted = muted sink.audio.muted = muted
} else { } else {
console.warn("[Audio] No sink available") console.warn("[AudioService] No sink available")
} }
} }

View file

@ -37,7 +37,7 @@ Singleton {
Process { Process {
id: process id: process
stdinEnabled: true stdinEnabled: true
running: MediaPlayer.isPlaying running: MediaService.isPlaying
command: ["cava", "-p", "/dev/stdin"] command: ["cava", "-p", "/dev/stdin"]
onExited: { onExited: {
stdinEnabled = true stdinEnabled = true

View file

@ -3,6 +3,7 @@ pragma Singleton
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons
import qs.Services import qs.Services
Singleton { Singleton {

View file

@ -61,7 +61,7 @@ Singleton {
Process { Process {
id: generateColorsProcess id: generateColorsProcess
command: ["matugen", "image", Wallpapers.currentWallpaper, "--config", Quickshell.shellDir + "/Assets/Matugen/matugen.toml"] command: ["matugen", "image", WallpapersService.currentWallpaper, "--config", Quickshell.shellDir + "/Assets/Matugen/matugen.toml"]
workingDirectory: Quickshell.shellDir workingDirectory: Quickshell.shellDir
running: false running: false
stdout: StdioCollector { stdout: StdioCollector {

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons
import qs.Services import qs.Services
pragma Singleton pragma Singleton
@ -10,7 +11,7 @@ Singleton {
property string githubDataFile: Quickshell.env("NOCTALIA_GITHUB_FILE") || (Settings.cacheDir + "github.json") property string githubDataFile: Quickshell.env("NOCTALIA_GITHUB_FILE") || (Settings.cacheDir + "github.json")
property int githubUpdateFrequency: 60 * 60 // 1 hour expressed in seconds property int githubUpdateFrequency: 60 * 60 // 1 hour expressed in seconds
property var data: adapter // Used to access via GitHub.data.xxx.yyy property var data: adapter // Used to access via GitHubService.data.xxx.yyy
property bool isFetchingData: false property bool isFetchingData: false
// Public properties for easy access // Public properties for easy access

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons
import qs.Services import qs.Services
pragma Singleton pragma Singleton
@ -10,7 +11,7 @@ Singleton {
property string locationFile: Quickshell.env("NOCTALIA_WEATHER_FILE") || (Settings.cacheDir + "location.json") property string locationFile: Quickshell.env("NOCTALIA_WEATHER_FILE") || (Settings.cacheDir + "location.json")
property int weatherUpdateFrequency: 30 * 60 // 30 minutes expressed in seconds property int weatherUpdateFrequency: 30 * 60 // 30 minutes expressed in seconds
property var data: adapter // Used to access via Location.data.xxx property var data: adapter // Used to access via LocationService.data.xxx
property bool isFetchingWeather: false property bool isFetchingWeather: false
FileView { FileView {

View file

@ -3,6 +3,7 @@ pragma Singleton
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Services.Mpris import Quickshell.Services.Mpris
import qs.Commons
import qs.Services import qs.Services
Singleton { Singleton {

View file

@ -2,7 +2,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
QtObject { Singleton {
id: root id: root
property var networks: ({}) property var networks: ({})

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons
import qs.Services import qs.Services
import Quickshell.Services.Notifications import Quickshell.Services.Notifications
pragma Singleton pragma Singleton

View file

@ -2,6 +2,7 @@ pragma Singleton
import QtQuick import QtQuick
import Quickshell import Quickshell
import qs.Commons
import qs.Services import qs.Services
Singleton { Singleton {

View file

@ -66,7 +66,7 @@ Singleton {
// Only notify ColorSchemes service if the wallpaper actually changed // Only notify ColorSchemes service if the wallpaper actually changed
if (wallpaperChanged) { if (wallpaperChanged) {
ColorSchemes.changedWallpaper() ColorSchemesService.changedWallpaper()
} }
} }

View file

@ -6,6 +6,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import Quickshell.Hyprland import Quickshell.Hyprland
import qs.Commons
import qs.Services import qs.Services
Singleton { Singleton {
@ -106,14 +107,14 @@ Singleton {
} }
Connections { Connections {
target: Niri target: NiriService
function onWorkspacesChanged() { function onWorkspacesChanged() {
updateNiriWorkspaces() updateNiriWorkspaces()
} }
} }
function updateNiriWorkspaces() { function updateNiriWorkspaces() {
const niriWorkspaces = Niri.workspaces || [] const niriWorkspaces = NiriService.workspaces || []
workspaces.clear() workspaces.clear()
for (var i = 0; i < niriWorkspaces.length; i++) { for (var i = 0; i < niriWorkspaces.length; i++) {
const ws = niriWorkspaces[i] const ws = niriWorkspaces[i]

View file

@ -1,4 +1,6 @@
import QtQuick import QtQuick
import qs.Commons
import qs.Commons
import qs.Services import qs.Services
// Rounded group container using the variant surface color. // Rounded group container using the variant surface color.

View file

@ -1,4 +1,5 @@
import QtQuick import QtQuick
import qs.Commons
import qs.Services import qs.Services
Item { Item {

View file

@ -1,4 +1,5 @@
import QtQuick import QtQuick
import qs.Commons
import qs.Services import qs.Services
// Generic card container // Generic card container

View file

@ -1,4 +1,5 @@
import QtQuick import QtQuick
import qs.Commons
import qs.Services import qs.Services
// Compact circular statistic display used in the SidePanel // Compact circular statistic display used in the SidePanel

View file

@ -1,4 +1,5 @@
import QtQuick import QtQuick
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Widgets import Quickshell.Widgets
import qs.Commons
import qs.Services import qs.Services
Rectangle { Rectangle {

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Widgets import Quickshell.Widgets
import qs.Commons
import qs.Services import qs.Services
Rectangle { Rectangle {

View file

@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Effects import QtQuick.Effects
import Quickshell import Quickshell
import Quickshell.Widgets import Quickshell.Widgets
import qs.Commons
import qs.Services import qs.Services
Rectangle { Rectangle {

View file

@ -1,12 +1,13 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons
import qs.Services import qs.Services
PanelWindow { PanelWindow {
id: root id: root
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: ScalingService.scale(screen)
property bool showOverlay: Settings.data.general.dimDesktop property bool showOverlay: Settings.data.general.dimDesktop
property int topMargin: Style.barHeight * scaling property int topMargin: Style.barHeight * scaling
@ -19,12 +20,12 @@ PanelWindow {
} }
function show() { function show() {
// Ensure only one panel is visible at a time using PanelManager as ephemeral storage // Ensure only one panel is visible at a time using PanelService as ephemeral storage
try { try {
if (PanelManager.openedPanel && PanelManager.openedPanel !== root && PanelManager.openedPanel.hide) { if (PanelService.openedPanel && PanelService.openedPanel !== root && PanelService.openedPanel.hide) {
PanelManager.openedPanel.hide() PanelService.openedPanel.hide()
} }
PanelManager.openedPanel = root PanelService.openedPanel = root
} catch (e) { } catch (e) {
// ignore // ignore

View file

@ -1,5 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import qs.Commons
import qs.Services import qs.Services
Item { Item {

View file

@ -1,5 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Effects import QtQuick.Effects
import qs.Commons
import qs.Services import qs.Services
Slider { Slider {

View file

@ -1,4 +1,5 @@
import QtQuick import QtQuick
import qs.Commons
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons
import qs.Services import qs.Services
Item { Item {

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons
import qs.Services import qs.Services
RowLayout { RowLayout {

View file

@ -1,4 +1,5 @@
import QtQuick import QtQuick
import qs.Commons
import qs.Services import qs.Services
Window { Window {

View file

@ -4,6 +4,7 @@ import Quickshell
import Quickshell.Io import Quickshell.Io
import Quickshell.Services.Pipewire import Quickshell.Services.Pipewire
import Quickshell.Widgets import Quickshell.Widgets
import qs.Commons
import qs.Modules.AppLauncher import qs.Modules.AppLauncher
import qs.Modules.Background import qs.Modules.Background
import qs.Modules.Bar import qs.Modules.Bar
@ -62,6 +63,6 @@ ShellRoot {
Component.onCompleted: { Component.onCompleted: {
// Ensure our singleton is created as soon as possible so we start fetching weather asap // Ensure our singleton is created as soon as possible so we start fetching weather asap
Location.init() LocationService.init()
} }
} }