Regenerated

This commit is contained in:
2026-04-13 11:46:17 +02:00
parent cfa33e527d
commit da6102a3ad
3 changed files with 365 additions and 398 deletions
+343 -354
View File
File diff suppressed because it is too large Load Diff
+11 -22
View File
@@ -2653,7 +2653,6 @@ ShellRoot {
readonly property color lavender: "#b4befe"
}
// State
QtObject {
id: media
property string artist: ""
@@ -2666,12 +2665,10 @@ ShellRoot {
property real progress: 0.0
property real duration: 0.0
property real position: 0.0
// 0 = no shuffle, 1 = shuffle
property int shuffleMode: 0
readonly property bool isSpotify: player.indexOf("spotify") !== -1
}
// Poll playerctl every second
Timer {
interval: 1000
running: true
@@ -2690,7 +2687,6 @@ ShellRoot {
}
}
// Detect active player — prefers spotify
Process {
id: playerProc
command: ["playerctl", "-l"]
@@ -2754,14 +2750,12 @@ ShellRoot {
}
}
// Read shuffle state from playerctl
Process {
id: shuffleProc
command: ["playerctl", "--player=" + media.player, "shuffle"]
stdout: StdioCollector {
onStreamFinished: {
if (media.shuffleMode !== 2)
media.shuffleMode = (text.trim() === "On") ? 1 : 0
media.shuffleMode = (text.trim() === "On") ? 1 : 0
}
}
}
@@ -2778,21 +2772,18 @@ ShellRoot {
shuffleOnProc.running = true
}
// Focus / open the active player app
// Focus spotify — uses exact lowercase class as reported by hyprctl
Process {
id: focusProc
command: ["bash", "-c",
media.isSpotify
? "hyprctl dispatch focuswindow class:^(Spotify)$ 2>/dev/null || spotify &"
: "hyprctl dispatch focuswindow class:^(" + media.player.split('.')[0] + ")$ 2>/dev/null || " + media.player.split('.')[0].toLowerCase() + " &"
]
id: focusSpotifyProc
command: ["hyprctl", "dispatch", "focuswindow", "class:^(spotify)$"]
}
function focusPlayer() {
focusProc.running = true
if (media.isSpotify) {
focusSpotifyProc.running = true
}
}
// Playback controls
Process { id: prevProc; command: ["playerctl", "previous"] }
Process { id: playProc; command: ["playerctl", "play-pause"] }
Process { id: nextProc; command: ["playerctl", "next"] }
@@ -2802,8 +2793,7 @@ ShellRoot {
title: "quickshell-media"
visible: true
implicitWidth: 300
implicitHeight: 440
property bool isFocused: Window.active
implicitHeight: 420
color: "transparent"
Shortcut {
@@ -2811,13 +2801,13 @@ ShellRoot {
onActivated: Qt.quit()
}
// Gradient border — hidden when window has focus
// Gradient border — hidden when app has focus
Rectangle {
anchors.fill: parent
anchors.margins: -2
radius: 18
z: -1
opacity: root.isFocused ? 0 : 1
opacity: Qt.application.active ? 0 : 1
Behavior on opacity {
NumberAnimation { duration: 150 }
}
@@ -2970,8 +2960,7 @@ ShellRoot {
anchors.centerIn: parent
text: "󰒟"
font.pixelSize: 18
color: media.shuffleMode === 0 ? colors.surface2
: colors.blue
color: media.shuffleMode === 0 ? colors.surface2 : colors.blue
}
MouseArea {
@@ -24,7 +24,6 @@ ShellRoot {
readonly property color lavender: "#b4befe"
}
// State
QtObject {
id: media
property string artist: ""
@@ -37,12 +36,10 @@ ShellRoot {
property real progress: 0.0
property real duration: 0.0
property real position: 0.0
// 0 = no shuffle, 1 = shuffle
property int shuffleMode: 0
readonly property bool isSpotify: player.indexOf("spotify") !== -1
}
// Poll playerctl every second
Timer {
interval: 1000
running: true
@@ -61,7 +58,6 @@ ShellRoot {
}
}
// Detect active player — prefers spotify
Process {
id: playerProc
command: ["playerctl", "-l"]
@@ -125,14 +121,12 @@ ShellRoot {
}
}
// Read shuffle state from playerctl
Process {
id: shuffleProc
command: ["playerctl", "--player=" + media.player, "shuffle"]
stdout: StdioCollector {
onStreamFinished: {
if (media.shuffleMode !== 2)
media.shuffleMode = (text.trim() === "On") ? 1 : 0
media.shuffleMode = (text.trim() === "On") ? 1 : 0
}
}
}
@@ -149,21 +143,18 @@ ShellRoot {
shuffleOnProc.running = true
}
// Focus / open the active player app
// Focus spotify — uses exact lowercase class as reported by hyprctl
Process {
id: focusProc
command: ["bash", "-c",
media.isSpotify
? "hyprctl dispatch focuswindow class:^(Spotify)$ 2>/dev/null || spotify &"
: "hyprctl dispatch focuswindow class:^(" + media.player.split('.')[0] + ")$ 2>/dev/null || " + media.player.split('.')[0].toLowerCase() + " &"
]
id: focusSpotifyProc
command: ["hyprctl", "dispatch", "focuswindow", "class:^(spotify)$"]
}
function focusPlayer() {
focusProc.running = true
if (media.isSpotify) {
focusSpotifyProc.running = true
}
}
// Playback controls
Process { id: prevProc; command: ["playerctl", "previous"] }
Process { id: playProc; command: ["playerctl", "play-pause"] }
Process { id: nextProc; command: ["playerctl", "next"] }
@@ -173,8 +164,7 @@ ShellRoot {
title: "quickshell-media"
visible: true
implicitWidth: 300
implicitHeight: 440
property bool isFocused: Window.active
implicitHeight: 420
color: "transparent"
Shortcut {
@@ -182,13 +172,13 @@ ShellRoot {
onActivated: Qt.quit()
}
// Gradient border — hidden when window has focus
// Gradient border — hidden when app has focus
Rectangle {
anchors.fill: parent
anchors.margins: -2
radius: 18
z: -1
opacity: root.isFocused ? 0 : 1
opacity: Qt.application.active ? 0 : 1
Behavior on opacity {
NumberAnimation { duration: 150 }
}
@@ -341,8 +331,7 @@ ShellRoot {
anchors.centerIn: parent
text: "󰒟"
font.pixelSize: 18
color: media.shuffleMode === 0 ? colors.surface2
: colors.blue
color: media.shuffleMode === 0 ? colors.surface2 : colors.blue
}
MouseArea {