From 4348a622bf5d0c0d2d25a21a64581ed53eba57f5 Mon Sep 17 00:00:00 2001 From: Viktor Horsmanheimo Date: Thu, 18 Nov 2021 23:39:43 +0200 Subject: [PATCH 1/2] notifier: add timeout option for Linux Now allows to change the time a notification is shown, or if the option is set to 0 it should use the system configuration. Should be noted that Ubuntu and CentOS ignores these options, see ``man notify-send`` for more info. --- .../java/net/runelite/client/Notifier.java | 9 ++++---- .../client/config/RuneLiteConfig.java | 21 +++++++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/Notifier.java b/runelite-client/src/main/java/net/runelite/client/Notifier.java index f225064734..b6bbb51769 100644 --- a/runelite-client/src/main/java/net/runelite/client/Notifier.java +++ b/runelite-client/src/main/java/net/runelite/client/Notifier.java @@ -92,8 +92,6 @@ public class Notifier } } - // Default timeout of notification in milliseconds - private static final int DEFAULT_TIMEOUT = 10000; private static final String DOUBLE_QUOTE = "\""; private static final Escaper SHELL_ESCAPE = Escapers.builder() .addEscape('"', "'") @@ -320,8 +318,11 @@ public class Notifier commands.add(SHELL_ESCAPE.escape(notifyIconPath.toAbsolutePath().toString())); commands.add("-u"); commands.add(toUrgency(type)); - commands.add("-t"); - commands.add(String.valueOf(DEFAULT_TIMEOUT)); + if (runeLiteConfig.notificationTimeout() > 0) + { + commands.add("-t"); + commands.add(String.valueOf(runeLiteConfig.notificationTimeout())); + } executorService.submit(() -> { diff --git a/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java b/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java index a3dac72172..5aaa63abbe 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java @@ -221,11 +221,24 @@ public interface RuneLiteConfig extends Config return Notifier.NativeCustomOff.NATIVE; } + @ConfigItem( + keyName = "notificationTimeout", + name = "Notification timeout", + description = "How long notification will be shown in milliseconds. A value of 0 will make it use the system configuration. (Linux only)", + position = 23, + section = notificationSettings + ) + @Units(Units.MILLISECONDS) + default int notificationTimeout() + { + return 10000; + } + @ConfigItem( keyName = "notificationGameMessage", name = "Game message notifications", description = "Adds a notification message to the chatbox", - position = 23, + position = 24, section = notificationSettings ) default boolean enableGameMessageNotification() @@ -237,7 +250,7 @@ public interface RuneLiteConfig extends Config keyName = "flashNotification", name = "Flash", description = "Flashes the game frame as a notification", - position = 24, + position = 25, section = notificationSettings ) default FlashNotification flashNotification() @@ -249,7 +262,7 @@ public interface RuneLiteConfig extends Config keyName = "notificationFocused", name = "Send notifications when focused", description = "Toggles all notifications for when the client is focused", - position = 25, + position = 26, section = notificationSettings ) default boolean sendNotificationsWhenFocused() @@ -262,7 +275,7 @@ public interface RuneLiteConfig extends Config keyName = "notificationFlashColor", name = "Notification Flash", description = "Sets the color of the notification flashes.", - position = 26, + position = 27, section = notificationSettings ) default Color notificationFlashColor() From 50562bf611ca6afd7b71d5a8e2a673452e105d9a Mon Sep 17 00:00:00 2001 From: JumpIfZero Date: Sat, 18 Dec 2021 00:41:53 +0200 Subject: [PATCH 2/2] project: bump versions --- buildSrc/src/main/kotlin/Dependencies.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index e125baaf00..c49cb897aa 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -25,9 +25,9 @@ object ProjectVersions { const val launcherVersion = "2.2.0" - const val rlVersion = "1.8.7" + const val rlVersion = "1.8.7.1" - const val openosrsVersion = "4.17.0" + const val openosrsVersion = "4.17.1" const val rsversion = 202 const val cacheversion = 165