use Electron with ToastXML instead of SnoreToast

* Add support for protocol commands
* Remove node-notifier dependency
This commit is contained in:
Araxeus
2023-01-07 19:31:29 +02:00
parent e6146940b1
commit 2c49f6c740
18 changed files with 193 additions and 187 deletions

View File

@ -8,7 +8,7 @@ const pressKey = (window, key, modifiers = []) => {
};
module.exports = (win) => {
return {
const commands = {
// Playback
previous: () => pressKey(win, "k"),
next: () => pressKey(win, "j"),
@ -21,8 +21,7 @@ module.exports = (win) => {
go1sForward: () => pressKey(win, "l", ["shift"]),
shuffle: () => pressKey(win, "s"),
switchRepeat: (n = 1) => {
for (let i = 0; i < n; i++)
pressKey(win, "r");
for (let i = 0; i < n; i++) pressKey(win, "r");
},
// General
volumeMinus10: () => pressKey(win, "-"),
@ -50,4 +49,9 @@ module.exports = (win) => {
search: () => pressKey(win, "/"),
showShortcuts: () => pressKey(win, "/", ["shift"]),
};
return {
...commands,
play: commands.playPause,
pause: commands.playPause
};
};