Initial commit — DANCEBOT-9000 KDE Plasma wallpaper plugin
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
c5668b8d62
6 changed files with 1220 additions and 0 deletions
1050
plugin/contents/ui/dancer.html
Normal file
1050
plugin/contents/ui/dancer.html
Normal file
File diff suppressed because it is too large
Load diff
44
plugin/contents/ui/main.qml
Normal file
44
plugin/contents/ui/main.qml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import QtQuick 2.0
|
||||
import QtWebEngine 1.10
|
||||
import org.kde.plasma.core
|
||||
import org.kde.plasma.plasmoid
|
||||
import org.kde.plasma.plasma5support as Plasma5Support
|
||||
|
||||
WallpaperItem {
|
||||
id: root
|
||||
|
||||
WebEngineView {
|
||||
id: webView
|
||||
anchors.fill: parent
|
||||
url: Qt.resolvedUrl("dancer.html")
|
||||
backgroundColor: "#000814"
|
||||
|
||||
settings {
|
||||
javascriptEnabled: true
|
||||
localContentCanAccessFileUrls: true
|
||||
localStorageEnabled: false
|
||||
}
|
||||
|
||||
onContextMenuRequested: function(request) {
|
||||
request.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
// Polls playerctl every 2s and injects music info into the page
|
||||
Plasma5Support.DataSource {
|
||||
id: musicSource
|
||||
engine: "executable"
|
||||
connectedSources: ["playerctl metadata --format '{{artist}}||{{title}}' 2>/dev/null || echo '||'"]
|
||||
interval: 2000
|
||||
|
||||
onNewData: function(sourceName, data) {
|
||||
var raw = data["stdout"].trim()
|
||||
var sep = raw.indexOf("||")
|
||||
var artist = sep >= 0 ? raw.substring(0, sep) : ""
|
||||
var title = sep >= 0 ? raw.substring(sep + 2) : raw
|
||||
webView.runJavaScript(
|
||||
"updateMusic(" + JSON.stringify(artist) + "," + JSON.stringify(title) + ")"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
18
plugin/metadata.json
Normal file
18
plugin/metadata.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"KPackageStructure": "Plasma/Wallpaper",
|
||||
"KPlugin": {
|
||||
"Authors": [
|
||||
{
|
||||
"Email": "ltadeu6@gmail.com",
|
||||
"Name": "Vini"
|
||||
}
|
||||
],
|
||||
"Category": "Wallpaper",
|
||||
"Description": "Animated dancing robot character — DANCEBOT-9000",
|
||||
"Id": "com.vini.dancingcharacter",
|
||||
"License": "GPL-2.0-or-later",
|
||||
"Name": "Dancing Character",
|
||||
"Version": "1.0"
|
||||
},
|
||||
"X-Plasma-API-Minimum-Version": "6.0"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue