Open zefir-git opened 3 years ago
https://www.electronjs.org/docs/api/command-line
Having found this, I might create a pull request with it implemented.
I can't really understand exactly how the application works, but this should be the code:
if (app.commandLine.hasSwitch('service') {
const { app } = require('electron');
//find service by name
let service = services.filter(service => {
//both to lowercase to make it case insensitive
return service.name.toLowerCase() === app.commandLine.getSwitchValue("service").toLowerCase()
})[0]; //get 1st result
//client side
animateLoader(service, createElement('img', null, service.style));
console.log(
`Switching to service ${service.name}} at the URL ${service.url}...`
);
ipc.send('open-url', service);
}
Feature Request
It would be nice to be able to pass arguments like
electronplayer --service netflix
that would launch the specified service. This would allow people who have downloaded the app specifically for one of the services to be able to create a separate .desktop file with its icon, etc. I currently have set Netflix as the default service, but I would like to be able to create a separate file with the service icon and name entirely for aesthetical purposes.