Skip to content

Commit

Permalink
Move frame settings to the global section
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tsipinakis committed Jul 1, 2017
1 parent 2927140 commit 5e2c781
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
11 changes: 7 additions & 4 deletions dunstrc
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,20 @@
# 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]
# Calculate the dpi to use on a per-monitor basis.
# 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
Expand Down
40 changes: 30 additions & 10 deletions src/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5e2c781

Please sign in to comment.