Using the transparent argument and setting it to true when creating a new BrowserWindow in Electron usually gives the window a transparent background... But on Linux that isn\'t
This code might work for you. I add explain in comment.
//electron can't be transparent on linux
//see issue on github: https://github.com/electron/electron/issues/2170
// app.disableHardwareAcceleration(); //use this
//or use these two lines code
app.commandLine.appendSwitch('enable-transparent-visuals');
app.commandLine.appendSwitch('disable-gpu');
//createWindow need to wait(more than about 100ms) if you want the window to be transparent
// app.whenReady().then(createWindow); //this won't work
app.commandLine.appendSwitch('enable-transparent-visuals');
app.commandLine.appendSwitch('disable-gpu');
app.on('ready', () => {
setTimeout(() => {
createWindow();
}, 200);
});