Added support for wayland with gnome-shell.

This commit is contained in:
nathan 2018-10-23 12:23:33 +02:00
parent f2fd9167b4
commit 435f93865d
3 changed files with 24 additions and 9 deletions

View File

@ -246,7 +246,9 @@ class SystemTray {
}
if ("gnome".equalsIgnoreCase(GDM)) {
// install the Gnome extension
Tray.usingGnome = true;
Extension.install();
// are we fedora? If so, what version?
// now, what VERSION of fedora? 23/24/25/? don't have AppIndicator installed, so we have to use GtkStatusIcon
@ -274,7 +276,10 @@ class SystemTray {
return selectTypeQuietly(TrayType.GtkStatusIcon);
}
else if ("default".equalsIgnoreCase(GDM)) {
// install the Gnome extension
Tray.usingGnome = true;
Extension.install();
// this can be gnome3 on debian/kali
if (OSUtil.Linux.isKali()) {
@ -300,11 +305,13 @@ class SystemTray {
return selectTypeQuietly(TrayType.GtkStatusIcon);
}
else if ("ubuntu".equalsIgnoreCase(GDM)) {
// ubuntu 17.10 uses the NEW gnome DE, which screws up previous Ubuntu workarounds, since it's now proper Gnome
// ubuntu 17.10+ uses the NEW gnome DE, which screws up previous Ubuntu workarounds, since it's now proper Gnome
int[] version = OSUtil.Linux.getUbuntuVersion();
if (version[0] > 17 || (version[0] == 17 && version[1] == 10)) {
// this is gnome 3.26.1
logger.debug("This Ubuntu 17.10 is not yet supported!");
// install the Gnome extension
Tray.usingGnome = true;
Extension.install();
}
return selectTypeQuietly(TrayType.AppIndicator);
@ -328,7 +335,7 @@ class SystemTray {
return selectTypeQuietly(TrayType.AppIndicator);
}
case Unity7: {
// Ubuntu Unity7 (17.04+, which has MIR) is a weird combination. It's "Gnome", but it's not "Gnome Shell".
// Ubuntu Unity7 (17.04, which has MIR) is a weird combination. It's "Gnome", but it's not "Gnome Shell".
return selectTypeQuietly(TrayType.AppIndicator);
}
case XFCE: {

View File

@ -169,9 +169,22 @@ class Extension {
private static
void restartShell() {
if (OSUtil.DesktopEnv.isWayland()) {
// you can no longer restart the shell in wayland. You must logout-login for shell modifications to apply
// https://mail.gnome.org/archives/commits-list/2015-March/msg01019.html
// HOWEVER, with wayland, shell-extensions that DO NO MODIFY THE GUI (we don't, we just add icons to it)
// are enabled without a shell restart.
// if there are still difficulties, you can use the following
// gnome-shell-extension-tool -e SystemTray@Dorkbox
return;
}
if (ENABLE_SHELL_RESTART) {
if (SystemTray.DEBUG) {
logger.debug("DEBUG mode enabled. You need to log-in/out or manually restart the shell via '{}' to apply the changes.",
logger.debug("DEBUG mode enabled. You need to log-out/in or manually restart the shell via '{}' to apply the changes.",
SHELL_RESTART_COMMAND);
return;
}

View File

@ -222,11 +222,6 @@ class _GtkStatusIconNativeTray extends Tray {
});
bind(gtkMenu, null, systemTray);
// install the Gnome extension
if (Tray.usingGnome) {
Extension.install();
}
}
@Override