dunst/settings.h
Yuri D'Elia b5e00c43c7 Fix markup handling.
The current "allow_markup" setting will simply strip any markup from the final
notification, which includes formatting elements. On top of that, literal
[<>&..] symbols are not quoted before are being passed onto pango in several
places, resulting in stray error messages.

This patch fixes allow_markup to correctly strip markup only from the incoming
notification, not from the format.

You might also want to treat incoming messages as literal text (supplied by
un-aware programs), in which case you need to properly quote the text before
it's processed by pango. A new setting is introduced, called "plain_text",
which forces incoming messages to be treated literally.

allow_markup/plain_text are complimentary to each other.

The new rule actions allow to narrow down the handling to a specific block,
achieving notification Zen.

The following is done in this patch:

- Fix ruleset initialization in config.def.h.
- Introduce new allow_markup/plain_text actions in the rules.
- Fix handling of allow_markup to strip markup from summary/body only,
  preserving format's markup.
- Fix broken string functions (string_replace_all didn't handle recursive
  replacements correctly).
- Fix quoting of other literal fields (icon name/appname).
- Fix handling of ignore_newline as well (applied only on summary/body).
- Dunstrc update with the same previous defaults.
2014-12-05 16:05:41 +01:00

62 lines
1.6 KiB
C

/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#pragma once
typedef struct _settings {
bool print_notifications;
bool allow_markup;
bool plain_text;
bool stack_duplicates;
char *font;
char *normbgcolor;
char *normfgcolor;
char *critbgcolor;
char *critfgcolor;
char *lowbgcolor;
char *lowfgcolor;
char *format;
int timeouts[3];
char *icons[3];
unsigned int transparency;
char *geom;
char *title;
char *class;
int shrink;
int sort;
int indicate_hidden;
int idle_threshold;
int show_age_threshold;
enum alignment align;
float bounce_freq;
int sticky_history;
int history_length;
int show_indicators;
int verbosity;
int word_wrap;
int ignore_newline;
int line_height;
int separator_height;
int padding;
int h_padding;
enum separator_color sep_color;
char *sep_custom_color_str;
char *sep_color_str;
int frame_width;
char *frame_color;
int startup_notification;
int monitor;
char *dmenu;
char **dmenu_cmd;
char *browser;
enum icon_position_t icon_position;
char *icon_folders;
enum follow_mode f_mode;
keyboard_shortcut close_ks;
keyboard_shortcut close_all_ks;
keyboard_shortcut history_ks;
keyboard_shortcut context_ks;
} settings_t;
extern settings_t settings;
void load_settings(char *cmdline_config_path);