change the process title

This commit is contained in:
jill 2021-09-03 07:07:43 +03:00
parent de541f690d
commit 48db545c78
2 changed files with 2 additions and 1 deletions

View file

@ -2,6 +2,7 @@ const render = require('./render');
const mpris = require('./mpris'); const mpris = require('./mpris');
async function main() { async function main() {
process.title = 'bouncy';
mpris.init(render.error, render.warning, render.info); mpris.init(render.error, render.warning, render.info);
setInterval(() => {render.render(mpris.getArtist(), mpris.getAlbum(), mpris.getTitle(), mpris.getSongStart(), mpris.getSongEnd(), mpris.getSongPauseSpot(), mpris.getSongPaused())}, render.refreshrate); setInterval(() => {render.render(mpris.getArtist(), mpris.getAlbum(), mpris.getTitle(), mpris.getSongStart(), mpris.getSongEnd(), mpris.getSongPauseSpot(), mpris.getSongPaused())}, render.refreshrate);
} }

View file

@ -21,7 +21,7 @@ process.stdin.on('keypress', (str, key) => {
if (key.sequence === '\x03' || key.sequence === '\x04') process.exit(0); // ctrl+c, ctrl+d if (key.sequence === '\x03' || key.sequence === '\x04') process.exit(0); // ctrl+c, ctrl+d
}); });
process.on('exit', () => { process.on('exit', () => {
process.stdout.write('\x1B[?25l\033[0m'); // show cursor process.stdout.write('\x1B[?25h\033[0m'); // show cursor
}) })
const plas = [' ', '.', '*', '/', '0']; const plas = [' ', '.', '*', '/', '0'];