diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-01-16 10:26:03 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-01-23 09:43:59 +0000 |
| commit | e69ca255b03cf71c07d39747510f3ff82e8f98ca (patch) | |
| tree | eed997a9171e32dc1b2f1ea36a620d0c6ca8a3dd /config.c | |
| parent | Merge branch 'mouse-button-encoding-of-button-6-7' (diff) | |
config: add new option ‘selection-target’
This option controls the clipboard target that selected text should be
copied to.
Diffstat (limited to 'config.c')
| -rw-r--r-- | config.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -673,6 +673,22 @@ parse_section_main(const char *key, const char *value, struct config *conf, conf->notify.argv = argv; } + else if (strcmp(key, "selection-target") == 0) { + if (strcasecmp(value, "primary") == 0) + conf->selection_target = SELECTION_TARGET_PRIMARY; + else if (strcasecmp(value, "clipboard") == 0) + conf->selection_target = SELECTION_TARGET_CLIPBOARD; + else if (strcasecmp(value, "both") == 0) + conf->selection_target = SELECTION_TARGET_BOTH; + else { + LOG_AND_NOTIFY_ERR( + "%s:%d: [default]: %s: invalid 'selection-target'; " + "must be one of 'primary', 'clipboard' or 'both", + path, lineno, value); + return false; + } + } + else { LOG_AND_NOTIFY_ERR("%s:%u: [default]: %s: invalid key", path, lineno, key); return false; @@ -2127,6 +2143,7 @@ config_load(struct config *conf, const char *conf_path, .render_worker_count = sysconf(_SC_NPROCESSORS_ONLN), .server_socket_path = get_server_socket_path(), .presentation_timings = false, + .selection_target = SELECTION_TARGET_PRIMARY, .hold_at_exit = false, .notify = { .raw_cmd = NULL, |
