From 17fad2acfd79520e20bd3316bea6c84765e4923b Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 12 Oct 2016 20:42:53 +0200 Subject: [PATCH] gnome shell extension will only try to copy over if it doesn't already exist --- .../systemTray/linux/GnomeShellExtension.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/dorkbox/systemTray/linux/GnomeShellExtension.java b/src/dorkbox/systemTray/linux/GnomeShellExtension.java index c5ef0eb..6edfa98 100644 --- a/src/dorkbox/systemTray/linux/GnomeShellExtension.java +++ b/src/dorkbox/systemTray/linux/GnomeShellExtension.java @@ -159,25 +159,27 @@ class GnomeShellExtension { IO.close(outputWriter, logger); } - // copies our provided extension.js file to the correct location on disk - InputStream reader = null; - FileOutputStream fileOutputStream = null; - try { - reader = GnomeShellExtension.class.getResourceAsStream("extension.js"); - fileOutputStream = new FileOutputStream(extensionFile); - if (reader == null) { - throw new RuntimeException("The GnomeShell extension.js file cannot be found. Something is severely wrong."); - } - - IO.copyStream(reader, fileOutputStream); - } finally { - IO.close(reader, logger); - IO.close(fileOutputStream, logger); - } if (!hasSystemTray) { + // copies our provided extension.js file to the correct location on disk + InputStream reader = null; + FileOutputStream fileOutputStream = null; + try { + reader = GnomeShellExtension.class.getResourceAsStream("extension.js"); + fileOutputStream = new FileOutputStream(extensionFile); + + if (reader == null) { + throw new RuntimeException("The GnomeShell extension.js file cannot be found. Something is severely wrong."); + } + + IO.copyStream(reader, fileOutputStream); + } finally { + IO.close(reader, logger); + IO.close(fileOutputStream, logger); + } + logger.debug("Enabling extension in gnome-shell"); // now we have to enable us if we aren't already enabled