Add wallust support

This commit is contained in:
Ly-sec 2025-08-12 19:35:50 +02:00
parent 032547c46e
commit 37c3dacff4
11 changed files with 126 additions and 135 deletions

View file

@ -49,7 +49,7 @@ Singleton {
vol = 0
}
root._volume = vol
console.log("[Audio] onVolumeChanged: " + root._volume.toFixed(2))
}
function onMutedChanged() {

View file

@ -9,47 +9,113 @@ Singleton {
id: root
// Backgrounds
property color backgroundPrimary: themeData.backgroundPrimary
property color backgroundSecondary: themeData.backgroundSecondary
property color backgroundTertiary: themeData.backgroundTertiary
property color backgroundPrimary: useWallust ? wallustTheme.backgroundPrimary : defaultTheme.backgroundPrimary
property color backgroundSecondary: useWallust ? wallustTheme.backgroundSecondary : defaultTheme.backgroundSecondary
property color backgroundTertiary: useWallust ? wallustTheme.backgroundTertiary : defaultTheme.backgroundTertiary
// Surfaces & Elevation
property color surface: themeData.surface
property color surfaceVariant: themeData.surfaceVariant
property color surface: useWallust ? wallustTheme.surface : defaultTheme.surface
property color surfaceVariant: useWallust ? wallustTheme.surfaceVariant : defaultTheme.surfaceVariant
// Text Colors
property color textPrimary: themeData.textPrimary
property color textSecondary: themeData.textSecondary
property color textDisabled: themeData.textDisabled
property color textPrimary: useWallust ? wallustTheme.textPrimary : defaultTheme.textPrimary
property color textSecondary: useWallust ? wallustTheme.textSecondary : defaultTheme.textSecondary
property color textDisabled: useWallust ? wallustTheme.textDisabled : defaultTheme.textDisabled
// Accent Colors
property color accentPrimary: themeData.accentPrimary
property color accentSecondary: themeData.accentSecondary
property color accentTertiary: themeData.accentTertiary
property color accentPrimary: useWallust ? wallustTheme.accentPrimary : defaultTheme.accentPrimary
property color accentSecondary: useWallust ? wallustTheme.accentSecondary : defaultTheme.accentSecondary
property color accentTertiary: useWallust ? wallustTheme.accentTertiary : defaultTheme.accentTertiary
// Error/Warning
property color error: themeData.error
property color warning: themeData.warning
property color error: useWallust ? wallustTheme.error : defaultTheme.error
property color warning: useWallust ? wallustTheme.warning : defaultTheme.warning
// Hover
property color hover: themeData.hover
property color hover: useWallust ? wallustTheme.hover : defaultTheme.hover
// Additional Theme Properties
property color onAccent: themeData.onAccent
property color outline: themeData.outline
property color onAccent: useWallust ? wallustTheme.onAccent : defaultTheme.onAccent
property color outline: useWallust ? wallustTheme.outline : defaultTheme.outline
// Shadows & Overlays
property color shadow: applyOpacity(themeData.shadow, "B3")
property color overlay: applyOpacity(themeData.overlay, "66")
property color shadow: applyOpacity(useWallust ? wallustTheme.shadow : defaultTheme.shadow, "B3")
property color overlay: applyOpacity(useWallust ? wallustTheme.overlay : defaultTheme.overlay, "66")
// Check if we should use Wallust theme
property bool useWallust: Settings.data.wallpaper.generateTheme && wallustFile.loaded
function applyOpacity(color, opacity) {
return color.replace("#", "#" + opacity)
// Convert color to string and apply opacity
return color.toString().replace("#", "#" + opacity)
}
// FileView to load theme data from JSON file
// Default theme colors
QtObject {
id: defaultTheme
property color backgroundPrimary: "#191724"
property color backgroundSecondary: "#1f1d2e"
property color backgroundTertiary: "#26233a"
property color surface: "#1f1d2e"
property color surfaceVariant: "#37354c"
property color textPrimary: "#e0def4"
property color textSecondary: "#908caa"
property color textDisabled: "#6e6a86"
property color accentPrimary: "#ebbcba"
property color accentSecondary: "#31748f"
property color accentTertiary: "#9ccfd8"
property color error: "#eb6f92"
property color warning: "#f6c177"
property color hover: "#c4a7e7"
property color onAccent: "#191724"
property color outline: "#44415a"
property color shadow: "#191724"
property color overlay: "#191724"
}
// Wallust theme colors (loaded from Theme.json)
QtObject {
id: wallustTheme
property color backgroundPrimary: wallustData.backgroundPrimary
property color backgroundSecondary: wallustData.backgroundSecondary
property color backgroundTertiary: wallustData.backgroundTertiary
property color surface: wallustData.surface
property color surfaceVariant: wallustData.surfaceVariant
property color textPrimary: wallustData.textPrimary
property color textSecondary: wallustData.textSecondary
property color textDisabled: wallustData.textDisabled
property color accentPrimary: wallustData.accentPrimary
property color accentSecondary: wallustData.accentSecondary
property color accentTertiary: wallustData.accentTertiary
property color error: wallustData.error
property color warning: wallustData.warning
property color hover: wallustData.hover
property color onAccent: wallustData.onAccent
property color outline: wallustData.outline
property color shadow: wallustData.shadow
property color overlay: wallustData.overlay
}
// FileView to load Wallust theme data from Theme.json
FileView {
id: themeFile
path: Settings.colorsFile
id: wallustFile
path: Settings.configDir + "Theme.json"
watchChanges: true
onFileChanged: reload()
onAdapterUpdated: writeAdapter()
@ -60,7 +126,7 @@ Singleton {
}
}
JsonAdapter {
id: themeData
id: wallustData
// Backgrounds
property string backgroundPrimary: "#191724"

View file

@ -53,7 +53,7 @@ Singleton {
onLoaded: function () {
Qt.callLater(function () {
if (adapter.wallpaper.current !== "") {
console.log("Settings: Initializing wallpaper to:", adapter.wallpaper.current)
Wallpapers.setCurrentWallpaper(adapter.wallpaper.current, true)
}
})

View file

@ -39,7 +39,7 @@ Singleton {
}
function setCurrentWallpaper(path, isInitial) {
console.log("Wallpapers: Setting wallpaper to:", path, "isInitial:", isInitial)
currentWallpaper = path
if (!isInitial) {
Settings.data.wallpaper.current = path
@ -50,7 +50,7 @@ Singleton {
} else {
transitionType = Settings.data.wallpaper.swww.transitionType
}
console.log("SWWW: Changing wallpaper with transition type:", transitionType)
changeWallpaperProcess.running = true
} else {
// Fallback: update the settings directly for non-SWWW mode
@ -140,11 +140,11 @@ Singleton {
running: false
onStarted: {
console.log("SWWW: Process started with command:", command.join(" "))
}
onExited: function(exitCode, exitStatus) {
console.log("SWWW: Process finished with exit code:", exitCode, "status:", exitStatus)
if (exitCode !== 0) {
console.log("SWWW: Process failed. Make sure swww-daemon is running with: swww-daemon")
console.log("SWWW: You can start it with: swww-daemon --format xrgb")
@ -154,7 +154,7 @@ Singleton {
Process {
id: generateThemeProcess
command: ["wallust", "run", currentWallpaper, "-u", "-k", "-d", "Templates"]
command: ["wallust", "run", currentWallpaper, "-u", "-k", "-d", "Assets/Wallust"]
workingDirectory: Quickshell.shellDir
running: false
}