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.
This commit is contained in:
Nikos Tsipinakis 2017-07-01 11:03:05 +03:00
parent 2927140d8b
commit 5e2c781cba
3 changed files with 38 additions and 14 deletions

View File

@ -16,6 +16,7 @@
### Changed ### Changed
- Text and icons are now centred vertically - Text and icons are now centred vertically
- Notifications aren't considered duplicate if urgency or icons differ - 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 ### Deprecated
- `allow_markup` will be removed in later versions. It is being replaced by `markup` - `allow_markup` will be removed in later versions. It is being replaced by `markup`

11
dunstrc
View File

@ -181,6 +181,13 @@
# Always run rule-defined scripts, even if the notification is suppressed # Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true 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 # Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases. # to have a consistent behaviour across releases.
[experimental] [experimental]
@ -188,10 +195,6 @@
# Please note that this setting will not work if Xft.dpi X resource is set. # Please note that this setting will not work if Xft.dpi X resource is set.
per_monitor_dpi = false per_monitor_dpi = false
[frame]
width = 3
color = "#aaaaaa"
[shortcuts] [shortcuts]
# Shortcuts are specified as [modifier+][modifier+]...key # Shortcuts are specified as [modifier+][modifier+]...key

View File

@ -396,18 +396,38 @@ void load_settings(char *cmdline_config_path)
"paths to default icons" "paths to default icons"
); );
{
// Backwards compatibility with the legacy 'frame' section.
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( settings.frame_width = option_get_int(
"frame", "frame",
"width", "-frame_width", frame_width, "width", "-frame_width", frame_width,
"Width of frame around window" "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( settings.frame_color = option_get_string(
"frame", "frame",
"color", "-frame_color", frame_color, "color", "-frame_color", frame_color,
"Color of the frame around window" "Color of the frame around the window"
); );
}
}
settings.lowbgcolor = option_get_string( settings.lowbgcolor = option_get_string(
"urgency_low", "urgency_low",
"background", "-lb", lowbgcolor, "background", "-lb", lowbgcolor,