From 9a784d40d24671cd55d2fb255fdeef61644db0cb Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 16 Feb 2017 00:58:43 +0800 Subject: [PATCH] Experiment with Ubuntu Unity integration --- installer/deb/share/applications/filebot.desktop | 1 + source/net/filebot/Main.java | 10 ++++------ source/net/filebot/Settings.java | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/installer/deb/share/applications/filebot.desktop b/installer/deb/share/applications/filebot.desktop index d8e1ebbd..f09830fe 100644 --- a/installer/deb/share/applications/filebot.desktop +++ b/installer/deb/share/applications/filebot.desktop @@ -5,6 +5,7 @@ Comment=@{package.synopsis} MimeType=inode/directory;video/*;audio/*;text/*; Exec=filebot %F Icon=filebot +StartupNotify=true Categories=@{gnome.application.categories} Actions=Rename;Subtitles;Checksum; X-Ubuntu-Gettext-Domain=@{package.name} diff --git a/source/net/filebot/Main.java b/source/net/filebot/Main.java index 0e72f47f..9ad1f5f7 100644 --- a/source/net/filebot/Main.java +++ b/source/net/filebot/Main.java @@ -217,13 +217,11 @@ public class Main { MacAppUtilities.setDefaultMenuBar(FileBotMenuBar.createHelp()); MacAppUtilities.setOpenFileHandler(openFiles -> SwingEventBus.getInstance().post(new FileTransferable(openFiles))); } else if (isUbuntuApp()) { - // Ubuntu specific configuration - String options = System.getenv("JAVA_TOOL_OPTIONS"); - if (options != null && options.contains("jayatanaag.jar")) { - // menu should be rendered via JAyatana on Ubuntu 15.04 and higher - frame.setJMenuBar(FileBotMenuBar.createHelp()); + if ("Unity".equals(System.getenv("XDG_CURRENT_DESKTOP"))) { + frame.setTitle(Settings.getApplicationUserModelID()); + } else { + frame.setIconImages(ResourceManager.getApplicationIcons()); } - frame.setIconImages(ResourceManager.getApplicationIcons()); } else if (isWindowsApp()) { // Windows specific configuration if (!isAppStore()) { diff --git a/source/net/filebot/Settings.java b/source/net/filebot/Settings.java index 776b3f43..1fa9b2b1 100644 --- a/source/net/filebot/Settings.java +++ b/source/net/filebot/Settings.java @@ -92,7 +92,7 @@ public final class Settings { } public static boolean isUbuntuApp() { - return isApplicationDeployment("snap"); + return isApplicationDeployment("deb", "snap"); } public static boolean isMacApp() {