Remove need for polkit, launch any ArchUpdater update through terminal

ArchUpdater: rely on `TERMINAL` environment variable
README: Add explanation for the `TERMINAL` environment variable
This commit is contained in:
Ly-sec 2025-08-30 02:28:48 +02:00
parent 5ab76c98e5
commit 299add4a15
19 changed files with 1232 additions and 799 deletions

View file

@ -17,14 +17,6 @@ Singleton {
}
}
function _getStackTrace() {
try {
throw new Error("Stack trace")
} catch (e) {
return e.stack
}
}
function log(...args) {
var msg = _formatMessage(...args)
console.log(msg)
@ -39,20 +31,4 @@ Singleton {
var msg = _formatMessage(...args)
console.error(msg)
}
function callStack() {
var stack = _getStackTrace()
Logger.log("Debug", "--------------------------")
Logger.log("Debug", "Current call stack")
// Split the stack into lines and log each one
var stackLines = stack.split('\n')
for (var i = 0; i < stackLines.length; i++) {
var line = stackLines[i].trim() // Remove leading/trailing whitespace
if (line.length > 0) {
// Only log non-empty lines
Logger.log("Debug", `- ${line}`)
}
}
Logger.log("Debug", "--------------------------")
}
}

View file

@ -89,16 +89,23 @@ Singleton {
reload()
}
onLoaded: function () {
if (!isLoaded) {
Logger.log("Settings", "----------------------------")
Logger.log("Settings", "Settings loaded successfully")
isLoaded = true
Qt.callLater(function () {
// Some stuff like wallpaper setup and settings validation should just be executed once on startup
// And not on every reload
if (!isLoaded) {
Logger.log("Settings", "JSON completed loading")
if (adapter.wallpaper.current !== "") {
Logger.log("Settings", "Set current wallpaper", adapter.wallpaper.current)
WallpaperService.setCurrentWallpaper(adapter.wallpaper.current, true)
}
Qt.callLater(function () {
// Some stuff like settings validation should just be executed once on startup and not on every reload
// Validate monitor configurations, only once
// if none of the configured monitors exist, clear the lists
validateMonitorConfigurations()
})
}
isLoaded = true
}
})
}
onLoadFailed: function (error) {
if (error.toString().includes("No such file") || error === 2)
@ -164,13 +171,22 @@ Singleton {
// wallpaper
property JsonObject wallpaper: JsonObject {
property string directory: "/usr/share/wallpapers"
property bool enableMultiMonitorDirectories: false
property bool setWallpaperOnAllMonitors: true
property bool randomEnabled: false
property int randomIntervalSec: 300 // 5 min
property int transitionDuration: 1500 // 1500 ms
property string transitionType: "fade"
property list<var> monitors: []
property string current: ""
property bool isRandom: false
property int randomInterval: 300
property JsonObject swww
onDirectoryChanged: WallpaperService.listWallpapers()
onIsRandomChanged: WallpaperService.toggleRandomWallpaper()
onRandomIntervalChanged: WallpaperService.restartRandomWallpaperTimer()
swww: JsonObject {
property bool enabled: false
property string resizeMethod: "crop"
property int transitionFps: 60
property string transitionType: "random"
property real transitionDuration: 1.1
}
}
// applauncher
@ -218,10 +234,19 @@ Singleton {
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
property list<var> monitorsScaling: []
// Legacy compatibility
property string fontFamily: fontDefault // Keep for backward compatibility
// Idle inhibitor state
property bool idleInhibitorEnabled: false
}
// Scaling (not stored inside JsonObject, or it crashes)
property var monitorsScaling: {
}
// brightness
property JsonObject brightness: JsonObject {
property int brightnessStep: 5