You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.0 KiB
50 lines
1.0 KiB
import { BaseCommand } from '../../utls/base-command';
|
|
// eslint-disable-next-line unicorn/no-abusive-eslint-disable,@typescript-eslint/ban-ts-ignore
|
|
// @ts-ignore
|
|
import * as blinkstick from 'blinkstick';
|
|
|
|
interface WallhavenItem {
|
|
id: string;
|
|
url: string;
|
|
path: string;
|
|
}
|
|
|
|
export default class Blinkstick extends BaseCommand {
|
|
static description = 'set a color to the blinkstick led';
|
|
|
|
static examples = [
|
|
`$ nbx blink red`,
|
|
`$ nbx blink green`,
|
|
`$ nbx blink blue`,
|
|
];
|
|
|
|
static args = [
|
|
{
|
|
name: 'color',
|
|
description: 'The search terms for the wallpaper',
|
|
required: true,
|
|
},
|
|
];
|
|
|
|
static flags = {
|
|
...BaseCommand.flags,
|
|
};
|
|
|
|
async run() {
|
|
const {
|
|
args: { color },
|
|
} = this.parse(Blinkstick);
|
|
|
|
const device = blinkstick.findFirst();
|
|
|
|
if (!device) {
|
|
this.error('No blinkstick found.');
|
|
}
|
|
|
|
[...new Array(10).keys()].forEach((index) => {
|
|
device.setColor(color, { index });
|
|
});
|
|
|
|
this.tools.print.info('All good :)');
|
|
}
|
|
}
|