From 5e2c781cba43273e8084514f0b1f7e995db83099 Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Sat, 1 Jul 2017 11:03:05 +0300 Subject: [PATCH] Move frame settings to the global section There is no reason for the frame settings to have their own section since it's not an area that will be expanded upon. Move them to the global section to be consistent. --- CHANGELOG.md | 1 + dunstrc | 11 +++++++---- src/settings.c | 40 ++++++++++++++++++++++++++++++---------- 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a33acf..92947bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ ### Changed - Text and icons are now centred vertically - Notifications aren't considered duplicate if urgency or icons differ +- The frame width and color settings were moved to the global section as frame\_width and frame\_color respectively. ### Deprecated - `allow_markup` will be removed in later versions. It is being replaced by `markup` diff --git a/dunstrc b/dunstrc index 8536bc1..cffc220 100644 --- a/dunstrc +++ b/dunstrc @@ -181,6 +181,13 @@ # Always run rule-defined scripts, even if the notification is suppressed always_run_script = true + # Defines color of the frame around the notification window. + frame_color = "#aaaaaa" + + # Defines width in pixels of frame around the notification window. + # Set to 0 to disable. + frame_width = 3 + # Experimental features that may or may not work correctly. Do not expect them # to have a consistent behaviour across releases. [experimental] @@ -188,10 +195,6 @@ # Please note that this setting will not work if Xft.dpi X resource is set. per_monitor_dpi = false -[frame] - width = 3 - color = "#aaaaaa" - [shortcuts] # Shortcuts are specified as [modifier+][modifier+]...key diff --git a/src/settings.c b/src/settings.c index 3e5416a..6f12729 100644 --- a/src/settings.c +++ b/src/settings.c @@ -396,18 +396,38 @@ void load_settings(char *cmdline_config_path) "paths to default icons" ); - settings.frame_width = option_get_int( - "frame", - "width", "-frame_width", frame_width, - "Width of frame around window" - ); + { + // Backwards compatibility with the legacy 'frame' section. - settings.frame_color = option_get_string( - "frame", - "color", "-frame_color", frame_color, - "Color of the frame around window" - ); + if (ini_is_set("global", "frame_width")) { + settings.frame_width = option_get_int( + "global", + "frame_width", "-frame_width", frame_width, + "Width of frame around the window" + ); + } else { + settings.frame_width = option_get_int( + "frame", + "width", "-frame_width", frame_width, + "Width of frame around the window" + ); + } + if (ini_is_set("global", "frame_color")) { + settings.frame_color = option_get_string( + "global", + "frame_color", "-frame_color", frame_color, + "Color of the frame around the window" + ); + } else { + settings.frame_color = option_get_string( + "frame", + "color", "-frame_color", frame_color, + "Color of the frame around the window" + ); + } + + } settings.lowbgcolor = option_get_string( "urgency_low", "background", "-lb", lowbgcolor,