mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 21:28:06 +00:00
feat: osdlyrics desktop lyrics support
This commit is contained in:
parent
ce778afff6
commit
022f740c3f
9 changed files with 99 additions and 2 deletions
|
|
@ -32,6 +32,7 @@ import express from 'express';
|
|||
import expressProxy from 'express-http-proxy';
|
||||
import Store from 'electron-store';
|
||||
import { createMpris } from '@/electron/mpris';
|
||||
import { spawn } from 'child_process';
|
||||
const clc = require('cli-color');
|
||||
const log = text => {
|
||||
console.log(`${clc.blueBright('[background.js]')} ${text}`);
|
||||
|
|
@ -420,6 +421,20 @@ class Background {
|
|||
registerGlobalShortcut(this.window, this.store);
|
||||
}
|
||||
|
||||
// try to start osdlyrics process on start
|
||||
if (this.store.get('settings.enableOsdlyricsSupport')) {
|
||||
log('try to start osdlyrics process');
|
||||
const osdlyricsProcess = spawn('osdlyrics');
|
||||
|
||||
osdlyricsProcess.on('error', err => {
|
||||
log(`failed to start osdlyrics: ${err.message}`);
|
||||
});
|
||||
|
||||
osdlyricsProcess.on('exit', (code, signal) => {
|
||||
log(`osdlyrics process exited with code ${code}, signal ${signal}`);
|
||||
});
|
||||
}
|
||||
|
||||
// create mpris
|
||||
if (isCreateMpris) {
|
||||
createMpris(this.window);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue