refactor: replace keybind toggle with config checkbox for skeleton visibility

Removes the pynput/curl-based shortcut approach in favour of a plain
Plasma wallpaper config checkbox (ShowSkeleton). QML reads the setting
on page load and on change, calling setShowSkeleton() in JS directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ltadeu6 2026-06-10 15:00:44 -03:00
parent 02edf4d9af
commit 71845ff2a7
No known key found for this signature in database
GPG key ID: FB9FDAB6B6F3418D
4 changed files with 58 additions and 4 deletions

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfgfile name=""/>
<group name="General">
<entry name="ShowSkeleton" type="Bool">
<default>true</default>
</entry>
</group>
</kcfg>

View file

@ -0,0 +1,22 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import org.kde.kirigami 2.20 as Kirigami
ColumnLayout {
id: root
property alias cfg_ShowSkeleton: skeletonCheck.checked
spacing: Kirigami.Units.largeSpacing
Kirigami.FormLayout {
Layout.fillWidth: true
CheckBox {
id: skeletonCheck
Kirigami.FormData.label: i18n("Esqueleto:")
text: i18n("Mostrar o robô dançando")
}
}
}

View file

@ -1172,12 +1172,19 @@ function applyTheme(rgb) {
}); });
} }
const albumArtEl = document.getElementById('albumArt'); const albumArtEl = document.getElementById('albumArt');
const fogWisps = document.querySelectorAll('.fog-wisp'); const fogWisps = document.querySelectorAll('.fog-wisp');
const lyricDisplay = document.getElementById('lyricDisplay'); const lyricDisplay = document.getElementById('lyricDisplay');
const lyricInner = document.getElementById('lyricInner'); const lyricInner = document.getElementById('lyricInner');
const robotWrap = document.querySelector('.robot-wrap');
let lastArtUrl = ''; let lastArtUrl = '';
let showSkeleton = true;
function setShowSkeleton(val) {
showSkeleton = val;
robotWrap.style.opacity = (isPlaying && showSkeleton) ? '1' : '0';
}
/* ── verse display ── */ /* ── verse display ── */
const ACTIVE_SHADOW = const ACTIVE_SHADOW =
@ -1340,7 +1347,7 @@ function updateMusic(artist, title) {
const sepEl = document.getElementById('musicSep'); const sepEl = document.getElementById('musicSep');
const playing = !!(artist || title); const playing = !!(artist || title);
isPlaying = playing; isPlaying = playing;
document.querySelector('.robot-wrap').style.opacity = playing ? '1' : '0'; robotWrap.style.opacity = (playing && showSkeleton) ? '1' : '0';
document.querySelector('.music-ticker').style.opacity = playing ? '1' : '0'; document.querySelector('.music-ticker').style.opacity = playing ? '1' : '0';
albumArtEl.style.opacity = playing ? '1' : '0'; albumArtEl.style.opacity = playing ? '1' : '0';
if (!playing) { if (!playing) {

View file

@ -7,6 +7,15 @@ import org.kde.plasma.plasma5support as Plasma5Support
WallpaperItem { WallpaperItem {
id: root id: root
function applyConfig() {
webView.runJavaScript("setShowSkeleton(" + Plasmoid.configuration.ShowSkeleton + ")")
}
Connections {
target: Plasmoid.configuration
function onShowSkeletonChanged() { applyConfig() }
}
WebEngineView { WebEngineView {
id: webView id: webView
anchors.fill: parent anchors.fill: parent
@ -24,6 +33,10 @@ WallpaperItem {
request.accepted = true request.accepted = true
} }
onLoadingChanged: function(loadRequest) {
if (loadRequest.status === WebEngineLoadRequest.LoadSucceededStatus)
applyConfig()
}
} }
// Start CAVA on load // Start CAVA on load