1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-07 14:05:38 -05:00
This commit is contained in:
purian23
2025-07-14 20:32:51 -04:00
3 changed files with 16 additions and 10 deletions

View File

@@ -34,7 +34,7 @@ Singleton {
Connections { Connections {
target: NiriWorkspaceService target: NiriWorkspaceService
function onFocusedWindowIdChanged() { function onFocusedWindowIdChanged() {
root.focusedWindowId = NiriWorkspaceService.focusedWindowId root.focusedWindowId = parseInt(NiriWorkspaceService.focusedWindowId) || -1
updateFocusedWindowData() updateFocusedWindowData()
} }
function onFocusedWindowTitleChanged() { function onFocusedWindowTitleChanged() {

View File

@@ -192,14 +192,18 @@ PanelWindow {
smooth: true smooth: true
asynchronous: true asynchronous: true
mipmap: true mipmap: true
cache: false cache: true
property string lastLoggedSource: ""
onStatusChanged: { onStatusChanged: {
console.log("Profile image status:", status, "source:", source) if (source !== lastLoggedSource && (status === Image.Ready || status === Image.Error)) {
if (status === Image.Ready) { lastLoggedSource = source
console.log("Image loaded successfully, size:", sourceSize.width + "x" + sourceSize.height) if (status === Image.Ready) {
} else if (status === Image.Error) { console.log("Profile image loaded successfully, size:", sourceSize.width + "x" + sourceSize.height)
console.log("Image failed to load") } else if (status === Image.Error) {
console.log("Profile image failed to load:", source)
}
} }
} }
} }

View File

@@ -11,6 +11,7 @@ Item {
property bool hasActiveMedia: false property bool hasActiveMedia: false
property var activePlayer: null property var activePlayer: null
property bool cavaAvailable: false property bool cavaAvailable: false
property bool configCreated: false
width: 20 width: 20
height: Theme.iconSize height: Theme.iconSize
@@ -21,10 +22,10 @@ Item {
running: true running: true
onExited: (exitCode) => { onExited: (exitCode) => {
root.cavaAvailable = exitCode === 0 root.cavaAvailable = exitCode === 0
if (root.cavaAvailable) { if (root.cavaAvailable && !root.configCreated) {
console.log("cava found - creating config and enabling real audio visualization") console.log("cava found - creating config and enabling real audio visualization")
configWriter.running = true configWriter.running = true
} else { } else if (!root.cavaAvailable) {
console.log("cava not found - using fallback animation") console.log("cava not found - using fallback animation")
fallbackTimer.running = Qt.binding(() => root.hasActiveMedia && root.activePlayer?.playbackState === MprisPlaybackState.Playing) fallbackTimer.running = Qt.binding(() => root.hasActiveMedia && root.activePlayer?.playbackState === MprisPlaybackState.Playing)
} }
@@ -33,7 +34,7 @@ Item {
Process { Process {
id: configWriter id: configWriter
running: root.cavaAvailable running: false
command: [ command: [
"sh", "-c", "sh", "-c",
`cat > /tmp/quickshell_cava_config << 'EOF' `cat > /tmp/quickshell_cava_config << 'EOF'
@@ -57,6 +58,7 @@ EOF`
] ]
onExited: { onExited: {
root.configCreated = true
if (root.cavaAvailable) { if (root.cavaAvailable) {
cavaProcess.running = Qt.binding(() => root.hasActiveMedia && root.activePlayer?.playbackState === MprisPlaybackState.Playing) cavaProcess.running = Qt.binding(() => root.hasActiveMedia && root.activePlayer?.playbackState === MprisPlaybackState.Playing)
} }