Open Kotlin-GDE opened 1 year ago
2,3 and 4 will depend on exactly what toaster implementation is being chosen. It's hard to answer exactly without knowing this.
Being as you you state you are on Ubuntu, DBUSNotifyToaster
is the most integrated choice. This will require trhat you have dbus-java-transport-native-unixsocket
(https://mvnrepository.com/artifact/com.github.hypfvieh/dbus-java-core) included in your project. If you do not have these DBUS libraries, it will then depend on what GUI toolkit your application is using. You'll either end up with the JavaFXToaster
, AWTToaster
or SWTToaster
(if you have the additional library added). If none of these are available, the fallback NotifyToaster
uses the notify-send
command if it's available.
Timeouts work on all Linux implementations, so I am going to guess you are using the DBUSNotifyToaster
or NotifyToaster
because there is a known issue on Ubuntu that I sadly cannot do anything about. https://bugs.launchpad.net/ubuntu/+source/notify-osd/+bug/390508
Listeners not being triggered suggests though that you are using NotifyToaster
, as this one does not support any kind of events.
The position of the popups can't really changed for any implementation except the two that two-slices fully implements itself, i.e. JavaFXToaster
and SWTToaster
. For all other types, the position is dictated by the notification backend. If you use either of these two, then the position can be set thusly ..
ToasterSettings settings = new ToasterSettings();
settings.setPosition(Position.TL); // e.g. top left
ToasterFactory.setSettings(settings);
For you final point 5, unfortunately no, you cannot use relative paths. This is because of the question "relative to what?". The icon might be being actually rendered by a totally different process running in a different location.
From the Javadoc ...
All notification systems support absolute path names to file resources, as well as string representations of URLs. Some may support logical names, such as Freedesktop Icon Names like dialog-info
.
Note, it should also support resource URLs fine, so you can used icons bundled in jars as resources. Internally though, these are extract to local absolute file paths as that is the lowest common denominator across all implementations,
The size can currently only be set by the SWTToaster
. It is unlikely other toasters will ever get support for this.
ToasterSettings settings = new ToasterSettings();
settings.getHints().put(BasicToastHint.ICON_SIZE, 64);
ToasterFactory.setSettings(settings);
hi
i using java 21, ubuntu 23.10
1.
why this error and why show twice ?