19 Commits

Author SHA1 Message Date
Nikos Tsipinakis
aec3533a0b Add frame and experimental to the section list excluded from rules
The frame and experimental sections are currently used for some settings
related to frame colour and experimental features respectively and as
such should not be parsed as rules.
2017-06-27 10:59:05 +03:00
Nikos Tsipinakis
2df3c2291d Add identically named command line flags for all settings
Make every setting be overridable from the command line using
-setting_name. Previously, some settings had shortened command line
flags (e.g. -fn instead of -font) which made the command line arguments
confusing.
2017-06-27 10:46:12 +03:00
Nikos Tsipinakis
43b4d4bb41 Add per_monitor_dpi experimental setting
Calculating the screen dpi on a per-monitor basis can cause
inconsistencies if multiple monitors with slightly different dpis are
used and in some cases it might not be the expected behaviour.

As such, the per-monitor dpi calculation was changed from a default
fallback to an opt in experimental feature and the default value of 96
will be used for the dpi if Xft.dpi is not set.

In the future, depending on how we decide to continue, we can either
move this setting in the global configuration section and fall back to
the X11 display dpi as the default or simply always use the per-monitor
dpi calculation. But to preserve backwards compatibility, this decision
can wait until the next major release.
2017-04-02 18:27:12 +03:00
Nikos Tsipinakis
a6046586a3 Fix minor memory leak
When checking for the markup value in rules, an empty string was
specified as the default value so it can easily be checked if the actual
config value was empty or not. While that string got strdup'ed in the
ini_get_string call, it was only freed if the length > 0, effectively
leaking a tiny amount of memory.

Change that behaviour to use a NULL check instead to avoid leaking
memory.
2017-04-01 22:50:40 +03:00
Eizen
4df1a4b731 Fix small bug 2017-02-19 17:11:19 -03:00
John Chen
17e2929ee7 Change malloc and related functions to glib ones.
* malloc  -> g_malloc
* realloc -> g_realloc
* free    -> g_free
* strdup  -> g_strdup
* strndup -> g_strndup
2017-02-14 00:44:53 +08:00
John Chen
7037afb2bc Fix include. Add empty lines between include layers. 2017-02-14 00:39:04 +08:00
Nikos Tsipinakis
eb2fda4bde Default to the config.h default if markup is not set
If neither the new 'markup' option is set nor 'allow_markup' then
default to whatever mode is set in config.h.
2017-02-12 21:27:55 +02:00
Nikos Tsipinakis
faea58159c Don't try to parse previously non-existent 'allow_markup' cmdline argument 2017-02-12 21:23:34 +02:00
Nikos Tsipinakis
de20697a69 Rename hide_duplicates_count -> hide_duplicate_count 2017-02-12 21:17:38 +02:00
Eizen
ceddf57a31 Add history_ignore rule
Fixes #197
2017-02-11 15:35:32 -03:00
Nikos Tsipinakis
42a641c728 Take allow_markup into account if markup is not set
Preserve backwards compatibility for now, this might be removed for the
3.0 release later on.
2017-02-08 20:55:48 +02:00
Nikos Tsipinakis
0c49b49254 Replace string_to_argv util function with g_shell_parse_argv
string_to_argv parsing was very simplistic and didn't properly handle
quotations. Since we are already using glib, g_shell_parse_argv serves
the same purpose with much better parsing and error handling.
2017-02-05 13:00:59 +02:00
Nikos Tsipinakis
f0808f8d3f Fix alignment setting documentation
`alignment` specifies the alignment of the text within the notifications,
not the alignment of the notifications themselves.
2017-02-05 13:00:59 +02:00
Nikos Tsipinakis
4e1b97f3cc Merge allow_markup and plain_text into markup
Merge the allow_markup and plain_text settings into a single setting.

These 2 settings had a similar function, allow_markup controlled whether
markup was parsed or stripped and plain_text whether the notification
was escaped and displayed as is.

To cover all the possible combinations of the settings mentioned above
`markup` can take the following values:

full:  The equivalent of allow_markup yes, plain_text no.
       Passes the text straight to pango with minimal parsing. All valid
       pango tags will be parsed.

strip: The equivalent of allow_markup no, plain_text no.
       Strips the markup using string_strip_delimited. The parsing is
       simplistic and if there are any unescaped '<' and/or '>'
       characters it might get tripped and strip out actual text.

       According to the GNOME notification specification, if a server
       doesn't support markup(and we don't advertise that we do if it is
       turned off) it should be stripped clientside, so this setting
       should rarely be used. It is mainly left in for compatibility
       with broken clients that don't follow the specification.

no:   The equivalent of allow_markup [yes/no](any value), plain_text
      yes.
      Makes the notification content be rendered as plain text
      regardless if it contains markup. Any Markup will be shown as
      regular text.

Markup inside 'format' will still be parsed regardless of what markup is
set to.

Closes #279
2017-02-04 22:10:51 +02:00
Nikos Tsipinakis
4aa4e93123 Format the settings file better 2017-02-04 22:10:51 +02:00
Edward Betts
d73526975e fix spelling mistakes 2017-02-01 10:02:01 +00:00
Eizen
bfd24224aa Merge pull request #270 2016-12-13 20:36:55 -03:00
Nikos Tsipinakis
2df2e7d06c Move dunst source files to src/ 2016-11-19 11:54:03 +02:00