datashare
datashare copied to clipboard
feat: add tray icon for Datashare to replace opened terminal
We would like to have "Quit" and "Open Browser" buttons
- [x] Add the lib into the project (Using version 4.1)
- [x] Make a minimalist demo
- [ ] Integrate SystemTray into the project
When starting the app with an X server (for instance in the devenv), there is an error in the console:
Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:105)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at java.desktop/sun.awt.X11GraphicsEnvironment.initStatic(X11GraphicsEnvironment.java:64)
at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:59)
at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:36)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:91)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:82)
at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:104)
at java.desktop/sun.awt.X11.XToolkit.<clinit>(XToolkit.java:225)
at java.desktop/sun.awt.PlatformGraphicsInfo.createToolkit(PlatformGraphicsInfo.java:40)
at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:595)
at java.desktop/java.awt.SystemTray.isSupported(SystemTray.java:213)
at dorkbox.systemTray.SystemTray.get(SystemTray.java:677)
at dorkbox.systemTray.SystemTray.get(SystemTray.java:171)
at org.icij.datashare.tray.DatashareSystemTray.create(DatashareSystemTray.java:35)
at org.icij.datashare.Main.main(Main.java:30)
We should catch this to display something like "Unable to display the system tray icon".