diff --git a/src/dorkbox/systemTray/SystemTray.java b/src/dorkbox/systemTray/SystemTray.java index 04551c0..e0232c9 100644 --- a/src/dorkbox/systemTray/SystemTray.java +++ b/src/dorkbox/systemTray/SystemTray.java @@ -307,12 +307,7 @@ class SystemTray { else if (minorAndPatch < 26.0D) { Tray.gtkGnomeWorkaround = true; - if (!LegacyExtension.isInstalled()) { - LegacyExtension.install(); - - // just restarting the shell is enough to get the system tray to work - LegacyExtension.restartShell(); - } + LegacyExtension.install(); // now, what VERSION of fedora? "normal" fedora doesn't have AppIndicator installed, so we have to use GtkStatusIcon // 23 is gtk, 24/25/26 is gtk (but also wrong size unless we adjust it. ImageUtil automatically does this) @@ -362,12 +357,7 @@ class SystemTray { // ubuntu 18.04 doesn't need the extension BUT does need a logout-login (or gnome-shell restart) for it to work // we copy over a config file so we know if we have already restarted the shell or shown the warning. A logout-login will also work. - if (!DummyFile.isPresent()) { - DummyFile.install(); - - // just restarting the shell is enough to get the system tray to work - LegacyExtension.restartShell(); - } + DummyFile.install(); } return selectTypeQuietly(TrayType.AppIndicator); diff --git a/src/dorkbox/systemTray/gnomeShell/DummyFile.java b/src/dorkbox/systemTray/gnomeShell/DummyFile.java index 96e4826..6dbbd57 100644 --- a/src/dorkbox/systemTray/gnomeShell/DummyFile.java +++ b/src/dorkbox/systemTray/gnomeShell/DummyFile.java @@ -11,11 +11,9 @@ class DummyFile { private static final File file = new File(System.getProperty("user.home") + "/.local/.SystemTray"); - public static - boolean isPresent() { - return file.exists(); - } - + /** + * Installs a dummy file to indicate we've restarted the shell. This will restart the shell if necessary + */ public static void install() { if (!file.exists()) { @@ -28,8 +26,12 @@ class DummyFile { } catch (IOException e) { SystemTray.logger.error("Error creating file", e); } + + file.setLastModified(System.currentTimeMillis()); + + // just restarting the shell is enough to get the system tray to work + LegacyExtension.restartShell(); } - file.setLastModified(System.currentTimeMillis()); } } diff --git a/src/dorkbox/systemTray/gnomeShell/LegacyExtension.java b/src/dorkbox/systemTray/gnomeShell/LegacyExtension.java index a45d7b3..c74b00e 100644 --- a/src/dorkbox/systemTray/gnomeShell/LegacyExtension.java +++ b/src/dorkbox/systemTray/gnomeShell/LegacyExtension.java @@ -32,18 +32,6 @@ class LegacyExtension extends ExtensionSupport { /** Command to restart the gnome-shell. It is recommended to start it in the background (hence '&') */ private static final String SHELL_RESTART_COMMAND = "gnome-shell --replace &"; - /** - * topIcons will convert ALL icons to be at the top of the screen, so there is no reason to have both installed - * - * @return true if that extension is installed - */ - public static - boolean isInstalled() { - List enabledExtensions = getEnabledExtensions(); - return enabledExtensions.contains("topIcons@adel.gadllah@gmail.com") || enabledExtensions.contains(UID); - } - - /** * Only install a version that specifically moves only our icon next to the clock */