Add 'keyevent.json' dependency

This commit is contained in:
KaKi87 2024-01-27 20:18:53 +01:00
parent 6a8d56433f
commit 3f94331977
3 changed files with 10 additions and 3 deletions

View file

@ -3,6 +3,7 @@ import { exec } from 'node:child_process';
import { overrideConsole } from 'nodejs-better-console';
import Eris from 'eris';
import { Command } from 'commander';
import KeyEvent from 'keyevent.json' assert { type: 'json' };
import { parse } from 'shell-quote';
import {
@ -53,15 +54,15 @@ const
program
.command('p')
.description('Play/pause media')
.action(() => adb('input keyevent 85'));
.action(() => adb(`input keyevent ${KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE}`));
program
.command('play')
.description('Play media')
.action(() => adb('input keyevent 126'));
.action(() => adb(`input keyevent ${KeyEvent.KEYCODE_MEDIA_PLAY}`));
program
.command('pause')
.description('Pause media')
.action(() => adb('input keyevent 127'));
.action(() => adb(`input keyevent ${KeyEvent.KEYCODE_MEDIA_PAUSE}`));
program
.command('spotify')
.description('Launch Spotify')

View file

@ -8,6 +8,7 @@
"dependencies": {
"commander": "^11.1.0",
"eris": "^0.17.1",
"keyevent.json": "^0.1.0",
"nodejs-better-console": "^1.0.2",
"shell-quote": "^1.8.1"
},

View file

@ -17,6 +17,11 @@ eris@^0.17.1:
opusscript "^0.0.8"
tweetnacl "^1.0.3"
keyevent.json@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/keyevent.json/-/keyevent.json-0.1.0.tgz#598ef46218f53350ac4c5ce845dcaadcf2b6f2bb"
integrity sha512-1SVBT4dTNggvKXOk8etHiMngBTfo2RaRwcNSugx94IvYNr2Yhlypoq/eerQyPY79+Ew4PyxLnKw2duRHx9n1Kw==
nodejs-better-console@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/nodejs-better-console/-/nodejs-better-console-1.0.2.tgz#bf6da52a3bf6ddbc61a414b1d83739c86117f207"