aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.c17
-rw-r--r--config.h5
-rw-r--r--foot.ini1
3 files changed, 23 insertions, 0 deletions
diff --git a/config.c b/config.c
index da55f8f8..8e896b4c 100644
--- a/config.c
+++ b/config.c
@@ -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,
diff --git a/config.h b/config.h
index 2bae8d31..3dc976e1 100644
--- a/config.h
+++ b/config.h
@@ -181,6 +181,11 @@ struct config {
char *server_socket_path;
bool presentation_timings;
bool hold_at_exit;
+ enum {
+ SELECTION_TARGET_PRIMARY,
+ SELECTION_TARGET_CLIPBOARD,
+ SELECTION_TARGET_BOTH
+ } selection_target;
struct {
char *raw_cmd;
diff --git a/foot.ini b/foot.ini
index 330b4b7f..19a82061 100644
--- a/foot.ini
+++ b/foot.ini
@@ -23,6 +23,7 @@
# bell=none
# word-delimiters=,│`|:"'()[]{}<>
# notify=notify-send -a foot -i foot ${title} ${body}
+# selection-target=primary
# workers=<number of logical CPUs>
[scrollback]