diff --git a/Assets/Matugen/Matugen.qml b/Assets/Matugen/Matugen.qml index 7f662dc..992740a 100644 --- a/Assets/Matugen/Matugen.qml +++ b/Assets/Matugen/Matugen.qml @@ -51,22 +51,19 @@ Singleton { lines.push("\n[templates.ghostty]") lines.push('input_path = "' + Quickshell.shellDir + '/Assets/Matugen/templates/ghostty.conf"') lines.push('output_path = "~/.config/ghostty/themes/noctalia"') - lines.push( - "post_hook = \"grep -q '^theme *= *' ~/.config/ghostty/config; and sed -i 's/^theme *= *.*/theme = noctalia/' ~/.config/ghostty/config; or echo 'theme = noctalia' >> ~/.config/ghostty/config\"") + lines.push("post_hook = \"grep -q '^theme *= *' ~/.config/ghostty/config; and sed -i 's/^theme *= *.*/theme = noctalia/' ~/.config/ghostty/config; or echo 'theme = noctalia' >> ~/.config/ghostty/config\"") } if (Settings.data.matugen.foot) { lines.push("\n[templates.foot]") lines.push('input_path = "' + Quickshell.shellDir + '/Assets/Matugen/templates/foot.conf"') lines.push('output_path = "~/.config/foot/themes/noctalia"') - lines.push( - 'post_hook = "sed -i /themes/d ~/.config/foot/foot.ini && echo include=~/.config/foot/themes/noctalia >> ~/.config/foot/foot.ini"') + lines.push('post_hook = "sed -i /themes/d ~/.config/foot/foot.ini && echo include=~/.config/foot/themes/noctalia >> ~/.config/foot/foot.ini"') } if (Settings.data.matugen.fuzzel) { lines.push("\n[templates.fuzzel]") lines.push('input_path = "' + Quickshell.shellDir + '/Assets/Matugen/templates/fuzzel.conf"') lines.push('output_path = "~/.config/fuzzel/themes/noctalia"') - lines.push( - 'post_hook = "sed -i /themes/d ~/.config/fuzzel/fuzzel.ini && echo include=~/.config/fuzzel/themes/noctalia >> ~/.config/fuzzel/fuzzel.ini"') + lines.push('post_hook = "sed -i /themes/d ~/.config/fuzzel/fuzzel.ini && echo include=~/.config/fuzzel/themes/noctalia >> ~/.config/fuzzel/fuzzel.ini"') } if (Settings.data.matugen.vesktop) { lines.push("\n[templates.vesktop]") diff --git a/Bin/qmlfmt.sh b/Bin/qmlfmt.sh index 2af1996..a7c6b54 100755 --- a/Bin/qmlfmt.sh +++ b/Bin/qmlfmt.sh @@ -4,4 +4,4 @@ # Can be installed from AUR "qmlfmt-git" # Requires qt6-5compat -find . -name "*.qml" -print -exec qmlfmt -e -b 120 -t 2 -i 2 -w {} \; +find . -name "*.qml" -print -exec qmlfmt -e -b 360 -t 2 -i 2 -w {} \; diff --git a/Commons/AppIcons.qml b/Commons/AppIcons.qml index 2a9aee1..aa8c4ae 100644 --- a/Commons/AppIcons.qml +++ b/Commons/AppIcons.qml @@ -34,8 +34,7 @@ Singleton { try { if (typeof DesktopEntries === 'undefined' || !DesktopEntries.byId) return iconFromName(fallback, fallback) - const entry = (DesktopEntries.heuristicLookup) ? DesktopEntries.heuristicLookup( - appId) : DesktopEntries.byId(appId) + const entry = (DesktopEntries.heuristicLookup) ? DesktopEntries.heuristicLookup(appId) : DesktopEntries.byId(appId) const name = entry && entry.icon ? entry.icon : "" return iconFromName(name || fallback, fallback) } catch (e) { diff --git a/Commons/Settings.qml b/Commons/Settings.qml index eb124bf..567435d 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -13,11 +13,8 @@ Singleton { // Default config directory: ~/.config/noctalia // Default cache directory: ~/.cache/noctalia property string shellName: "noctalia" - property string configDir: Quickshell.env("NOCTALIA_CONFIG_DIR") || (Quickshell.env("XDG_CONFIG_HOME") - || Quickshell.env( - "HOME") + "/.config") + "/" + shellName + "/" - property string cacheDir: Quickshell.env("NOCTALIA_CACHE_DIR") || (Quickshell.env("XDG_CACHE_HOME") || Quickshell.env( - "HOME") + "/.cache") + "/" + shellName + "/" + property string configDir: Quickshell.env("NOCTALIA_CONFIG_DIR") || (Quickshell.env("XDG_CONFIG_HOME") || Quickshell.env("HOME") + "/.config") + "/" + shellName + "/" + property string cacheDir: Quickshell.env("NOCTALIA_CACHE_DIR") || (Quickshell.env("XDG_CACHE_HOME") || Quickshell.env("HOME") + "/.cache") + "/" + shellName + "/" property string cacheDirImages: cacheDir + "images/" property string settingsFile: Quickshell.env("NOCTALIA_SETTINGS_FILE") || (configDir + "settings.json") @@ -58,8 +55,7 @@ Singleton { } } if (!hasValidBarMonitor) { - Logger.warn("Settings", - "No configured bar monitors found on system, clearing bar monitor list to show on all screens") + Logger.warn("Settings", "No configured bar monitors found on system, clearing bar monitor list to show on all screens") adapter.bar.monitors = [] } else { @@ -138,8 +134,7 @@ Singleton { widget.showIcon = widget.showIcon !== undefined ? widget.showIcon : adapter.bar.showActiveWindowIcon break case "Battery": - widget.alwaysShowPercentage = widget.alwaysShowPercentage - !== undefined ? widget.alwaysShowPercentage : adapter.bar.alwaysShowBatteryPercentage + widget.alwaysShowPercentage = widget.alwaysShowPercentage !== undefined ? widget.alwaysShowPercentage : adapter.bar.alwaysShowBatteryPercentage break case "Clock": widget.use12HourClock = widget.use12HourClock !== undefined ? widget.use12HourClock : adapter.location.use12HourClock diff --git a/Modules/Background/Background.qml b/Modules/Background/Background.qml index 61d4fa4..7f588e7 100644 --- a/Modules/Background/Background.qml +++ b/Modules/Background/Background.qml @@ -43,9 +43,7 @@ Variants { // Fillmode default is "crop" property real fillMode: 1.0 - property vector4d fillColor: Qt.vector4d(Settings.data.wallpaper.fillColor.r, - Settings.data.wallpaper.fillColor.g, - Settings.data.wallpaper.fillColor.b, 1.0) + property vector4d fillColor: Qt.vector4d(Settings.data.wallpaper.fillColor.r, Settings.data.wallpaper.fillColor.g, Settings.data.wallpaper.fillColor.b, 1.0) // On startup assign wallpaper immediately Component.onCompleted: { @@ -229,8 +227,7 @@ Variants { from: 0.0 to: 1.0 // The stripes shader feels faster visually, we make it a bit slower here. - duration: transitionType == "stripes" ? Settings.data.wallpaper.transitionDuration - * 1.6 : Settings.data.wallpaper.transitionDuration + duration: transitionType == "stripes" ? Settings.data.wallpaper.transitionDuration * 1.6 : Settings.data.wallpaper.transitionDuration easing.type: Easing.InOutCubic onFinished: { // Swap images after transition completes diff --git a/Modules/Background/Overview.qml b/Modules/Background/Overview.qml index b971ebe..39e00cf 100644 --- a/Modules/Background/Overview.qml +++ b/Modules/Background/Overview.qml @@ -68,9 +68,7 @@ Variants { // Make the overview darker Rectangle { anchors.fill: parent - color: Settings.data.colorSchemes.darkMode ? Qt.alpha(Color.mSurface, - Style.opacityMedium) : Qt.alpha(Color.mOnSurface, - Style.opacityMedium) + color: Settings.data.colorSchemes.darkMode ? Qt.alpha(Color.mSurface, Style.opacityMedium) : Qt.alpha(Color.mOnSurface, Style.opacityMedium) } } } diff --git a/Modules/Background/ScreenCorners.qml b/Modules/Background/ScreenCorners.qml index 4d89156..51aed9c 100644 --- a/Modules/Background/ScreenCorners.qml +++ b/Modules/Background/ScreenCorners.qml @@ -46,12 +46,8 @@ Loader { } margins { - top: ((modelData && Settings.data.bar.monitors.includes(modelData.name)) - || (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "top" - && Settings.data.bar.backgroundOpacity > 0 ? Math.round(Style.barHeight * scaling) : 0 - bottom: ((modelData && Settings.data.bar.monitors.includes(modelData.name)) - || (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "bottom" - && Settings.data.bar.backgroundOpacity > 0 ? Math.round(Style.barHeight * scaling) : 0 + top: ((modelData && Settings.data.bar.monitors.includes(modelData.name)) || (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "top" && Settings.data.bar.backgroundOpacity > 0 ? Math.round(Style.barHeight * scaling) : 0 + bottom: ((modelData && Settings.data.bar.monitors.includes(modelData.name)) || (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "bottom" && Settings.data.bar.backgroundOpacity > 0 ? Math.round(Style.barHeight * scaling) : 0 } mask: Region {} diff --git a/Modules/Bar/Bar.qml b/Modules/Bar/Bar.qml index ad783af..b2e6850 100644 --- a/Modules/Bar/Bar.qml +++ b/Modules/Bar/Bar.qml @@ -27,8 +27,7 @@ Variants { } } - active: Settings.isLoaded && modelData && modelData.name ? (Settings.data.bar.monitors.includes(modelData.name) - || (Settings.data.bar.monitors.length === 0)) : false + active: Settings.isLoaded && modelData && modelData.name ? (Settings.data.bar.monitors.includes(modelData.name) || (Settings.data.bar.monitors.length === 0)) : false sourceComponent: PanelWindow { screen: modelData || null diff --git a/Modules/Bar/Extras/TrayMenu.qml b/Modules/Bar/Extras/TrayMenu.qml index c1582ec..f6120a5 100644 --- a/Modules/Bar/Extras/TrayMenu.qml +++ b/Modules/Bar/Extras/TrayMenu.qml @@ -31,8 +31,7 @@ PopupWindow { implicitWidth: menuWidth * scaling // Use the content height of the Flickable for implicit height - implicitHeight: Math.min(screen ? screen.height * 0.9 : Screen.height * 0.9, - flickable.contentHeight + (Style.marginS * 2 * scaling)) + implicitHeight: Math.min(screen ? screen.height * 0.9 : Screen.height * 0.9, flickable.contentHeight + (Style.marginS * 2 * scaling)) visible: false color: Color.transparent anchor.item: anchorItem @@ -159,8 +158,7 @@ PopupWindow { NText { id: text Layout.fillWidth: true - color: (modelData?.enabled - ?? true) ? (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface) : Color.mOnSurfaceVariant + color: (modelData?.enabled ?? true) ? (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface) : Color.mOnSurfaceVariant text: modelData?.text !== "" ? modelData?.text.replace(/[\n\r]+/g, ' ') : "..." font.pointSize: Style.fontSizeS * scaling verticalAlignment: Text.AlignVCenter diff --git a/Modules/Bar/Widgets/Battery.qml b/Modules/Bar/Widgets/Battery.qml index a718868..6c87416 100644 --- a/Modules/Bar/Widgets/Battery.qml +++ b/Modules/Bar/Widgets/Battery.qml @@ -30,10 +30,8 @@ Item { } // Resolve settings: try user settings or defaults from BarWidgetRegistry - readonly property bool alwaysShowPercentage: widgetSettings.alwaysShowPercentage - !== undefined ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage - readonly property real warningThreshold: widgetSettings.warningThreshold - !== undefined ? widgetSettings.warningThreshold : widgetMetadata.warningThreshold + readonly property bool alwaysShowPercentage: widgetSettings.alwaysShowPercentage !== undefined ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage + readonly property real warningThreshold: widgetSettings.warningThreshold !== undefined ? widgetSettings.warningThreshold : widgetMetadata.warningThreshold // Test mode readonly property bool testMode: false @@ -42,8 +40,7 @@ Item { // Main properties readonly property var battery: UPower.displayDevice - readonly property bool isReady: testMode ? true : (battery && battery.ready && battery.isLaptopBattery - && battery.isPresent) + readonly property bool isReady: testMode ? true : (battery && battery.ready && battery.isLaptopBattery && battery.isPresent) readonly property real percent: testMode ? testPercent : (isReady ? (battery.percentage * 100) : 0) readonly property bool charging: testMode ? testCharging : (isReady ? battery.state === UPowerDeviceState.Charging : false) property bool hasNotifiedLowBattery: false @@ -88,8 +85,7 @@ Item { id: pill rightOpen: BarWidgetRegistry.getNPillDirection(root) - icon: testMode ? BatteryService.getIcon(testPercent, testCharging, true) : BatteryService.getIcon(percent, - charging, isReady) + icon: testMode ? BatteryService.getIcon(testPercent, testCharging, true) : BatteryService.getIcon(percent, charging, isReady) text: (isReady || testMode) ? Math.round(percent) + "%" : "-" autoHide: false forceOpen: isReady && (testMode || battery.isLaptopBattery) && alwaysShowPercentage @@ -112,8 +108,7 @@ Item { if (battery.changeRate !== undefined) { const rate = battery.changeRate if (rate > 0) { - lines.push(charging ? "Charging rate: " + rate.toFixed(2) + " W." : "Discharging rate: " + rate.toFixed( - 2) + " W.") + lines.push(charging ? "Charging rate: " + rate.toFixed(2) + " W." : "Discharging rate: " + rate.toFixed(2) + " W.") } else if (rate < 0) { lines.push("Discharging rate: " + Math.abs(rate).toFixed(2) + " W.") } else { diff --git a/Modules/Bar/Widgets/Brightness.qml b/Modules/Bar/Widgets/Brightness.qml index 9a81997..c436237 100644 --- a/Modules/Bar/Widgets/Brightness.qml +++ b/Modules/Bar/Widgets/Brightness.qml @@ -28,8 +28,7 @@ Item { return {} } - readonly property bool userAlwaysShowPercentage: (widgetSettings.alwaysShowPercentage - !== undefined) ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage + readonly property bool userAlwaysShowPercentage: (widgetSettings.alwaysShowPercentage !== undefined) ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage // Used to avoid opening the pill on Quickshell startup property bool firstBrightnessReceived: false @@ -88,8 +87,7 @@ Item { var monitor = getMonitor() if (!monitor) return "" - return "Brightness: " + Math.round(monitor.brightness * 100) + "%\nMethod: " + monitor.method - + "\nLeft click for advanced settings.\nScroll up/down to change brightness." + return "Brightness: " + Math.round(monitor.brightness * 100) + "%\nMethod: " + monitor.method + "\nLeft click for advanced settings.\nScroll up/down to change brightness." } onWheel: function (angle) { diff --git a/Modules/Bar/Widgets/Clock.qml b/Modules/Bar/Widgets/Clock.qml index fd37ce0..56e786d 100644 --- a/Modules/Bar/Widgets/Clock.qml +++ b/Modules/Bar/Widgets/Clock.qml @@ -30,10 +30,8 @@ Rectangle { // Resolve settings: try user settings or defaults from BarWidgetRegistry readonly property bool use12h: widgetSettings.use12HourClock !== undefined ? widgetSettings.use12HourClock : widgetMetadata.use12HourClock - readonly property bool reverseDayMonth: widgetSettings.reverseDayMonth - !== undefined ? widgetSettings.reverseDayMonth : widgetMetadata.reverseDayMonth - readonly property string displayFormat: widgetSettings.displayFormat - !== undefined ? widgetSettings.displayFormat : widgetMetadata.displayFormat + readonly property bool reverseDayMonth: widgetSettings.reverseDayMonth !== undefined ? widgetSettings.reverseDayMonth : widgetMetadata.reverseDayMonth + readonly property string displayFormat: widgetSettings.displayFormat !== undefined ? widgetSettings.displayFormat : widgetMetadata.displayFormat implicitWidth: Math.round(layout.implicitWidth + Style.marginM * 2 * scaling) implicitHeight: Math.round(Style.capsuleHeight * scaling) diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index ae68eff..79f8393 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -30,12 +30,9 @@ RowLayout { return {} } - readonly property bool showAlbumArt: (widgetSettings.showAlbumArt - !== undefined) ? widgetSettings.showAlbumArt : widgetMetadata.showAlbumArt - readonly property bool showVisualizer: (widgetSettings.showVisualizer - !== undefined) ? widgetSettings.showVisualizer : widgetMetadata.showVisualizer - readonly property string visualizerType: (widgetSettings.visualizerType !== undefined && widgetSettings.visualizerType - !== "") ? widgetSettings.visualizerType : widgetMetadata.visualizerType + readonly property bool showAlbumArt: (widgetSettings.showAlbumArt !== undefined) ? widgetSettings.showAlbumArt : widgetMetadata.showAlbumArt + readonly property bool showVisualizer: (widgetSettings.showVisualizer !== undefined) ? widgetSettings.showVisualizer : widgetMetadata.showVisualizer + readonly property string visualizerType: (widgetSettings.visualizerType !== undefined && widgetSettings.visualizerType !== "") ? widgetSettings.visualizerType : widgetMetadata.visualizerType // 6% of total width readonly property real minWidth: Math.max(1, screen.width * 0.06) diff --git a/Modules/Bar/Widgets/Microphone.qml b/Modules/Bar/Widgets/Microphone.qml index fe671f9..747c3a3 100644 --- a/Modules/Bar/Widgets/Microphone.qml +++ b/Modules/Bar/Widgets/Microphone.qml @@ -30,8 +30,7 @@ Item { return {} } - readonly property bool alwaysShowPercentage: (widgetSettings.alwaysShowPercentage - !== undefined) ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage + readonly property bool alwaysShowPercentage: (widgetSettings.alwaysShowPercentage !== undefined) ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage // Used to avoid opening the pill on Quickshell startup property bool firstInputVolumeReceived: false @@ -94,8 +93,7 @@ Item { autoHide: false // Important to be false so we can hover as long as we want text: Math.floor(AudioService.inputVolume * 100) + "%" forceOpen: alwaysShowPercentage - tooltipText: "Microphone: " + Math.round(AudioService.inputVolume * 100) - + "%\nLeft click for advanced settings.\nScroll up/down to change volume.\nRight click to toggle mute." + tooltipText: "Microphone: " + Math.round(AudioService.inputVolume * 100) + "%\nLeft click for advanced settings.\nScroll up/down to change volume.\nRight click to toggle mute." onWheel: function (delta) { wheelAccumulator += delta diff --git a/Modules/Bar/Widgets/NotificationHistory.qml b/Modules/Bar/Widgets/NotificationHistory.qml index 3737242..3021b47 100644 --- a/Modules/Bar/Widgets/NotificationHistory.qml +++ b/Modules/Bar/Widgets/NotificationHistory.qml @@ -29,10 +29,8 @@ NIconButton { } return {} } - readonly property bool showUnreadBadge: (widgetSettings.showUnreadBadge - !== undefined) ? widgetSettings.showUnreadBadge : widgetMetadata.showUnreadBadge - readonly property bool hideWhenZero: (widgetSettings.hideWhenZero - !== undefined) ? widgetSettings.hideWhenZero : widgetMetadata.hideWhenZero + readonly property bool showUnreadBadge: (widgetSettings.showUnreadBadge !== undefined) ? widgetSettings.showUnreadBadge : widgetMetadata.showUnreadBadge + readonly property bool hideWhenZero: (widgetSettings.hideWhenZero !== undefined) ? widgetSettings.hideWhenZero : widgetMetadata.hideWhenZero function lastSeenTs() { return Settings.data.notifications?.lastSeenTs || 0 diff --git a/Modules/Bar/Widgets/SidePanelToggle.qml b/Modules/Bar/Widgets/SidePanelToggle.qml index 80855cf..af94545 100644 --- a/Modules/Bar/Widgets/SidePanelToggle.qml +++ b/Modules/Bar/Widgets/SidePanelToggle.qml @@ -29,8 +29,7 @@ NIconButton { return {} } - readonly property bool useDistroLogo: (widgetSettings.useDistroLogo - !== undefined) ? widgetSettings.useDistroLogo : widgetMetadata.useDistroLogo + readonly property bool useDistroLogo: (widgetSettings.useDistroLogo !== undefined) ? widgetSettings.useDistroLogo : widgetMetadata.useDistroLogo icon: useDistroLogo ? "" : "noctalia" tooltipText: "Open side panel." diff --git a/Modules/Bar/Widgets/SystemMonitor.qml b/Modules/Bar/Widgets/SystemMonitor.qml index 9141858..e902e75 100644 --- a/Modules/Bar/Widgets/SystemMonitor.qml +++ b/Modules/Bar/Widgets/SystemMonitor.qml @@ -28,17 +28,12 @@ RowLayout { return {} } - readonly property bool showCpuUsage: (widgetSettings.showCpuUsage - !== undefined) ? widgetSettings.showCpuUsage : widgetMetadata.showCpuUsage + readonly property bool showCpuUsage: (widgetSettings.showCpuUsage !== undefined) ? widgetSettings.showCpuUsage : widgetMetadata.showCpuUsage readonly property bool showCpuTemp: (widgetSettings.showCpuTemp !== undefined) ? widgetSettings.showCpuTemp : widgetMetadata.showCpuTemp - readonly property bool showMemoryUsage: (widgetSettings.showMemoryUsage - !== undefined) ? widgetSettings.showMemoryUsage : widgetMetadata.showMemoryUsage - readonly property bool showMemoryAsPercent: (widgetSettings.showMemoryAsPercent - !== undefined) ? widgetSettings.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent - readonly property bool showNetworkStats: (widgetSettings.showNetworkStats - !== undefined) ? widgetSettings.showNetworkStats : widgetMetadata.showNetworkStats - readonly property bool showDiskUsage: (widgetSettings.showDiskUsage - !== undefined) ? widgetSettings.showDiskUsage : widgetMetadata.showDiskUsage + readonly property bool showMemoryUsage: (widgetSettings.showMemoryUsage !== undefined) ? widgetSettings.showMemoryUsage : widgetMetadata.showMemoryUsage + readonly property bool showMemoryAsPercent: (widgetSettings.showMemoryAsPercent !== undefined) ? widgetSettings.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent + readonly property bool showNetworkStats: (widgetSettings.showNetworkStats !== undefined) ? widgetSettings.showNetworkStats : widgetMetadata.showNetworkStats + readonly property bool showDiskUsage: (widgetSettings.showDiskUsage !== undefined) ? widgetSettings.showDiskUsage : widgetMetadata.showDiskUsage Layout.alignment: Qt.AlignVCenter spacing: Style.marginS * scaling diff --git a/Modules/Bar/Widgets/Volume.qml b/Modules/Bar/Widgets/Volume.qml index 7b08046..2dfa42f 100644 --- a/Modules/Bar/Widgets/Volume.qml +++ b/Modules/Bar/Widgets/Volume.qml @@ -30,8 +30,7 @@ Item { return {} } - readonly property bool alwaysShowPercentage: (widgetSettings.alwaysShowPercentage - !== undefined) ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage + readonly property bool alwaysShowPercentage: (widgetSettings.alwaysShowPercentage !== undefined) ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage // Used to avoid opening the pill on Quickshell startup property bool firstVolumeReceived: false @@ -79,8 +78,7 @@ Item { autoHide: false // Important to be false so we can hover as long as we want text: Math.floor(AudioService.volume * 100) + "%" forceOpen: alwaysShowPercentage - tooltipText: "Volume: " + Math.round(AudioService.volume * 100) - + "%\nLeft click for advanced settings.\nScroll up/down to change volume.\nRight click to toggle mute." + tooltipText: "Volume: " + Math.round(AudioService.volume * 100) + "%\nLeft click for advanced settings.\nScroll up/down to change volume.\nRight click to toggle mute." onWheel: function (delta) { wheelAccumulator += delta diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index ec1df4f..562994c 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -32,8 +32,7 @@ Item { } readonly property string labelMode: (widgetSettings.labelMode !== undefined) ? widgetSettings.labelMode : widgetMetadata.labelMode - readonly property bool hideUnoccupied: (widgetSettings.hideUnoccupied - !== undefined) ? widgetSettings.hideUnoccupied : widgetMetadata.hideUnoccupied + readonly property bool hideUnoccupied: (widgetSettings.hideUnoccupied !== undefined) ? widgetSettings.hideUnoccupied : widgetMetadata.hideUnoccupied property bool isDestroying: false property bool hovered: false diff --git a/Modules/BluetoothPanel/BluetoothDevicesList.qml b/Modules/BluetoothPanel/BluetoothDevicesList.qml index 05fd4d6..fec1ffd 100644 --- a/Modules/BluetoothPanel/BluetoothDevicesList.qml +++ b/Modules/BluetoothPanel/BluetoothDevicesList.qml @@ -116,8 +116,7 @@ ColumnLayout { NText { visible: modelData.signalStrength > 0 && !modelData.pairing && !modelData.blocked - text: (modelData.signalStrength !== undefined - && modelData.signalStrength > 0) ? modelData.signalStrength + "%" : "" + text: (modelData.signalStrength !== undefined && modelData.signalStrength > 0) ? modelData.signalStrength + "%" : "" font.pointSize: Style.fontSizeXS * scaling color: getContentColor(Color.mOnSurface) } diff --git a/Modules/BluetoothPanel/BluetoothPanel.qml b/Modules/BluetoothPanel/BluetoothPanel.qml index 7f422fe..8b53a1d 100644 --- a/Modules/BluetoothPanel/BluetoothPanel.qml +++ b/Modules/BluetoothPanel/BluetoothPanel.qml @@ -143,8 +143,7 @@ NPanel { property var items: { if (!BluetoothService.adapter || !Bluetooth.devices) return [] - var filtered = Bluetooth.devices.values.filter(dev => dev && !dev.blocked && !dev.connected - && (dev.paired || dev.trusted)) + var filtered = Bluetooth.devices.values.filter(dev => dev && !dev.blocked && !dev.connected && (dev.paired || dev.trusted)) return BluetoothService.sortDevices(filtered) } model: items @@ -176,10 +175,7 @@ NPanel { } var availableCount = Bluetooth.devices.values.filter(dev => { - return dev && !dev.paired && !dev.pairing - && !dev.blocked - && (dev.signalStrength === undefined - || dev.signalStrength > 0) + return dev && !dev.paired && !dev.pairing && !dev.blocked && (dev.signalStrength === undefined || dev.signalStrength > 0) }).length return (availableCount === 0) } diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index 99a6ea4..9b4150b 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -36,8 +36,7 @@ Variants { readonly property int floatingMargin: Settings.data.dock.floatingRatio * Style.marginL * scaling // Bar detection and positioning properties - readonly property bool hasBar: modelData.name ? (Settings.data.bar.monitors.includes(modelData.name) - || (Settings.data.bar.monitors.length === 0)) : false + readonly property bool hasBar: modelData.name ? (Settings.data.bar.monitors.includes(modelData.name) || (Settings.data.bar.monitors.length === 0)) : false readonly property bool barAtBottom: hasBar && Settings.data.bar.position === "bottom" readonly property int barHeight: Style.barHeight * scaling @@ -261,8 +260,7 @@ Variants { Layout.preferredHeight: iconSize Layout.alignment: Qt.AlignCenter - property bool isActive: ToplevelManager.activeToplevel - && ToplevelManager.activeToplevel === modelData + property bool isActive: ToplevelManager.activeToplevel && ToplevelManager.activeToplevel === modelData property bool hovered: appMouseArea.containsMouse property string appId: modelData ? modelData.appId : "" property string appTitle: modelData ? modelData.title : "" diff --git a/Modules/Launcher/Plugins/ApplicationsPlugin.qml b/Modules/Launcher/Plugins/ApplicationsPlugin.qml index 05f086f..b6fb1e2 100644 --- a/Modules/Launcher/Plugins/ApplicationsPlugin.qml +++ b/Modules/Launcher/Plugins/ApplicationsPlugin.qml @@ -37,8 +37,7 @@ Item { if (!query || query.trim() === "") { // Return all apps alphabetically - return entries.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase())).map( - app => createResultEntry(app)) + return entries.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase())).map(app => createResultEntry(app)) } // Use fuzzy search if available, fallback to simple search @@ -57,8 +56,7 @@ Item { const name = (app.name || "").toLowerCase() const comment = (app.comment || "").toLowerCase() const generic = (app.genericName || "").toLowerCase() - return name.includes(searchTerm) || comment.includes(searchTerm) || generic.includes( - searchTerm) + return name.includes(searchTerm) || comment.includes(searchTerm) || generic.includes(searchTerm) }).sort((a, b) => { // Prioritize name matches const aName = a.name.toLowerCase() diff --git a/Modules/Launcher/Plugins/CalculatorPlugin.qml b/Modules/Launcher/Plugins/CalculatorPlugin.qml index 292517f..2029870 100644 --- a/Modules/Launcher/Plugins/CalculatorPlugin.qml +++ b/Modules/Launcher/Plugins/CalculatorPlugin.qml @@ -8,8 +8,7 @@ Item { function handleCommand(query) { // Handle >calc command or direct math expressions after > - return query.startsWith(">calc") || (query.startsWith(">") && query.length > 1 && isMathExpression( - query.substring(1))) + return query.startsWith(">calc") || (query.startsWith(">") && query.length > 1 && isMathExpression(query.substring(1))) } function commands() { diff --git a/Modules/LockScreen/LockContext.qml b/Modules/LockScreen/LockContext.qml index 985bcd4..7c34059 100644 --- a/Modules/LockScreen/LockContext.qml +++ b/Modules/LockScreen/LockContext.qml @@ -48,8 +48,7 @@ Scope { user: Quickshell.env("USER") onPamMessage: { - Logger.log("LockContext", "PAM message:", message, "isError:", messageIsError, "responseRequired:", - responseRequired) + Logger.log("LockContext", "PAM message:", message, "isError:", messageIsError, "responseRequired:", responseRequired) if (messageIsError) { errorMessage = message diff --git a/Modules/LockScreen/LockScreen.qml b/Modules/LockScreen/LockScreen.qml index 43ed2ed..90eaba9 100644 --- a/Modules/LockScreen/LockScreen.qml +++ b/Modules/LockScreen/LockScreen.qml @@ -62,8 +62,7 @@ Loader { Item { id: keyboardLayout - property string currentLayout: (typeof KeyboardLayoutService !== 'undefined' - && KeyboardLayoutService.currentLayout) ? KeyboardLayoutService.currentLayout : "Unknown" + property string currentLayout: (typeof KeyboardLayoutService !== 'undefined' && KeyboardLayoutService.currentLayout) ? KeyboardLayoutService.currentLayout : "Unknown" } Image { @@ -227,12 +226,10 @@ Loader { Repeater { model: CavaService.values.length * 2 Rectangle { - property int mirroredValueIndex: index < CavaService.values.length ? index : (CavaService.values.length - * 2 - 1 - index) + property int mirroredValueIndex: index < CavaService.values.length ? index : (CavaService.values.length * 2 - 1 - index) property real mirroredAngle: (index / (CavaService.values.length * 2)) * 2 * Math.PI property real mirroredRadius: 70 * scaling - property real mirroredBarLength: Math.max( - 2, CavaService.values[mirroredValueIndex] * 30 * scaling) + property real mirroredBarLength: Math.max(2, CavaService.values[mirroredValueIndex] * 30 * scaling) property real mirroredBarWidth: 3 * scaling width: mirroredBarWidth height: mirroredBarLength @@ -428,8 +425,7 @@ Loader { spacing: Style.marginS * scaling visible: batteryIndicator.batteryVisible NIcon { - icon: BatteryService.getIcon(batteryIndicator.percent, batteryIndicator.charging, - batteryIndicator.isReady) + icon: BatteryService.getIcon(batteryIndicator.percent, batteryIndicator.charging, batteryIndicator.isReady) font.pointSize: Style.fontSizeM * scaling color: batteryIndicator.charging ? Color.mPrimary : Color.mOnSurface rotation: -90 diff --git a/Modules/Notification/Notification.qml b/Modules/Notification/Notification.qml index 61809e5..7d9fc6c 100644 --- a/Modules/Notification/Notification.qml +++ b/Modules/Notification/Notification.qml @@ -25,10 +25,7 @@ Variants { property var removingNotifications: ({}) // If no notification display activated in settings, then show them all - active: Settings.isLoaded && modelData - && (NotificationService.notificationModel.count > 0) ? (Settings.data.notifications.monitors.includes( - modelData.name) - || (Settings.data.notifications.monitors.length === 0)) : false + active: Settings.isLoaded && modelData && (NotificationService.notificationModel.count > 0) ? (Settings.data.notifications.monitors.includes(modelData.name) || (Settings.data.notifications.monitors.length === 0)) : false visible: (NotificationService.notificationModel.count > 0) @@ -181,8 +178,7 @@ Variants { spacing: Style.marginS * scaling NText { - text: `${(model.appName || model.desktopEntry) - || "Unknown App"} · ${NotificationService.formatTimestamp(model.timestamp)}` + text: `${(model.appName || model.desktopEntry) || "Unknown App"} · ${NotificationService.formatTimestamp(model.timestamp)}` color: Color.mSecondary font.pointSize: Style.fontSizeXS * scaling } @@ -249,8 +245,7 @@ Variants { RowLayout { Layout.fillWidth: true spacing: Style.marginS * scaling - visible: model.rawNotification && model.rawNotification.actions - && model.rawNotification.actions.length > 0 + visible: model.rawNotification && model.rawNotification.actions && model.rawNotification.actions.length > 0 property var notificationActions: model.rawNotification ? model.rawNotification.actions : [] diff --git a/Modules/Notification/NotificationHistoryPanel.qml b/Modules/Notification/NotificationHistoryPanel.qml index 890f3d1..c25c25f 100644 --- a/Modules/Notification/NotificationHistoryPanel.qml +++ b/Modules/Notification/NotificationHistoryPanel.qml @@ -152,13 +152,7 @@ NPanel { Layout.preferredHeight: 28 * scaling Layout.alignment: Qt.AlignVCenter // Prefer stable themed icons over transient image paths - imagePath: (appIcon - && appIcon !== "") ? (AppIcons.iconFromName(appIcon, "application-x-executable") - || appIcon) : ((AppIcons.iconForAppId(desktopEntry - || appName, "application-x-executable") - || (image && image - !== "" ? image : AppIcons.iconFromName("application-x-executable", - "application-x-executable")))) + imagePath: (appIcon && appIcon !== "") ? (AppIcons.iconFromName(appIcon, "application-x-executable") || appIcon) : ((AppIcons.iconForAppId(desktopEntry || appName, "application-x-executable") || (image && image !== "" ? image : AppIcons.iconFromName("application-x-executable", "application-x-executable")))) borderColor: Color.transparent borderWidth: 0 visible: true diff --git a/Modules/PowerPanel/PowerPanel.qml b/Modules/PowerPanel/PowerPanel.qml index e884fb4..e81fd5e 100644 --- a/Modules/PowerPanel/PowerPanel.qml +++ b/Modules/PowerPanel/PowerPanel.qml @@ -14,7 +14,7 @@ NPanel { id: root preferredWidth: 440 - preferredHeight: 380 + preferredHeight: 410 panelAnchorHorizontalCenter: true panelAnchorVerticalCenter: true panelKeyboardFocus: true @@ -263,8 +263,7 @@ NPanel { Layout.preferredHeight: Style.baseWidgetSize * 0.8 * scaling NText { - text: timerActive ? `${pendingAction.charAt(0).toUpperCase() + pendingAction.slice(1)} in ${Math.ceil( - timeRemaining / 1000)} seconds...` : "Power Options" + text: timerActive ? `${pendingAction.charAt(0).toUpperCase() + pendingAction.slice(1)} in ${Math.ceil(timeRemaining / 1000)} seconds...` : "Power Menu" font.weight: Style.fontWeightBold font.pointSize: Style.fontSizeL * scaling color: timerActive ? Color.mPrimary : Color.mOnSurface @@ -293,6 +292,10 @@ NPanel { } } + NDivider { + Layout.fillWidth: true + } + // Power options ColumnLayout { Layout.fillWidth: true @@ -338,7 +341,7 @@ NPanel { return Qt.alpha(Color.mPrimary, 0.08) } if (isSelected || mouseArea.containsMouse) { - return Color.mSecondary + return Color.mTertiary } return Color.transparent } @@ -368,7 +371,7 @@ NPanel { if (buttonRoot.isShutdown && !buttonRoot.isSelected && !mouseArea.containsMouse) return Color.mError if (buttonRoot.isSelected || mouseArea.containsMouse) - return Color.mOnSecondary + return Color.mOnTertiary return Color.mOnSurface } font.pointSize: Style.fontSizeXXXL * scaling @@ -402,7 +405,7 @@ NPanel { if (buttonRoot.isShutdown && !buttonRoot.isSelected && !mouseArea.containsMouse) return Color.mError if (buttonRoot.isSelected || mouseArea.containsMouse) - return Color.mOnSecondary + return Color.mOnTertiary return Color.mOnSurface } @@ -427,7 +430,7 @@ NPanel { if (buttonRoot.isShutdown && !buttonRoot.isSelected && !mouseArea.containsMouse) return Color.mError if (buttonRoot.isSelected || mouseArea.containsMouse) - return Color.mOnSecondary + return Color.mOnTertiary return Color.mOnSurfaceVariant } opacity: Style.opacityHeavy diff --git a/Modules/SettingsPanel/Bar/BarSectionEditor.qml b/Modules/SettingsPanel/Bar/BarSectionEditor.qml index 537469b..0c1919b 100644 --- a/Modules/SettingsPanel/Bar/BarSectionEditor.qml +++ b/Modules/SettingsPanel/Bar/BarSectionEditor.qml @@ -339,12 +339,10 @@ NBox { continue // Check distance to left edge (insert before) - const leftDist = Math.sqrt(Math.pow(mouseX - widget.x, - 2) + Math.pow(mouseY - (widget.y + widget.height / 2), 2)) + const leftDist = Math.sqrt(Math.pow(mouseX - widget.x, 2) + Math.pow(mouseY - (widget.y + widget.height / 2), 2)) // Check distance to right edge (insert after) - const rightDist = Math.sqrt(Math.pow(mouseX - (widget.x + widget.width), - 2) + Math.pow(mouseY - (widget.y + widget.height / 2), 2)) + const rightDist = Math.sqrt(Math.pow(mouseX - (widget.x + widget.width), 2) + Math.pow(mouseY - (widget.y + widget.height / 2), 2)) if (leftDist < minDistance) { minDistance = leftDist @@ -355,8 +353,7 @@ NBox { if (rightDist < minDistance) { minDistance = rightDist bestIndex = i + 1 - bestPosition = Qt.point(widget.x + widget.width + Style.marginXS * scaling - dropIndicator.width / 2, - widget.y) + bestPosition = Qt.point(widget.x + widget.width + Style.marginXS * scaling - dropIndicator.width / 2, widget.y) } } @@ -368,8 +365,7 @@ NBox { if (dist < minDistance && mouseX < firstWidget.x + firstWidget.width / 2) { minDistance = dist bestIndex = 0 - bestPosition = Qt.point(Math.max(0, firstWidget.x - dropIndicator.width - Style.marginS * scaling), - firstWidget.y) + bestPosition = Qt.point(Math.max(0, firstWidget.x - dropIndicator.width - Style.marginS * scaling), firstWidget.y) } } } @@ -419,8 +415,7 @@ NBox { for (var i = 0; i < widgetModel.length; i++) { const widget = widgetFlow.children[i] if (widget && widget.widgetIndex !== undefined) { - if (mouse.x >= widget.x && mouse.x <= widget.x + widget.width && mouse.y >= widget.y - && mouse.y <= widget.y + widget.height) { + if (mouse.x >= widget.x && mouse.x <= widget.x + widget.width && mouse.y >= widget.y && mouse.y <= widget.y + widget.height) { const localX = mouse.x - widget.x const buttonsStartX = widget.width - (widget.buttonsCount * widget.buttonsWidth) diff --git a/Modules/SettingsPanel/Bar/WidgetSettings/BatterySettings.qml b/Modules/SettingsPanel/Bar/WidgetSettings/BatterySettings.qml index 4e66f65..df40081 100644 --- a/Modules/SettingsPanel/Bar/WidgetSettings/BatterySettings.qml +++ b/Modules/SettingsPanel/Bar/WidgetSettings/BatterySettings.qml @@ -14,10 +14,8 @@ ColumnLayout { property var widgetMetadata: null // Local state - property bool valueAlwaysShowPercentage: widgetData.alwaysShowPercentage - !== undefined ? widgetData.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage - property int valueWarningThreshold: widgetData.warningThreshold - !== undefined ? widgetData.warningThreshold : widgetMetadata.warningThreshold + property bool valueAlwaysShowPercentage: widgetData.alwaysShowPercentage !== undefined ? widgetData.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage + property int valueWarningThreshold: widgetData.warningThreshold !== undefined ? widgetData.warningThreshold : widgetMetadata.warningThreshold function saveSettings() { var settings = Object.assign({}, widgetData || {}) diff --git a/Modules/SettingsPanel/Bar/WidgetSettings/BrightnessSettings.qml b/Modules/SettingsPanel/Bar/WidgetSettings/BrightnessSettings.qml index 6054e9c..551e277 100644 --- a/Modules/SettingsPanel/Bar/WidgetSettings/BrightnessSettings.qml +++ b/Modules/SettingsPanel/Bar/WidgetSettings/BrightnessSettings.qml @@ -14,8 +14,7 @@ ColumnLayout { property var widgetMetadata: null // Local state - property bool valueAlwaysShowPercentage: widgetData.alwaysShowPercentage - !== undefined ? widgetData.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage + property bool valueAlwaysShowPercentage: widgetData.alwaysShowPercentage !== undefined ? widgetData.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage function saveSettings() { var settings = Object.assign({}, widgetData || {}) diff --git a/Modules/SettingsPanel/Bar/WidgetSettings/MicrophoneSettings.qml b/Modules/SettingsPanel/Bar/WidgetSettings/MicrophoneSettings.qml index 6054e9c..551e277 100644 --- a/Modules/SettingsPanel/Bar/WidgetSettings/MicrophoneSettings.qml +++ b/Modules/SettingsPanel/Bar/WidgetSettings/MicrophoneSettings.qml @@ -14,8 +14,7 @@ ColumnLayout { property var widgetMetadata: null // Local state - property bool valueAlwaysShowPercentage: widgetData.alwaysShowPercentage - !== undefined ? widgetData.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage + property bool valueAlwaysShowPercentage: widgetData.alwaysShowPercentage !== undefined ? widgetData.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage function saveSettings() { var settings = Object.assign({}, widgetData || {}) diff --git a/Modules/SettingsPanel/Bar/WidgetSettings/SystemMonitorSettings.qml b/Modules/SettingsPanel/Bar/WidgetSettings/SystemMonitorSettings.qml index 39e4614..d2cee14 100644 --- a/Modules/SettingsPanel/Bar/WidgetSettings/SystemMonitorSettings.qml +++ b/Modules/SettingsPanel/Bar/WidgetSettings/SystemMonitorSettings.qml @@ -17,10 +17,8 @@ ColumnLayout { property bool valueShowCpuUsage: widgetData.showCpuUsage !== undefined ? widgetData.showCpuUsage : widgetMetadata.showCpuUsage property bool valueShowCpuTemp: widgetData.showCpuTemp !== undefined ? widgetData.showCpuTemp : widgetMetadata.showCpuTemp property bool valueShowMemoryUsage: widgetData.showMemoryUsage !== undefined ? widgetData.showMemoryUsage : widgetMetadata.showMemoryUsage - property bool valueShowMemoryAsPercent: widgetData.showMemoryAsPercent - !== undefined ? widgetData.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent - property bool valueShowNetworkStats: widgetData.showNetworkStats - !== undefined ? widgetData.showNetworkStats : widgetMetadata.showNetworkStats + property bool valueShowMemoryAsPercent: widgetData.showMemoryAsPercent !== undefined ? widgetData.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent + property bool valueShowNetworkStats: widgetData.showNetworkStats !== undefined ? widgetData.showNetworkStats : widgetMetadata.showNetworkStats property bool valueShowDiskUsage: widgetData.showDiskUsage !== undefined ? widgetData.showDiskUsage : widgetMetadata.showDiskUsage function saveSettings() { diff --git a/Modules/SettingsPanel/Bar/WidgetSettings/VolumeSettings.qml b/Modules/SettingsPanel/Bar/WidgetSettings/VolumeSettings.qml index 6054e9c..551e277 100644 --- a/Modules/SettingsPanel/Bar/WidgetSettings/VolumeSettings.qml +++ b/Modules/SettingsPanel/Bar/WidgetSettings/VolumeSettings.qml @@ -14,8 +14,7 @@ ColumnLayout { property var widgetMetadata: null // Local state - property bool valueAlwaysShowPercentage: widgetData.alwaysShowPercentage - !== undefined ? widgetData.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage + property bool valueAlwaysShowPercentage: widgetData.alwaysShowPercentage !== undefined ? widgetData.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage function saveSettings() { var settings = Object.assign({}, widgetData || {}) diff --git a/Modules/SettingsPanel/SettingsPanel.qml b/Modules/SettingsPanel/SettingsPanel.qml index 43c0927..ecefb1c 100644 --- a/Modules/SettingsPanel/SettingsPanel.qml +++ b/Modules/SettingsPanel/SettingsPanel.qml @@ -227,8 +227,7 @@ NPanel { if (activeScrollView && activeScrollView.ScrollBar.vertical) { const scrollBar = activeScrollView.ScrollBar.vertical const stepSize = activeScrollView.height * 0.1 // Scroll 10% of viewport - scrollBar.position = Math.min(scrollBar.position + stepSize / activeScrollView.contentHeight, - 1.0 - scrollBar.size) + scrollBar.position = Math.min(scrollBar.position + stepSize / activeScrollView.contentHeight, 1.0 - scrollBar.size) } } @@ -244,8 +243,7 @@ NPanel { if (activeScrollView && activeScrollView.ScrollBar.vertical) { const scrollBar = activeScrollView.ScrollBar.vertical const pageSize = activeScrollView.height * 0.9 // Scroll 90% of viewport - scrollBar.position = Math.min(scrollBar.position + pageSize / activeScrollView.contentHeight, - 1.0 - scrollBar.size) + scrollBar.position = Math.min(scrollBar.position + pageSize / activeScrollView.contentHeight, 1.0 - scrollBar.size) } } diff --git a/Modules/SettingsPanel/Tabs/BarTab.qml b/Modules/SettingsPanel/Tabs/BarTab.qml index 864bc0a..396191a 100644 --- a/Modules/SettingsPanel/Tabs/BarTab.qml +++ b/Modules/SettingsPanel/Tabs/BarTab.qml @@ -201,8 +201,7 @@ ColumnLayout { } function _reorderWidgetInSection(section, fromIndex, toIndex) { - if (fromIndex >= 0 && fromIndex < Settings.data.bar.widgets[section].length && toIndex >= 0 - && toIndex < Settings.data.bar.widgets[section].length) { + if (fromIndex >= 0 && fromIndex < Settings.data.bar.widgets[section].length && toIndex >= 0 && toIndex < Settings.data.bar.widgets[section].length) { // Create a new array to avoid modifying the original var newArray = Settings.data.bar.widgets[section].slice() diff --git a/Modules/SettingsPanel/Tabs/BrightnessTab.qml b/Modules/SettingsPanel/Tabs/BrightnessTab.qml index a8f0135..0f6f167 100644 --- a/Modules/SettingsPanel/Tabs/BrightnessTab.qml +++ b/Modules/SettingsPanel/Tabs/BrightnessTab.qml @@ -276,8 +276,7 @@ ColumnLayout { // Schedule settings ColumnLayout { spacing: Style.marginXS * scaling - visible: Settings.data.nightLight.enabled && !Settings.data.nightLight.autoSchedule - && !Settings.data.nightLight.forced + visible: Settings.data.nightLight.enabled && !Settings.data.nightLight.autoSchedule && !Settings.data.nightLight.forced RowLayout { Layout.fillWidth: false diff --git a/Modules/SettingsPanel/Tabs/ColorSchemeTab.qml b/Modules/SettingsPanel/Tabs/ColorSchemeTab.qml index f0b82e0..f358500 100644 --- a/Modules/SettingsPanel/Tabs/ColorSchemeTab.qml +++ b/Modules/SettingsPanel/Tabs/ColorSchemeTab.qml @@ -186,9 +186,7 @@ ColumnLayout { radius: Style.radiusM * scaling color: getSchemeColor(modelData, "mSurface") border.width: Math.max(1, Style.borderL * scaling) - border.color: (!Settings.data.colorSchemes.useWallpaperColors - && (Settings.data.colorSchemes.predefinedScheme === modelData.split("/").pop().replace( - ".json", ""))) ? Color.mSecondary : Color.mOutline + border.color: (!Settings.data.colorSchemes.useWallpaperColors && (Settings.data.colorSchemes.predefinedScheme === modelData.split("/").pop().replace(".json", ""))) ? Color.mSecondary : Color.mOutline scale: root.cardScaleLow // Mouse area for selection @@ -281,9 +279,7 @@ ColumnLayout { // Selection indicator (Checkmark) Rectangle { - visible: !Settings.data.colorSchemes.useWallpaperColors - && (Settings.data.colorSchemes.predefinedScheme === schemePath.split("/").pop().replace(".json", - "")) + visible: !Settings.data.colorSchemes.useWallpaperColors && (Settings.data.colorSchemes.predefinedScheme === schemePath.split("/").pop().replace(".json", "")) anchors.right: parent.right anchors.top: parent.top anchors.margins: Style.marginS * scaling diff --git a/Modules/SettingsPanel/Tabs/DisplayTab.qml b/Modules/SettingsPanel/Tabs/DisplayTab.qml index a7bcbca..97d7c67 100644 --- a/Modules/SettingsPanel/Tabs/DisplayTab.qml +++ b/Modules/SettingsPanel/Tabs/DisplayTab.qml @@ -106,11 +106,9 @@ ColumnLayout { checked: (Settings.data.notifications.monitors || []).indexOf(modelData.name) !== -1 onToggled: checked => { if (checked) { - Settings.data.notifications.monitors = addMonitor(Settings.data.notifications.monitors, - modelData.name) + Settings.data.notifications.monitors = addMonitor(Settings.data.notifications.monitors, modelData.name) } else { - Settings.data.notifications.monitors = removeMonitor(Settings.data.notifications.monitors, - modelData.name) + Settings.data.notifications.monitors = removeMonitor(Settings.data.notifications.monitors, modelData.name) } } } diff --git a/Modules/SidePanel/Cards/MediaCard.qml b/Modules/SidePanel/Cards/MediaCard.qml index ef44105..9879256 100644 --- a/Modules/SidePanel/Cards/MediaCard.qml +++ b/Modules/SidePanel/Cards/MediaCard.qml @@ -232,9 +232,7 @@ NBox { return 0 return Math.max(0, Math.min(1, r)) } - property real effectiveRatio: (MediaService.isSeeking - && localSeekRatio >= 0) ? Math.max(0, Math.min(1, - localSeekRatio)) : progressRatio + property real effectiveRatio: (MediaService.isSeeking && localSeekRatio >= 0) ? Math.max(0, Math.min(1, localSeekRatio)) : progressRatio // Debounced backend seek during drag Timer { @@ -244,8 +242,7 @@ NBox { onTriggered: { if (MediaService.isSeeking && progressWrapper.localSeekRatio >= 0) { const next = Math.max(0, Math.min(1, progressWrapper.localSeekRatio)) - if (progressWrapper.lastSentSeekRatio < 0 || Math.abs( - next - progressWrapper.lastSentSeekRatio) >= progressWrapper.seekEpsilon) { + if (progressWrapper.lastSentSeekRatio < 0 || Math.abs(next - progressWrapper.lastSentSeekRatio) >= progressWrapper.seekEpsilon) { MediaService.seekByRatio(next) progressWrapper.lastSentSeekRatio = next } diff --git a/Modules/SidePanel/Cards/PowerProfilesCard.qml b/Modules/SidePanel/Cards/PowerProfilesCard.qml index eff8f15..bbfe070 100644 --- a/Modules/SidePanel/Cards/PowerProfilesCard.qml +++ b/Modules/SidePanel/Cards/PowerProfilesCard.qml @@ -29,8 +29,7 @@ NBox { tooltipText: "Set performance power profile." enabled: hasPP opacity: enabled ? Style.opacityFull : Style.opacityMedium - colorBg: (enabled - && PowerProfileService.profile === PowerProfile.Performance) ? Color.mPrimary : Color.mSurfaceVariant + colorBg: (enabled && PowerProfileService.profile === PowerProfile.Performance) ? Color.mPrimary : Color.mSurfaceVariant colorFg: (enabled && PowerProfileService.profile === PowerProfile.Performance) ? Color.mOnPrimary : Color.mPrimary onClicked: { if (enabled) { @@ -44,8 +43,7 @@ NBox { tooltipText: "Set balanced power profile." enabled: hasPP opacity: enabled ? Style.opacityFull : Style.opacityMedium - colorBg: (enabled - && PowerProfileService.profile === PowerProfile.Balanced) ? Color.mPrimary : Color.mSurfaceVariant + colorBg: (enabled && PowerProfileService.profile === PowerProfile.Balanced) ? Color.mPrimary : Color.mSurfaceVariant colorFg: (enabled && PowerProfileService.profile === PowerProfile.Balanced) ? Color.mOnPrimary : Color.mPrimary onClicked: { if (enabled) { @@ -59,8 +57,7 @@ NBox { tooltipText: "Set eco power profile." enabled: hasPP opacity: enabled ? Style.opacityFull : Style.opacityMedium - colorBg: (enabled - && PowerProfileService.profile === PowerProfile.PowerSaver) ? Color.mPrimary : Color.mSurfaceVariant + colorBg: (enabled && PowerProfileService.profile === PowerProfile.PowerSaver) ? Color.mPrimary : Color.mSurfaceVariant colorFg: (enabled && PowerProfileService.profile === PowerProfile.PowerSaver) ? Color.mOnPrimary : Color.mPrimary onClicked: { if (enabled) { diff --git a/Modules/SidePanel/Cards/WeatherCard.qml b/Modules/SidePanel/Cards/WeatherCard.qml index aba0b8c..160c48c 100644 --- a/Modules/SidePanel/Cards/WeatherCard.qml +++ b/Modules/SidePanel/Cards/WeatherCard.qml @@ -23,8 +23,7 @@ NBox { spacing: Style.marginS * scaling NIcon { Layout.alignment: Qt.AlignVCenter - icon: weatherReady ? LocationService.weatherSymbolFromCode( - LocationService.data.weather.current_weather.weathercode) : "" + icon: weatherReady ? LocationService.weatherSymbolFromCode(LocationService.data.weather.current_weather.weathercode) : "" font.pointSize: Style.fontSizeXXXL * 1.75 * scaling color: Color.mPrimary } diff --git a/Modules/Toast/ToastOverlay.qml b/Modules/Toast/ToastOverlay.qml index d86a549..fcc3925 100644 --- a/Modules/Toast/ToastOverlay.qml +++ b/Modules/Toast/ToastOverlay.qml @@ -23,8 +23,7 @@ Variants { } // Only show on screens that have notifications enabled - active: Settings.isLoaded && modelData ? (Settings.data.notifications.monitors.includes(modelData.name) - || (Settings.data.notifications.monitors.length === 0)) : false + active: Settings.isLoaded && modelData ? (Settings.data.notifications.monitors.includes(modelData.name) || (Settings.data.notifications.monitors.length === 0)) : false sourceComponent: PanelWindow { id: root diff --git a/Modules/WiFiPanel/WiFiPanel.qml b/Modules/WiFiPanel/WiFiPanel.qml index abdad6d..02cbc46 100644 --- a/Modules/WiFiPanel/WiFiPanel.qml +++ b/Modules/WiFiPanel/WiFiPanel.qml @@ -156,8 +156,7 @@ NPanel { // Scanning state ColumnLayout { - visible: Settings.data.network.wifiEnabled && NetworkService.scanning && Object.keys( - NetworkService.networks).length === 0 + visible: Settings.data.network.wifiEnabled && NetworkService.scanning && Object.keys(NetworkService.networks).length === 0 anchors.fill: parent spacing: Style.marginL * scaling @@ -186,8 +185,7 @@ NPanel { // Networks list container NScrollView { - visible: Settings.data.network.wifiEnabled && (!NetworkService.scanning || Object.keys( - NetworkService.networks).length > 0) + visible: Settings.data.network.wifiEnabled && (!NetworkService.scanning || Object.keys(NetworkService.networks).length > 0) anchors.fill: parent horizontalPolicy: ScrollBar.AlwaysOff verticalPolicy: ScrollBar.AsNeeded @@ -217,11 +215,9 @@ NPanel { radius: Style.radiusM * scaling // Add opacity for operations in progress - opacity: (NetworkService.disconnectingFrom === modelData.ssid - || NetworkService.forgettingNetwork === modelData.ssid) ? 0.6 : 1.0 + opacity: (NetworkService.disconnectingFrom === modelData.ssid || NetworkService.forgettingNetwork === modelData.ssid) ? 0.6 : 1.0 - color: modelData.connected ? Qt.rgba(Color.mPrimary.r, Color.mPrimary.g, Color.mPrimary.b, - 0.05) : Color.mSurface + color: modelData.connected ? Qt.rgba(Color.mPrimary.r, Color.mPrimary.g, Color.mPrimary.b, 0.05) : Color.mSurface border.width: Math.max(1, Style.borderS * scaling) border.color: modelData.connected ? Color.mPrimary : Color.mOutline @@ -338,9 +334,7 @@ NPanel { } Rectangle { - visible: modelData.cached && !modelData.connected - && NetworkService.forgettingNetwork !== modelData.ssid - && NetworkService.disconnectingFrom !== modelData.ssid + visible: modelData.cached && !modelData.connected && NetworkService.forgettingNetwork !== modelData.ssid && NetworkService.disconnectingFrom !== modelData.ssid color: Color.transparent border.color: Color.mOutline border.width: Math.max(1, Style.borderS * scaling) @@ -364,19 +358,14 @@ NPanel { spacing: Style.marginS * scaling NBusyIndicator { - visible: NetworkService.connectingTo === modelData.ssid - || NetworkService.disconnectingFrom === modelData.ssid - || NetworkService.forgettingNetwork === modelData.ssid + visible: NetworkService.connectingTo === modelData.ssid || NetworkService.disconnectingFrom === modelData.ssid || NetworkService.forgettingNetwork === modelData.ssid running: visible color: Color.mPrimary size: Style.baseWidgetSize * 0.5 * scaling } NIconButton { - visible: (modelData.existing || modelData.cached) && !modelData.connected - && NetworkService.connectingTo !== modelData.ssid - && NetworkService.forgettingNetwork !== modelData.ssid - && NetworkService.disconnectingFrom !== modelData.ssid + visible: (modelData.existing || modelData.cached) && !modelData.connected && NetworkService.connectingTo !== modelData.ssid && NetworkService.forgettingNetwork !== modelData.ssid && NetworkService.disconnectingFrom !== modelData.ssid icon: "trash" tooltipText: "Forget network" sizeRatio: 0.7 @@ -384,10 +373,7 @@ NPanel { } NButton { - visible: !modelData.connected && NetworkService.connectingTo !== modelData.ssid - && passwordSsid !== modelData.ssid - && NetworkService.forgettingNetwork !== modelData.ssid - && NetworkService.disconnectingFrom !== modelData.ssid + visible: !modelData.connected && NetworkService.connectingTo !== modelData.ssid && passwordSsid !== modelData.ssid && NetworkService.forgettingNetwork !== modelData.ssid && NetworkService.disconnectingFrom !== modelData.ssid text: { if (modelData.existing || modelData.cached) return "Connect" @@ -422,8 +408,7 @@ NPanel { // Password input Rectangle { - visible: passwordSsid === modelData.ssid && NetworkService.disconnectingFrom !== modelData.ssid - && NetworkService.forgettingNetwork !== modelData.ssid + visible: passwordSsid === modelData.ssid && NetworkService.disconnectingFrom !== modelData.ssid && NetworkService.forgettingNetwork !== modelData.ssid Layout.fillWidth: true height: passwordRow.implicitHeight + Style.marginS * scaling * 2 color: Color.mSurfaceVariant @@ -504,8 +489,7 @@ NPanel { // Forget network Rectangle { - visible: expandedSsid === modelData.ssid && NetworkService.disconnectingFrom !== modelData.ssid - && NetworkService.forgettingNetwork !== modelData.ssid + visible: expandedSsid === modelData.ssid && NetworkService.disconnectingFrom !== modelData.ssid && NetworkService.forgettingNetwork !== modelData.ssid Layout.fillWidth: true height: forgetRow.implicitHeight + Style.marginS * 2 * scaling color: Color.mSurfaceVariant @@ -561,8 +545,7 @@ NPanel { // Empty state when no networks ColumnLayout { - visible: Settings.data.network.wifiEnabled && !NetworkService.scanning && Object.keys( - NetworkService.networks).length === 0 + visible: Settings.data.network.wifiEnabled && !NetworkService.scanning && Object.keys(NetworkService.networks).length === 0 anchors.fill: parent spacing: Style.marginL * scaling diff --git a/Services/ArchUpdaterService.qml b/Services/ArchUpdaterService.qml index 9d33f2b..ea1d411 100644 --- a/Services/ArchUpdaterService.qml +++ b/Services/ArchUpdaterService.qml @@ -283,8 +283,7 @@ Singleton { stdout: StdioCollector { onStreamFinished: { parseAllUpdatesOutput(allUpdatesOutput, text) - Logger.log("ArchUpdater", "found", repoPackages.length, "repo package(s) and", aurPackages.length, - "AUR package(s) to upgrade") + Logger.log("ArchUpdater", "found", repoPackages.length, "repo package(s) and", aurPackages.length, "AUR package(s) to upgrade") } } } diff --git a/Services/BluetoothService.qml b/Services/BluetoothService.qml index cfdb5a7..1f773eb 100644 --- a/Services/BluetoothService.qml +++ b/Services/BluetoothService.qml @@ -91,8 +91,7 @@ Singleton { var name = (device.name || device.deviceName || "").toLowerCase() var icon = (device.icon || "").toLowerCase() - if (icon.includes("headset") || icon.includes("audio") || name.includes("headphone") || name.includes("airpod") - || name.includes("headset") || name.includes("arctis")) { + if (icon.includes("headset") || icon.includes("audio") || name.includes("headphone") || name.includes("airpod") || name.includes("headset") || name.includes("arctis")) { return "bt-device-headphones" } @@ -102,8 +101,7 @@ Singleton { if (icon.includes("keyboard") || name.includes("keyboard")) { return "bt-device-keyboard" } - if (icon.includes("phone") || name.includes("phone") || name.includes("iphone") || name.includes("android") - || name.includes("samsung")) { + if (icon.includes("phone") || name.includes("phone") || name.includes("iphone") || name.includes("android") || name.includes("samsung")) { return "bt-device-phone" } if (icon.includes("watch") || name.includes("watch")) { @@ -204,8 +202,7 @@ Singleton { return false } - return device.pairing || device.state === BluetoothDeviceState.Disconnecting - || device.state === BluetoothDeviceState.Connecting + return device.pairing || device.state === BluetoothDeviceState.Disconnecting || device.state === BluetoothDeviceState.Connecting } function connectDeviceWithTrust(device) { diff --git a/Services/BrightnessService.qml b/Services/BrightnessService.qml index d14b166..923c20e 100644 --- a/Services/BrightnessService.qml +++ b/Services/BrightnessService.qml @@ -84,8 +84,7 @@ Singleton { var ddcModel = ddcModelMatc ? ddcModelMatc.length > 0 : false var model = modelMatch ? modelMatch[1] : "Unknown" var bus = busMatch ? busMatch[1] : "Unknown" - Logger.log("Detected DDC Monitor:", model, "on bus", bus, "is DDC:", - !ddcModel) + Logger.log("Detected DDC Monitor:", model, "on bus", bus, "is DDC:", !ddcModel) return { "model": model, "busNum": bus, @@ -261,9 +260,7 @@ Singleton { } else { // Internal backlight - find the first available backlight device and get its info // This now returns: device_path, current_brightness, max_brightness (on separate lines) - initProc.command = ["sh", "-c", "for dev in /sys/class/backlight/*; do " - + " if [ -f \"$dev/brightness\" ] && [ -f \"$dev/max_brightness\" ]; then " + " echo \"$dev\"; " - + " cat \"$dev/brightness\"; " + " cat \"$dev/max_brightness\"; " + " break; " + " fi; " + "done"] + initProc.command = ["sh", "-c", "for dev in /sys/class/backlight/*; do " + " if [ -f \"$dev/brightness\" ] && [ -f \"$dev/max_brightness\" ]; then " + " echo \"$dev\"; " + " cat \"$dev/brightness\"; " + " cat \"$dev/max_brightness\"; " + " break; " + " fi; " + "done"] } initProc.running = true } diff --git a/Services/ClipboardService.qml b/Services/ClipboardService.qml index 8e2df62..d76c8b9 100644 --- a/Services/ClipboardService.qml +++ b/Services/ClipboardService.qml @@ -70,10 +70,7 @@ Singleton { root.cliphistAvailable = false // Show toast notification if feature is enabled but cliphist is missing if (Settings.data.appLauncher.enableClipboardHistory) { - ToastService.showWarning( - "Clipboard History Unavailable", - "The 'cliphist' application is not installed. Please install it to use clipboard history features.", - false, 6000) + ToastService.showWarning("Clipboard History Unavailable", "The 'cliphist' application is not installed. Please install it to use clipboard history features.", false, 6000) } } } diff --git a/Services/FontService.qml b/Services/FontService.qml index ebf03e3..cd05860 100644 --- a/Services/FontService.qml +++ b/Services/FontService.qml @@ -58,21 +58,16 @@ Singleton { if (monospaceFonts.count === 0) { Logger.log("Font", "No monospace fonts detected, adding fallbacks") - addFallbackFonts( - monospaceFonts, - ["DejaVu Sans Mono", "Liberation Mono", "Courier New", "Courier", "Monaco", "Consolas", "Lucida Console", "Monaco", "Andale Mono"]) + addFallbackFonts(monospaceFonts, ["DejaVu Sans Mono", "Liberation Mono", "Courier New", "Courier", "Monaco", "Consolas", "Lucida Console", "Monaco", "Andale Mono"]) } if (displayFonts.count === 0) { Logger.log("Font", "No display fonts detected, adding fallbacks") - addFallbackFonts( - displayFonts, - ["Inter", "Roboto", "Open Sans", "Arial", "Helvetica", "Verdana", "Segoe UI", "SF Pro Display", "Ubuntu", "Noto Sans"]) + addFallbackFonts(displayFonts, ["Inter", "Roboto", "Open Sans", "Arial", "Helvetica", "Verdana", "Segoe UI", "SF Pro Display", "Ubuntu", "Noto Sans"]) } fontsLoaded = true - Logger.log("Font", "Loaded", availableFonts.count, "fonts:", monospaceFonts.count, "monospace,", - displayFonts.count, "display") + Logger.log("Font", "Loaded", availableFonts.count, "fonts:", monospaceFonts.count, "monospace,", displayFonts.count, "display") } function isMonospaceFont(fontName) { diff --git a/Services/GitHubService.qml b/Services/GitHubService.qml index 99dc283..1c5583f 100644 --- a/Services/GitHubService.qml +++ b/Services/GitHubService.qml @@ -149,8 +149,7 @@ Singleton { Logger.log("GitHub", "Raw contributors response length:", response ? response.length : 0) if (response && response.trim()) { const data = JSON.parse(response) - Logger.log("GitHub", "Parsed contributors data type:", typeof data, "length:", - Array.isArray(data) ? data.length : "not array") + Logger.log("GitHub", "Parsed contributors data type:", typeof data, "length:", Array.isArray(data) ? data.length : "not array") root.data.contributors = data || [] root.contributors = root.data.contributors Logger.log("GitHub", "Contributors fetched from GitHub:", root.contributors.length) diff --git a/Services/IdleInhibitorService.qml b/Services/IdleInhibitorService.qml index 3a9aedb..f0c8420 100644 --- a/Services/IdleInhibitorService.qml +++ b/Services/IdleInhibitorService.qml @@ -131,8 +131,7 @@ Singleton { // Systemd inhibition using systemd-inhibit function startSystemdInhibition() { - inhibitorProcess.command = ["systemd-inhibit", "--what=idle:sleep:handle-lid-switch", "--why=" - + reason, "--mode=block", "sleep", "infinity"] + inhibitorProcess.command = ["systemd-inhibit", "--what=idle:sleep:handle-lid-switch", "--why=" + reason, "--mode=block", "sleep", "infinity"] inhibitorProcess.running = true } diff --git a/Services/KeyboardLayoutService.qml b/Services/KeyboardLayoutService.qml index 7f07707..c10f697 100644 --- a/Services/KeyboardLayoutService.qml +++ b/Services/KeyboardLayoutService.qml @@ -216,8 +216,7 @@ Singleton { // Try detection methods in order of preference if (Qt.platform.os === "linux") { // Check if we're in X11 or Wayland - const sessionType = Qt.application.arguments.find(arg => arg.includes("QT_QPA_PLATFORM")) - || process.env.XDG_SESSION_TYPE + const sessionType = Qt.application.arguments.find(arg => arg.includes("QT_QPA_PLATFORM")) || process.env.XDG_SESSION_TYPE if (sessionType && sessionType.includes("xcb") || process.env.DISPLAY) { // X11 system diff --git a/Services/LocationService.qml b/Services/LocationService.qml index 87de8fd..79b4aa5 100644 --- a/Services/LocationService.qml +++ b/Services/LocationService.qml @@ -119,9 +119,7 @@ Singleton { return } - if ((adapter.weatherLastFetch === "") || (adapter.weather === null) || (adapter.latitude === "") - || (adapter.longitude === "") || (adapter.name !== Settings.data.location.name) - || (Time.timestamp >= adapter.weatherLastFetch + weatherUpdateFrequency)) { + if ((adapter.weatherLastFetch === "") || (adapter.weather === null) || (adapter.latitude === "") || (adapter.longitude === "") || (adapter.name !== Settings.data.location.name) || (Time.timestamp >= adapter.weatherLastFetch + weatherUpdateFrequency)) { getFreshWeather() } } @@ -161,8 +159,7 @@ Singleton { // -------------------------------- function _geocodeLocation(locationName, callback, errorCallback) { Logger.log("Location", "Geocoding location name") - var geoUrl = "https://assets.noctalia.dev/geocode.php?city=" + encodeURIComponent( - locationName) + "&language=en&format=json" + var geoUrl = "https://assets.noctalia.dev/geocode.php?city=" + encodeURIComponent(locationName) + "&language=en&format=json" var xhr = new XMLHttpRequest() xhr.onreadystatechange = function () { if (xhr.readyState === XMLHttpRequest.DONE) { @@ -189,8 +186,7 @@ Singleton { // -------------------------------- function _fetchWeather(latitude, longitude, errorCallback) { Logger.log("Location", "Fetching weather from api.open-meteo.com") - var url = "https://api.open-meteo.com/v1/forecast?latitude=" + latitude + "&longitude=" + longitude - + "¤t_weather=true¤t=relativehumidity_2m,surface_pressure&daily=temperature_2m_max,temperature_2m_min,weathercode&timezone=auto" + var url = "https://api.open-meteo.com/v1/forecast?latitude=" + latitude + "&longitude=" + longitude + "¤t_weather=true¤t=relativehumidity_2m,surface_pressure&daily=temperature_2m_max,temperature_2m_min,weathercode&timezone=auto" var xhr = new XMLHttpRequest() xhr.onreadystatechange = function () { if (xhr.readyState === XMLHttpRequest.DONE) { diff --git a/Services/MatugenService.qml b/Services/MatugenService.qml index ef80b7d..3d090c1 100644 --- a/Services/MatugenService.qml +++ b/Services/MatugenService.qml @@ -61,10 +61,8 @@ Singleton { var extraUser = (Settings.configDir + "matugen.d").replace(/'/g, "'\\''") // Build the main script - var script = "cat > '" + pathEsc + "' << 'EOF'\n" + content + "EOF\n" + "for d in '" + extraRepo + "' '" + extraUser - + "'; do\n" + " if [ -d \"$d\" ]; then\n" - + " for f in \"$d\"/*.toml; do\n" + " [ -f \"$f\" ] && { echo; echo \"# extra: $f\"; cat \"$f\"; } >> '" - + pathEsc + "'\n" + " done\n" + " fi\n" + "done\n" + "matugen image '" + wp + "' --config '" + pathEsc + "' --mode " + mode + var script = "cat > '" + pathEsc + "' << 'EOF'\n" + content + "EOF\n" + "for d in '" + extraRepo + "' '" + extraUser + "'; do\n" + " if [ -d \"$d\" ]; then\n" + " for f in \"$d\"/*.toml; do\n" + " [ -f \"$f\" ] && { echo; echo \"# extra: $f\"; cat \"$f\"; } >> '" + pathEsc + "'\n" + " done\n" + " fi\n" + "done\n" + "matugen image '" + + wp + "' --config '" + pathEsc + "' --mode " + mode // Add user config execution if enabled if (Settings.data.matugen.enableUserTemplates) { diff --git a/Services/MediaService.qml b/Services/MediaService.qml index a37e85b..0eae65e 100644 --- a/Services/MediaService.qml +++ b/Services/MediaService.qml @@ -13,8 +13,7 @@ Singleton { property real currentPosition: 0 property bool isSeeking: false property int selectedPlayerIndex: 0 - property bool isPlaying: currentPlayer ? (currentPlayer.playbackState === MprisPlaybackState.Playing - || currentPlayer.isPlaying) : false + property bool isPlaying: currentPlayer ? (currentPlayer.playbackState === MprisPlaybackState.Playing || currentPlayer.isPlaying) : false property string trackTitle: currentPlayer ? (currentPlayer.trackTitle || "") : "" property string trackArtist: currentPlayer ? (currentPlayer.trackArtist || "") : "" property string trackAlbum: currentPlayer ? (currentPlayer.trackAlbum || "") : "" @@ -40,8 +39,7 @@ Singleton { let controllablePlayers = [] // Apply blacklist and controllable filter - const blacklist = (Settings.data.audio - && Settings.data.audio.mprisBlacklist) ? Settings.data.audio.mprisBlacklist : [] + const blacklist = (Settings.data.audio && Settings.data.audio.mprisBlacklist) ? Settings.data.audio.mprisBlacklist : [] for (var i = 0; i < allPlayers.length; i++) { let player = allPlayers[i] if (!player) @@ -52,8 +50,7 @@ Singleton { const idKey = identity.toLowerCase() const match = blacklist.find(b => { const s = String(b || "").toLowerCase() - return s && (idKey.includes(s) || busName.toLowerCase().includes(s) - || desktop.toLowerCase().includes(s)) + return s && (idKey.includes(s) || busName.toLowerCase().includes(s) || desktop.toLowerCase().includes(s)) }) if (match) continue @@ -159,12 +156,10 @@ Singleton { Timer { id: positionTimer interval: 1000 - running: currentPlayer && !root.isSeeking && currentPlayer.isPlaying && currentPlayer.length > 0 - && currentPlayer.playbackState === MprisPlaybackState.Playing + running: currentPlayer && !root.isSeeking && currentPlayer.isPlaying && currentPlayer.length > 0 && currentPlayer.playbackState === MprisPlaybackState.Playing repeat: true onTriggered: { - if (currentPlayer && !root.isSeeking && currentPlayer.isPlaying - && currentPlayer.playbackState === MprisPlaybackState.Playing) { + if (currentPlayer && !root.isSeeking && currentPlayer.isPlaying && currentPlayer.playbackState === MprisPlaybackState.Playing) { currentPosition = currentPlayer.position } else { running = false diff --git a/Services/NotificationService.qml b/Services/NotificationService.qml index bf66182..e31ad14 100644 --- a/Services/NotificationService.qml +++ b/Services/NotificationService.qml @@ -57,8 +57,7 @@ Singleton { property int maxHistory: 100 // Cached history file path - property string historyFile: Quickshell.env("NOCTALIA_NOTIF_HISTORY_FILE") - || (Settings.cacheDir + "notifications.json") + property string historyFile: Quickshell.env("NOCTALIA_NOTIF_HISTORY_FILE") || (Settings.cacheDir + "notifications.json") // Persisted storage for history property FileView historyFileView: FileView { @@ -280,9 +279,7 @@ Singleton { "appIcon": n.appIcon, "urgency": n.urgency, "timestamp"// Always persist in milliseconds - : (n.timestamp instanceof Date) ? n.timestamp.getTime( - ) : (typeof n.timestamp === "number" - && n.timestamp < 1e12 ? n.timestamp * 1000 : n.timestamp) + : (n.timestamp instanceof Date) ? n.timestamp.getTime() : (typeof n.timestamp === "number" && n.timestamp < 1e12 ? n.timestamp * 1000 : n.timestamp) }) } historyAdapter.history = arr diff --git a/Services/ScreenRecorderService.qml b/Services/ScreenRecorderService.qml index 7642542..553c2fa 100644 --- a/Services/ScreenRecorderService.qml +++ b/Services/ScreenRecorderService.qml @@ -74,8 +74,7 @@ Singleton { return } - Quickshell.execDetached( - ["sh", "-c", "pkill -SIGINT -f 'gpu-screen-recorder' || pkill -SIGINT -f 'com.dec05eba.gpu_screen_recorder'"]) + Quickshell.execDetached(["sh", "-c", "pkill -SIGINT -f 'gpu-screen-recorder' || pkill -SIGINT -f 'com.dec05eba.gpu_screen_recorder'"]) isRecording = false isPending = false @@ -152,8 +151,7 @@ Singleton { running: false repeat: false onTriggered: { - Quickshell.execDetached( - ["sh", "-c", "pkill -9 -f 'gpu-screen-recorder' 2>/dev/null || pkill -9 -f 'com.dec05eba.gpu_screen_recorder' 2>/dev/null || true"]) + Quickshell.execDetached(["sh", "-c", "pkill -9 -f 'gpu-screen-recorder' 2>/dev/null || pkill -9 -f 'com.dec05eba.gpu_screen_recorder' 2>/dev/null || true"]) } } } diff --git a/Services/WallpaperService.qml b/Services/WallpaperService.qml index c1eba0a..3a0756e 100644 --- a/Services/WallpaperService.qml +++ b/Services/WallpaperService.qml @@ -97,8 +97,7 @@ Singleton { // All transition keys but filter out "none" and "random" so we are left with the real transitions readonly property var allTransitions: Array.from({ "length": transitionsModel.count - }, (_, i) => transitionsModel.get(i).key).filter( - key => key !== "random" && key != "none") + }, (_, i) => transitionsModel.get(i).key).filter(key => key !== "random" && key != "none") property var wallpaperLists: ({}) property int scanningCount: 0 diff --git a/Widgets/NButton.qml b/Widgets/NButton.qml index 000eb43..b8fe113 100644 --- a/Widgets/NButton.qml +++ b/Widgets/NButton.qml @@ -33,8 +33,7 @@ Rectangle { // Dimensions implicitWidth: customWidth > 0 ? customWidth : contentRow.implicitWidth + (Style.marginL * 2 * scaling) - implicitHeight: customHeight > 0 ? customHeight : Math.max(Style.baseWidgetSize * scaling, - contentRow.implicitHeight + (Style.marginM * scaling)) + implicitHeight: customHeight > 0 ? customHeight : Math.max(Style.baseWidgetSize * scaling, contentRow.implicitHeight + (Style.marginM * scaling)) // Appearance radius: Style.radiusS * scaling diff --git a/Widgets/NColorPickerDialog.qml b/Widgets/NColorPickerDialog.qml index dbc2223..40e0f1c 100644 --- a/Widgets/NColorPickerDialog.qml +++ b/Widgets/NColorPickerDialog.qml @@ -180,8 +180,7 @@ Popup { } NText { - text: "RGB(" + Math.round(root.selectedColor.r * 255) + ", " + Math.round( - root.selectedColor.g * 255) + ", " + Math.round(root.selectedColor.b * 255) + ")" + text: "RGB(" + Math.round(root.selectedColor.r * 255) + ", " + Math.round(root.selectedColor.g * 255) + ", " + Math.round(root.selectedColor.b * 255) + ")" font.family: Settings.data.ui.fontFixed font.pointSize: Style.fontSizeM * scaling color: root.selectedColor.r + root.selectedColor.g + root.selectedColor.b > 1.5 ? "#000000" : "#FFFFFF" @@ -252,8 +251,7 @@ Popup { value: Math.round(root.selectedColor.r * 255) onMoved: { root.selectedColor = Qt.rgba(value / 255, root.selectedColor.g, root.selectedColor.b, 1) - var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, - root.selectedColor.b * 255) + var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255) root.currentHue = hsv[0] root.currentSaturation = hsv[1] } @@ -285,8 +283,7 @@ Popup { onMoved: { root.selectedColor = Qt.rgba(root.selectedColor.r, value / 255, root.selectedColor.b, 1) // Update stored hue and saturation when RGB changes - var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, - root.selectedColor.b * 255) + var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255) root.currentHue = hsv[0] root.currentSaturation = hsv[1] } @@ -318,8 +315,7 @@ Popup { onMoved: { root.selectedColor = Qt.rgba(root.selectedColor.r, root.selectedColor.g, value / 255, 1) // Update stored hue and saturation when RGB changes - var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, - root.selectedColor.b * 255) + var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255) root.currentHue = hsv[0] root.currentSaturation = hsv[1] } @@ -348,8 +344,7 @@ Popup { from: 0 to: 100 value: { - var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, - root.selectedColor.b * 255) + var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255) return hsv[2] } onMoved: { @@ -357,8 +352,7 @@ Popup { var saturation = root.currentSaturation if (hue === 0 && saturation === 0) { - var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, - root.selectedColor.b * 255) + var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255) hue = hsv[0] saturation = hsv[1] root.currentHue = hue @@ -416,8 +410,7 @@ Popup { cursorShape: Qt.PointingHandCursor onClicked: { root.selectedColor = modelData - var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, - root.selectedColor.b * 255) + var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255) root.currentHue = hsv[0] root.currentSaturation = hsv[1] } @@ -459,16 +452,14 @@ Popup { radius: Style.radiusXXS * scaling color: modelData border.color: root.selectedColor === modelData ? Color.mPrimary : Color.mOutline - border.width: Math.max( - 1, root.selectedColor === modelData ? Style.borderM * scaling : Style.borderS * scaling) + border.width: Math.max(1, root.selectedColor === modelData ? Style.borderM * scaling : Style.borderS * scaling) MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor onClicked: { root.selectedColor = modelData - var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, - root.selectedColor.b * 255) + var hsv = root.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255) root.currentHue = hsv[0] root.currentSaturation = hsv[1] } diff --git a/Widgets/NComboBox.qml b/Widgets/NComboBox.qml index 52c6eb4..c0f096a 100644 --- a/Widgets/NComboBox.qml +++ b/Widgets/NComboBox.qml @@ -76,10 +76,8 @@ RowLayout { font.pointSize: Style.fontSizeM * scaling verticalAlignment: Text.AlignVCenter elide: Text.ElideRight - color: (combo.currentIndex >= 0 - && combo.currentIndex < root.model.count) ? Color.mOnSurface : Color.mOnSurfaceVariant - text: (combo.currentIndex >= 0 - && combo.currentIndex < root.model.count) ? root.model.get(combo.currentIndex).name : root.placeholder + color: (combo.currentIndex >= 0 && combo.currentIndex < root.model.count) ? Color.mOnSurface : Color.mOnSurfaceVariant + text: (combo.currentIndex >= 0 && combo.currentIndex < root.model.count) ? root.model.get(combo.currentIndex).name : root.placeholder } indicator: NIcon { diff --git a/Widgets/NPanel.qml b/Widgets/NPanel.qml index 2fcfe5d..a115c2b 100644 --- a/Widgets/NPanel.qml +++ b/Widgets/NPanel.qml @@ -142,8 +142,7 @@ Loader { property real scaling: ScalingService.getScreenScale(screen) readonly property real barHeight: Math.round(Style.barHeight * scaling) readonly property bool barAtBottom: Settings.data.bar.position === "bottom" - readonly property bool barIsVisible: (screen !== null) && (Settings.data.bar.monitors.includes(screen.name) - || (Settings.data.bar.monitors.length === 0)) + readonly property bool barIsVisible: (screen !== null) && (Settings.data.bar.monitors.includes(screen.name) || (Settings.data.bar.monitors.length === 0)) Connections { target: ScalingService @@ -169,8 +168,7 @@ Loader { visible: true // Dim desktop if required - color: (root.active && !root.isClosing - && Settings.data.general.dimDesktop) ? Qt.alpha(Color.mShadow, Style.opacityHeavy) : Color.transparent + color: (root.active && !root.isClosing && Settings.data.general.dimDesktop) ? Qt.alpha(Color.mShadow, Style.opacityHeavy) : Color.transparent WlrLayershell.exclusionMode: ExclusionMode.Ignore WlrLayershell.namespace: "noctalia-panel" diff --git a/Widgets/NScrollView.qml b/Widgets/NScrollView.qml index feec375..1edca1c 100644 --- a/Widgets/NScrollView.qml +++ b/Widgets/NScrollView.qml @@ -16,8 +16,7 @@ T.ScrollView { property int horizontalPolicy: ScrollBar.AsNeeded implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) ScrollBar.vertical: ScrollBar { parent: root diff --git a/Widgets/NSlider.qml b/Widgets/NSlider.qml index c4bd096..56216c9 100644 --- a/Widgets/NSlider.qml +++ b/Widgets/NSlider.qml @@ -44,8 +44,7 @@ Slider { height: knobDiameter + cutoutExtra radius: width / 2 color: root.cutoutColor !== undefined ? root.cutoutColor : Color.mSurface - x: Math.max(0, Math.min(parent.width - width, - root.visualPosition * (parent.width - root.knobDiameter) - cutoutExtra / 2)) + x: Math.max(0, Math.min(parent.width - width, root.visualPosition * (parent.width - root.knobDiameter) - cutoutExtra / 2)) y: (parent.height - height) / 2 } }