mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-02 01:40:13 -05:00
config: add new option ‘selection-target’
This option controls the clipboard target that selected text should be copied to.
This commit is contained in:
parent
79e3a46943
commit
a0afae747b
3 changed files with 23 additions and 0 deletions
17
config.c
17
config.c
|
|
@ -602,6 +602,22 @@ parse_section_main(const char *key, const char *value, struct config *conf,
|
||||||
conf->notify.argv = argv;
|
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 {
|
else {
|
||||||
LOG_AND_NOTIFY_ERR("%s:%u: [default]: %s: invalid key", path, lineno, key);
|
LOG_AND_NOTIFY_ERR("%s:%u: [default]: %s: invalid key", path, lineno, key);
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -2037,6 +2053,7 @@ config_load(struct config *conf, const char *conf_path,
|
||||||
.render_worker_count = sysconf(_SC_NPROCESSORS_ONLN),
|
.render_worker_count = sysconf(_SC_NPROCESSORS_ONLN),
|
||||||
.server_socket_path = get_server_socket_path(),
|
.server_socket_path = get_server_socket_path(),
|
||||||
.presentation_timings = false,
|
.presentation_timings = false,
|
||||||
|
.selection_target = SELECTION_TARGET_PRIMARY,
|
||||||
.hold_at_exit = false,
|
.hold_at_exit = false,
|
||||||
.notify = {
|
.notify = {
|
||||||
.raw_cmd = NULL,
|
.raw_cmd = NULL,
|
||||||
|
|
|
||||||
5
config.h
5
config.h
|
|
@ -166,6 +166,11 @@ struct config {
|
||||||
char *server_socket_path;
|
char *server_socket_path;
|
||||||
bool presentation_timings;
|
bool presentation_timings;
|
||||||
bool hold_at_exit;
|
bool hold_at_exit;
|
||||||
|
enum {
|
||||||
|
SELECTION_TARGET_PRIMARY,
|
||||||
|
SELECTION_TARGET_CLIPBOARD,
|
||||||
|
SELECTION_TARGET_BOTH
|
||||||
|
} selection_target;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
char *raw_cmd;
|
char *raw_cmd;
|
||||||
|
|
|
||||||
1
foot.ini
1
foot.ini
|
|
@ -17,6 +17,7 @@
|
||||||
# bell=none
|
# bell=none
|
||||||
# word-delimiters=,│`|:"'()[]{}<>
|
# word-delimiters=,│`|:"'()[]{}<>
|
||||||
# notify=notify-send -a foot -i foot ${title} ${body}
|
# notify=notify-send -a foot -i foot ${title} ${body}
|
||||||
|
# selection-target=primary
|
||||||
|
|
||||||
[scrollback]
|
[scrollback]
|
||||||
# lines=1000
|
# lines=1000
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue