added touch support, changed appearance, new icons

This commit is contained in:
Brandon4466
2025-07-25 16:11:37 -07:00
parent ce7aef03f5
commit 427d855e59
8 changed files with 831 additions and 285 deletions

27
plex.py Normal file
View File

@@ -0,0 +1,27 @@
// Start polling for Plex now-playing details
checkPlexNowPlaying();
setInterval(checkPlexNowPlaying, 3000);
function checkPlexNowPlaying() {
const plexToken = "kbGwoiA_QEGzw7MgSZrY"; // <-- replace with your Plex token
const plexHost = "spyro.corp.bbrunson.com"; // <-- adjust if needed
const url = `http://${plexHost}:32400/status/sessions?X-Plex-Token=${plexToken}`;
http.get(url, (res) => {
let data = "";
res.on('data', chunk => data += chunk);
res.on('end', () => {
// For simplicity we check for a known tag in the XML response.
let nowPlaying = "No media playing";
if(data.includes("MediaContainer") && data.includes("Video")) {
nowPlaying = "Plex is playing media";
}
if(win){
win.webContents.send('plex-update', { details: nowPlaying });
}
});
}).on('error', err => {
console.error("Error fetching Plex now playing:", err);
});
}