lightninglabs / lightning-app

An easy-to-use cross-platform Lightning wallet
GNU General Public License v3.0
901 stars 173 forks source link

Keep lnd running in background process (with icon tooltip) when app window closes #508

Open tanx opened 6 years ago

tanx commented 6 years ago

Seems like this isn't easily doable in electron: https://discuss.atom.io/t/windows-background-service/20777

Electron/node child processes are killed after closing the app, so we'd need to create platform specific services for each OS. This also wouldn't work with our current electron-builder installation/update path since the background services would need to be packaged separately. So platform specific install/update would also need to be implemented for each OS.

Roasbeef commented 5 years ago

It seems a first step would be to keep the application running even after the user hits "x" on the main window. With this initial step, at least they would be able to click the app icon again, and have the application pop up again.

That forum post linked to seems a bit dated, I think electron now has native support for system trays (ofc I'm no electron export, just scanning docs :p): https://electronjs.org/docs/api/tray

EDIT: looks like there's a hacky way to cause closing the app to actually minimize into the tray

tanx commented 5 years ago

It seems a first step would be to keep the application running even after the user hits "x" on the main window.

This would only work on macOS though. Not sure a custom solution there would simplify things :/