Merge branch 'noctalia-dev:main' into fix/heuristic-lookup

This commit is contained in:
Kainoa Kanter 2025-08-24 21:34:47 -07:00 committed by GitHub
commit 81182aa65b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 2680 additions and 1646 deletions

View file

@ -1,9 +1,10 @@
pragma Singleton
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Services
pragma Singleton
Singleton {
id: root
@ -116,9 +117,7 @@ Singleton {
id: adapter
// bar
property JsonObject bar
bar: JsonObject {
property JsonObject bar: JsonObject {
property string position: "top" // Possible values: "top", "bottom"
property bool showActiveWindowIcon: true
property bool alwaysShowBatteryPercentage: false
@ -130,14 +129,12 @@ Singleton {
widgets: JsonObject {
property list<string> left: ["SystemMonitor", "ActiveWindow", "MediaMini"]
property list<string> center: ["Workspace"]
property list<string> right: ["ScreenRecorderIndicator", "Tray", "NotificationHistory", "WiFi", "Bluetooth", "Battery", "Volume", "Brightness", "Clock", "SidePanelToggle"]
property list<string> right: ["ScreenRecorderIndicator", "Tray", "ArchUpdater", "NotificationHistory", "WiFi", "Bluetooth", "Battery", "Volume", "Brightness", "Clock", "SidePanelToggle"]
}
}
// general
property JsonObject general
general: JsonObject {
property JsonObject general: JsonObject {
property string avatarImage: defaultAvatar
property bool dimDesktop: false
property bool showScreenCorners: false
@ -145,9 +142,7 @@ Singleton {
}
// location
property JsonObject location
location: JsonObject {
property JsonObject location: JsonObject {
property string name: "Tokyo"
property bool useFahrenheit: false
property bool reverseDayMonth: false
@ -156,9 +151,7 @@ Singleton {
}
// screen recorder
property JsonObject screenRecorder
screenRecorder: JsonObject {
property JsonObject screenRecorder: JsonObject {
property string directory: "~/Videos"
property int frameRate: 60
property string audioCodec: "opus"
@ -171,9 +164,7 @@ Singleton {
}
// wallpaper
property JsonObject wallpaper
wallpaper: JsonObject {
property JsonObject wallpaper: JsonObject {
property string directory: "/usr/share/wallpapers"
property string current: ""
property bool isRandom: false
@ -194,9 +185,7 @@ Singleton {
}
// applauncher
property JsonObject appLauncher
appLauncher: JsonObject {
property JsonObject appLauncher: JsonObject {
// When disabled, Launcher hides clipboard command and ignores cliphist
property bool enableClipboardHistory: true
// Position: center, top_left, top_right, bottom_left, bottom_right
@ -205,43 +194,34 @@ Singleton {
}
// dock
property JsonObject dock
dock: JsonObject {
property JsonObject dock: JsonObject {
property bool autoHide: false
property bool exclusive: false
property list<string> monitors: []
}
// network
property JsonObject network
network: JsonObject {
property JsonObject network: JsonObject {
property bool wifiEnabled: true
property bool bluetoothEnabled: true
}
// notifications
property JsonObject notifications
notifications: JsonObject {
property JsonObject notifications: JsonObject {
property list<string> monitors: []
}
// audio
property JsonObject audio
audio: JsonObject {
property JsonObject audio: JsonObject {
property bool showMiniplayerAlbumArt: false
property bool showMiniplayerCava: false
property string visualizerType: "linear"
property int volumeStep: 5
property int cavaFrameRate: 60
}
// ui
property JsonObject ui
ui: JsonObject {
property JsonObject ui: JsonObject {
property string fontDefault: "Roboto" // Default font for all text
property string fontFixed: "DejaVu Sans Mono" // Fixed width font for terminal
property string fontBillboard: "Inter" // Large bold font for clocks and prominent displays
@ -259,15 +239,11 @@ Singleton {
}
// brightness
property JsonObject brightness
brightness: JsonObject {
property JsonObject brightness: JsonObject {
property int brightnessStep: 5
}
property JsonObject colorSchemes
colorSchemes: JsonObject {
property JsonObject colorSchemes: JsonObject {
property bool useWallpaperColors: false
property string predefinedScheme: ""
property bool darkMode: true

View file

@ -1,88 +0,0 @@
import QtQuick
import qs.Commons
QtObject {
id: root
// Signal emitted when widget loading status changes
signal widgetLoaded(string widgetName)
signal widgetFailed(string widgetName, string error)
signal loadingComplete(int total, int loaded, int failed)
// Properties to track loading status
property int totalWidgets: 0
property int loadedWidgets: 0
property int failedWidgets: 0
// Auto-discover widget components
function getWidgetComponent(widgetName) {
if (!widgetName || widgetName.trim() === "") {
return null
}
const widgetPath = `../Modules/Bar/Widgets/${widgetName}.qml`
// Try to load the widget directly from file
const component = Qt.createComponent(widgetPath)
if (component.status === Component.Ready) {
return component
}
const errorMsg = `Failed to load ${widgetName}.qml widget, status: ${component.status}, error: ${component.errorString(
)}`
Logger.error("WidgetLoader", errorMsg)
return null
}
// Initialize loading tracking
function initializeLoading(widgetList) {
totalWidgets = widgetList.length
loadedWidgets = 0
failedWidgets = 0
}
// Track widget loading success
function onWidgetLoaded(widgetName) {
loadedWidgets++
widgetLoaded(widgetName)
if (loadedWidgets + failedWidgets === totalWidgets) {
Logger.log("WidgetLoader", `Loaded ${loadedWidgets} widgets`)
loadingComplete(totalWidgets, loadedWidgets, failedWidgets)
}
}
// Track widget loading failure
function onWidgetFailed(widgetName, error) {
failedWidgets++
widgetFailed(widgetName, error)
if (loadedWidgets + failedWidgets === totalWidgets) {
loadingComplete(totalWidgets, loadedWidgets, failedWidgets)
}
}
// This is where you should add your Modules/Bar/Widgets/
// so it gets registered in the BarTab
function discoverAvailableWidgets() {
const widgetFiles = ["ActiveWindow", "Battery", "Bluetooth", "Brightness", "Clock", "MediaMini", "NotificationHistory", "ScreenRecorderIndicator", "SidePanelToggle", "SystemMonitor", "Tray", "Volume", "WiFi", "Workspace"]
const availableWidgets = []
widgetFiles.forEach(widgetName => {
// Test if the widget can be loaded
const component = getWidgetComponent(widgetName)
if (component) {
availableWidgets.push({
"key": widgetName,
"name": widgetName
})
}
})
// Sort alphabetically
availableWidgets.sort((a, b) => a.name.localeCompare(b.name))
return availableWidgets
}
}