Simplified legacy extension and dummy-file installation
This commit is contained in:
parent
86a4562b4d
commit
b80d9cbbde
@ -307,13 +307,8 @@ class SystemTray {
|
|||||||
else if (minorAndPatch < 26.0D) {
|
else if (minorAndPatch < 26.0D) {
|
||||||
Tray.gtkGnomeWorkaround = true;
|
Tray.gtkGnomeWorkaround = true;
|
||||||
|
|
||||||
if (!LegacyExtension.isInstalled()) {
|
|
||||||
LegacyExtension.install();
|
LegacyExtension.install();
|
||||||
|
|
||||||
// just restarting the shell is enough to get the system tray to work
|
|
||||||
LegacyExtension.restartShell();
|
|
||||||
}
|
|
||||||
|
|
||||||
// now, what VERSION of fedora? "normal" fedora doesn't have AppIndicator installed, so we have to use GtkStatusIcon
|
// 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)
|
// 23 is gtk, 24/25/26 is gtk (but also wrong size unless we adjust it. ImageUtil automatically does this)
|
||||||
return selectTypeQuietly(TrayType.GtkStatusIcon);
|
return selectTypeQuietly(TrayType.GtkStatusIcon);
|
||||||
@ -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
|
// 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.
|
// 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();
|
DummyFile.install();
|
||||||
|
|
||||||
// just restarting the shell is enough to get the system tray to work
|
|
||||||
LegacyExtension.restartShell();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return selectTypeQuietly(TrayType.AppIndicator);
|
return selectTypeQuietly(TrayType.AppIndicator);
|
||||||
|
@ -11,11 +11,9 @@ class DummyFile {
|
|||||||
|
|
||||||
private static final File file = new File(System.getProperty("user.home") + "/.local/.SystemTray");
|
private static final File file = new File(System.getProperty("user.home") + "/.local/.SystemTray");
|
||||||
|
|
||||||
public static
|
/**
|
||||||
boolean isPresent() {
|
* Installs a dummy file to indicate we've restarted the shell. This will restart the shell if necessary
|
||||||
return file.exists();
|
*/
|
||||||
}
|
|
||||||
|
|
||||||
public static
|
public static
|
||||||
void install() {
|
void install() {
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
@ -28,8 +26,12 @@ class DummyFile {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
SystemTray.logger.error("Error creating file", e);
|
SystemTray.logger.error("Error creating file", e);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
file.setLastModified(System.currentTimeMillis());
|
file.setLastModified(System.currentTimeMillis());
|
||||||
|
|
||||||
|
// just restarting the shell is enough to get the system tray to work
|
||||||
|
LegacyExtension.restartShell();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,18 +32,6 @@ class LegacyExtension extends ExtensionSupport {
|
|||||||
/** Command to restart the gnome-shell. It is recommended to start it in the background (hence '&') */
|
/** 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 &";
|
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<String> 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
|
* Only install a version that specifically moves only our icon next to the clock
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user