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 Quickshell
import Quickshell.Io
import qs.Commons
import qs.Services
// --------------------------------

View file

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

View file

@ -1,6 +1,7 @@
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Services
pragma Singleton
@ -53,7 +54,7 @@ Singleton {
// Only set wallpaper on initial load, not on reloads
if (isInitialLoad && 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
})
@ -121,9 +122,9 @@ Singleton {
property int randomInterval: 300
property JsonObject swww
onDirectoryChanged: Wallpapers.loadWallpapers()
onIsRandomChanged: Wallpapers.toggleRandomWallpaper()
onRandomIntervalChanged: Wallpapers.restartRandomWallpaperTimer()
onDirectoryChanged: WallpapersService.loadWallpapers()
onIsRandomChanged: WallpapersService.toggleRandomWallpaper()
onRandomIntervalChanged: WallpapersService.restartRandomWallpaperTimer()
swww: JsonObject {
property bool enabled: false

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,6 +2,7 @@ import QtQuick
import Quickshell
import Quickshell.Services.Pipewire
import qs.Modules.Settings
import qs.Commons
import qs.Services
import qs.Widgets
@ -15,15 +16,15 @@ Item {
property bool firstVolumeReceived: false
function getIcon() {
if (Audio.muted) {
if (AudioService.muted) {
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
Connections {
target: Audio.sink?.audio ? Audio.sink?.audio : null
target: AudioService.sink?.audio ? AudioService.sink?.audio : null
function onVolumeChanged() {
// console.log("[Bar:Volume] onVolumeChanged")
if (!firstVolumeReceived) {
@ -51,19 +52,19 @@ Item {
iconCircleColor: Colors.mPrimary
collapsedIconColor: Colors.mOnSurface
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(
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) {
if (angle > 0) {
Audio.increaseVolume()
AudioService.increaseVolume()
} else if (angle < 0) {
Audio.decreaseVolume()
AudioService.decreaseVolume()
}
}
onClicked: {
settingsPanel.requestedTab = SettingsPanel.Tab.Audio
settingsPanel.requestedTab = SettingsPanel.Tab.AudioService
settingsPanel.isLoaded = true
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -7,6 +7,7 @@ import Quickshell.Wayland
import Quickshell.Services.Pam
import Quickshell.Io
import Quickshell.Widgets
import qs.Commons
import qs.Services
import qs.Widgets
@ -14,7 +15,7 @@ WlSessionLock {
id: lock
// 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 bool authenticating: false
@ -95,7 +96,7 @@ WlSessionLock {
id: lockBgImage
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
source: Wallpapers.currentWallpaper !== "" ? Wallpapers.currentWallpaper : ""
source: WallpapersService.currentWallpaper !== "" ? WallpapersService.currentWallpaper : ""
cache: true
smooth: true
mipmap: false

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import qs.Commons
import qs.Services
import qs.Widgets
@ -8,7 +9,7 @@ import qs.Widgets
NBox {
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...
Layout.fillWidth: true
@ -26,7 +27,7 @@ NBox {
RowLayout {
spacing: Style.marginSmall * scaling
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.pointSize: Style.fontSizeXXL * 1.5 * scaling
color: Colors.mPrimary
@ -51,10 +52,10 @@ NBox {
if (!weatherReady) {
return ""
}
var temp = Location.data.weather.current_weather.temperature
var temp = LocationService.data.weather.current_weather.temperature
var suffix = "C"
if (Settings.data.location.useFahrenheit) {
temp = Location.celsiusToFahrenheit(temp)
temp = LocationService.celsiusToFahrenheit(temp)
var suffix = "F"
}
temp = Math.round(temp)
@ -65,9 +66,9 @@ NBox {
}
NText {
text: weatherReady ? `(${Location.data.weather.timezone_abbreviation})` : ""
text: weatherReady ? `(${LocationService.data.weather.timezone_abbreviation})` : ""
font.pointSize: Style.fontSizeSmall * scaling
visible: Location.data.weather
visible: LocationService.data.weather
}
}
}
@ -84,27 +85,27 @@ NBox {
Layout.alignment: Qt.AlignHCenter
spacing: Style.marginLarge * scaling
Repeater {
model: weatherReady ? Location.data.weather.daily.time : []
model: weatherReady ? LocationService.data.weather.daily.time : []
delegate: ColumnLayout {
Layout.alignment: Qt.AlignHCenter
spacing: Style.marginSmall * scaling
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
}
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.pointSize: Style.fontSizeXL * scaling
color: Colors.mPrimary
}
NText {
text: {
var max = Location.data.weather.daily.temperature_2m_max[index]
var min = Location.data.weather.daily.temperature_2m_min[index]
var max = LocationService.data.weather.daily.temperature_2m_max[index]
var min = LocationService.data.weather.daily.temperature_2m_min[index]
if (Settings.data.location.useFahrenheit) {
max = Location.celsiusToFahrenheit(max)
min = Location.celsiusToFahrenheit(min)
max = LocationService.celsiusToFahrenheit(max)
min = LocationService.celsiusToFahrenheit(min)
}
max = Math.round(max)
min = Math.round(min)

View file

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

View file

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

View file

@ -53,7 +53,7 @@ Singleton {
function onMutedChanged() {
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
sink.audio.muted = false
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 {
console.warn("[Audio] No sink available")
console.warn("[AudioService] No sink available")
}
}
@ -80,7 +80,7 @@ Singleton {
if (sink?.ready && sink?.audio) {
sink.audio.muted = muted
} else {
console.warn("[Audio] No sink available")
console.warn("[AudioService] No sink available")
}
}

View file

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

View file

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

View file

@ -61,7 +61,7 @@ Singleton {
Process {
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
running: false
stdout: StdioCollector {

View file

@ -1,6 +1,7 @@
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Services
pragma Singleton
@ -10,7 +11,7 @@ Singleton {
property string githubDataFile: Quickshell.env("NOCTALIA_GITHUB_FILE") || (Settings.cacheDir + "github.json")
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
// Public properties for easy access

View file

@ -1,6 +1,7 @@
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Services
pragma Singleton
@ -10,7 +11,7 @@ Singleton {
property string locationFile: Quickshell.env("NOCTALIA_WEATHER_FILE") || (Settings.cacheDir + "location.json")
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
FileView {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,12 +1,13 @@
import QtQuick
import Quickshell
import Quickshell.Wayland
import qs.Commons
import qs.Services
PanelWindow {
id: root
readonly property real scaling: Scaling.scale(screen)
readonly property real scaling: ScalingService.scale(screen)
property bool showOverlay: Settings.data.general.dimDesktop
property int topMargin: Style.barHeight * scaling
@ -19,12 +20,12 @@ PanelWindow {
}
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 {
if (PanelManager.openedPanel && PanelManager.openedPanel !== root && PanelManager.openedPanel.hide) {
PanelManager.openedPanel.hide()
if (PanelService.openedPanel && PanelService.openedPanel !== root && PanelService.openedPanel.hide) {
PanelService.openedPanel.hide()
}
PanelManager.openedPanel = root
PanelService.openedPanel = root
} catch (e) {
// ignore

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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