mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
migrate from remote to ipc
This commit is contained in:
@ -4,6 +4,17 @@ This is used to determine if plugin is actually active
|
||||
*/
|
||||
let enabled = false;
|
||||
|
||||
module.exports = () => enabled = true;
|
||||
const { globalShortcut } = require('electron');
|
||||
|
||||
module.exports = (win, options) => {
|
||||
enabled = true;
|
||||
|
||||
if (options.globalShortcuts?.volumeUp) {
|
||||
globalShortcut.register((options.globalShortcuts.volumeUp), () => win.webContents.send('changeVolume', true));
|
||||
}
|
||||
if (options.globalShortcuts?.volumeDown) {
|
||||
globalShortcut.register((options.globalShortcuts.volumeDown), () => win.webContents.send('changeVolume', false));
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.enabled = () => enabled;
|
||||
|
||||
Reference in New Issue
Block a user