mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2025-12-06 06:36:15 +00:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9168eba07b | ||
|
|
5d11e37687 | ||
|
|
4ea903b333 | ||
|
|
8fd805815d | ||
|
|
c055690a9b | ||
|
|
dcf146a097 | ||
|
|
e3f50c0ce2 | ||
|
|
c394368dc5 | ||
|
|
1f9c54438a | ||
|
|
f303f305af | ||
|
|
5f1f3dce4a | ||
|
|
f84889ca13 | ||
|
|
b778a80c79 | ||
|
|
0bf632a4b1 | ||
|
|
321c513682 |
@@ -35,6 +35,7 @@ Singleton {
|
||||
// Signal emitted when settings are loaded after startupcale changes
|
||||
signal settingsLoaded
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Function to validate monitor configurations
|
||||
function validateMonitorConfigurations() {
|
||||
var availableScreenNames = []
|
||||
@@ -55,17 +56,67 @@ Singleton {
|
||||
}
|
||||
}
|
||||
if (!hasValidBarMonitor) {
|
||||
Logger.log("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 {
|
||||
Logger.log("Settings", "Found valid bar monitors, keeping configuration")
|
||||
|
||||
//Logger.log("Settings", "Found valid bar monitors, keeping configuration")
|
||||
}
|
||||
} else {
|
||||
Logger.log("Settings", "Bar monitor list is empty, will show on all available screens")
|
||||
|
||||
//Logger.log("Settings", "Bar monitor list is empty, will show on all available screens")
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// If the settings structure has changed, ensure
|
||||
// backward compatibility
|
||||
function upgradeSettingsData() {
|
||||
for (var i = 0; i < adapter.bar.widgets.left.length; i++) {
|
||||
var obj = adapter.bar.widgets.left[i]
|
||||
if (typeof obj === "string") {
|
||||
adapter.bar.widgets.left[i] = {
|
||||
"id": obj
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < adapter.bar.widgets.center.length; i++) {
|
||||
var obj = adapter.bar.widgets.center[i]
|
||||
if (typeof obj === "string") {
|
||||
adapter.bar.widgets.center[i] = {
|
||||
"id": obj
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < adapter.bar.widgets.right.length; i++) {
|
||||
var obj = adapter.bar.widgets.right[i]
|
||||
if (typeof obj === "string") {
|
||||
adapter.bar.widgets.right[i] = {
|
||||
"id": obj
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Kickoff essential services
|
||||
function kickOffServices() {
|
||||
// Ensure our location singleton is created as soon as possible so we start fetching weather asap
|
||||
LocationService.init()
|
||||
|
||||
NightLightService.apply()
|
||||
|
||||
ColorSchemeService.init()
|
||||
|
||||
MatugenService.init()
|
||||
|
||||
FontService.init()
|
||||
|
||||
HooksService.init()
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
Item {
|
||||
Component.onCompleted: {
|
||||
|
||||
@@ -100,46 +151,14 @@ Singleton {
|
||||
Logger.log("Settings", "Settings loaded successfully")
|
||||
isLoaded = true
|
||||
|
||||
for (var i = 0; i < adapter.bar.widgets.left.length; i++) {
|
||||
var obj = adapter.bar.widgets.left[i]
|
||||
if (typeof obj === "string") {
|
||||
adapter.bar.widgets.left[i] = {
|
||||
"id": obj
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < adapter.bar.widgets.center.length; i++) {
|
||||
var obj = adapter.bar.widgets.center[i]
|
||||
if (typeof obj === "string") {
|
||||
adapter.bar.widgets.center[i] = {
|
||||
"id": obj
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < adapter.bar.widgets.right.length; i++) {
|
||||
var obj = adapter.bar.widgets.right[i]
|
||||
if (typeof obj === "string") {
|
||||
adapter.bar.widgets.right[i] = {
|
||||
"id": obj
|
||||
}
|
||||
}
|
||||
}
|
||||
upgradeSettingsData()
|
||||
|
||||
validateMonitorConfigurations()
|
||||
|
||||
kickOffServices()
|
||||
|
||||
// Emit the signal
|
||||
root.settingsLoaded()
|
||||
|
||||
// Kickoff ColorScheme service
|
||||
ColorSchemeService.init()
|
||||
|
||||
// Kickoff Matugen service
|
||||
MatugenService.init()
|
||||
|
||||
// Kickoff Font service
|
||||
FontService.init()
|
||||
|
||||
Qt.callLater(function () {
|
||||
validateMonitorConfigurations()
|
||||
})
|
||||
}
|
||||
}
|
||||
onLoadFailed: function (error) {
|
||||
|
||||
@@ -39,6 +39,7 @@ NIconButton {
|
||||
|| BarWidgetRegistry.widgetMetadata["CustomButton"].middleClickExec
|
||||
readonly property bool hasExec: (userLeftClickExec || userRightClickExec || userMiddleClickExec)
|
||||
|
||||
sizeRatio: 0.8
|
||||
icon: userIcon
|
||||
tooltipText: {
|
||||
if (!hasExec) {
|
||||
|
||||
24
Modules/Bar/Widgets/KeepAwake.qml
Normal file
24
Modules/Bar/Widgets/KeepAwake.qml
Normal file
@@ -0,0 +1,24 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
NIconButton {
|
||||
id: root
|
||||
|
||||
property ShellScreen screen
|
||||
property real scaling: 1.0
|
||||
|
||||
sizeRatio: 0.8
|
||||
|
||||
icon: "coffee"
|
||||
tooltipText: IdleInhibitorService.isInhibited ? "Disable keep awake" : "Enable keep awake"
|
||||
colorBg: Color.mSurfaceVariant
|
||||
colorFg: IdleInhibitorService.isInhibited ? Color.mPrimary : Color.mOnSurface
|
||||
colorBorder: Color.transparent
|
||||
onClicked: {
|
||||
IdleInhibitorService.manualToggle()
|
||||
}
|
||||
}
|
||||
23
Modules/Bar/Widgets/PowerToggle.qml
Normal file
23
Modules/Bar/Widgets/PowerToggle.qml
Normal file
@@ -0,0 +1,23 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
NIconButton {
|
||||
id: root
|
||||
|
||||
property ShellScreen screen
|
||||
property real scaling: 1.0
|
||||
|
||||
sizeRatio: 0.8
|
||||
|
||||
icon: "power_settings_new"
|
||||
tooltipText: "Power Settings"
|
||||
colorBg: Color.mSurfaceVariant
|
||||
colorFg: Color.mError
|
||||
colorBorder: Color.transparent
|
||||
colorBorderHover: Color.transparent
|
||||
onClicked: PanelService.getPanel("powerPanel")?.toggle(screen)
|
||||
}
|
||||
@@ -22,6 +22,7 @@ NIconButton {
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onClicked: PanelService.getPanel("sidePanel")?.toggle(screen)
|
||||
onRightClicked: PanelService.getPanel("settingsPanel")?.toggle(screen)
|
||||
|
||||
// When enabled, draw the distro logo instead of the icon glyph
|
||||
IconImage {
|
||||
|
||||
@@ -141,9 +141,9 @@ NPanel {
|
||||
const clipboardPlugin = Qt.createComponent("Plugins/ClipboardPlugin.qml").createObject(this)
|
||||
if (clipboardPlugin) {
|
||||
registerPlugin(clipboardPlugin)
|
||||
Logger.log("Launcher", "Registered: clipboardPlugin")
|
||||
Logger.log("Launcher", "Registered: ClipboardPlugin")
|
||||
} else {
|
||||
Logger.error("Launcher", "Failed to load clipboardPlugin")
|
||||
Logger.error("Launcher", "Failed to load ClipboardPlugin")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ NPanel {
|
||||
}, {
|
||||
"id": SettingsPanel.Tab.Hooks,
|
||||
"label": "Hooks",
|
||||
"icon": "link",
|
||||
"icon": "cable",
|
||||
"source": hooksTab
|
||||
}, {
|
||||
"id": SettingsPanel.Tab.About,
|
||||
|
||||
@@ -18,12 +18,14 @@ Singleton {
|
||||
"Clock": clockComponent,
|
||||
"CustomButton": customButtonComponent,
|
||||
"DarkModeToggle": darkModeToggle,
|
||||
"KeepAwake": keepAwakeComponent,
|
||||
"KeyboardLayout": keyboardLayoutComponent,
|
||||
"MediaMini": mediaMiniComponent,
|
||||
"Microphone": microphoneComponent,
|
||||
"NightLight": nightLightComponent,
|
||||
"NotificationHistory": notificationHistoryComponent,
|
||||
"PowerProfile": powerProfileComponent,
|
||||
"PowerToggle": powerToggleComponent,
|
||||
"ScreenRecorderIndicator": screenRecorderIndicatorComponent,
|
||||
"SidePanelToggle": sidePanelToggleComponent,
|
||||
"SystemMonitor": systemMonitorComponent,
|
||||
@@ -72,6 +74,9 @@ Singleton {
|
||||
property Component keyboardLayoutComponent: Component {
|
||||
KeyboardLayout {}
|
||||
}
|
||||
property Component keepAwakeComponent: Component {
|
||||
KeepAwake {}
|
||||
}
|
||||
property Component mediaMiniComponent: Component {
|
||||
MediaMini {}
|
||||
}
|
||||
@@ -87,6 +92,9 @@ Singleton {
|
||||
property Component powerProfileComponent: Component {
|
||||
PowerProfile {}
|
||||
}
|
||||
property Component powerToggleComponent: Component {
|
||||
PowerToggle {}
|
||||
}
|
||||
property Component screenRecorderIndicatorComponent: Component {
|
||||
ScreenRecorderIndicator {}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,13 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: WallpaperService
|
||||
function onWallpaperChanged(screenName, path) {
|
||||
executeWallpaperHook(path, screenName)
|
||||
}
|
||||
}
|
||||
|
||||
// Execute wallpaper change hook
|
||||
function executeWallpaperHook(wallpaperPath, screenName) {
|
||||
if (!Settings.data.hooks?.enabled) {
|
||||
|
||||
@@ -8,10 +8,10 @@ Singleton {
|
||||
id: root
|
||||
|
||||
// Public properties
|
||||
property string baseVersion: "v2.5.0"
|
||||
property bool isRelease: true
|
||||
property string baseVersion: "2.5.0"
|
||||
property bool isDevelopment: true
|
||||
|
||||
property string currentVersion: isRelease ? baseVersion : baseVersion + "-dev"
|
||||
property string currentVersion: `v${!isDevelopment ? baseVersion : baseVersion + "-dev"}`
|
||||
|
||||
// Internal helpers
|
||||
function getVersion() {
|
||||
|
||||
@@ -286,11 +286,6 @@ Singleton {
|
||||
// Emit signal for this specific wallpaper change
|
||||
root.wallpaperChanged(screenName, path)
|
||||
|
||||
// Execute wallpaper change hook after the change is complete
|
||||
if (HooksService) {
|
||||
HooksService.executeWallpaperHook(path, screenName)
|
||||
}
|
||||
|
||||
// Restart the random wallpaper timer
|
||||
if (randomWallpaperTimer.running) {
|
||||
randomWallpaperTimer.restart()
|
||||
|
||||
12
shell.qml
12
shell.qml
@@ -103,17 +103,5 @@ ShellRoot {
|
||||
Component.onCompleted: {
|
||||
// Save a ref. to our lockScreen so we can access it easily
|
||||
PanelService.lockScreen = lockScreen
|
||||
|
||||
// Ensure our location singleton is created as soon as possible so we start fetching weather asap
|
||||
LocationService.init()
|
||||
|
||||
// Initialize UpdateService
|
||||
UpdateService.init()
|
||||
|
||||
// Initialize HooksService
|
||||
HooksService.init()
|
||||
|
||||
// Kickoff NightLight service
|
||||
NightLightService.apply()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user