Commit graph

4914 commits

Author SHA1 Message Date
Daniel Eklöf
589404b32e
meson: bump version to 1.10.0 2021-11-14 18:12:30 +01:00
Daniel Eklöf
d00d1b2514
changelog: prepare for 1.10.0 2021-11-14 18:10:43 +01:00
Daniel Eklöf
ef862bd747
Merge branch 'user-notification-cleanup' 2021-11-14 17:56:24 +01:00
Craig Barnes
759bc8007b user-notification: config: various small cleanups
* Rename user_notification_add() to user_notification_add_fmt()
* Add new user_notification_add() helper function
* Use xvasprintf() to replace user_notification_add_va()
* Make better use of helper functions in config.c
2021-11-14 15:16:32 +00:00
Daniel Eklöf
0686f94b18
config: remove options that were deprecated in 1.8.x
* [main].bell
* [main].jump-label-letters
* [main].url-launch
* [main].osc8-underline
2021-11-14 14:21:11 +01:00
Craig Barnes
26515b7ab9 changelog: fix minor grammatical mistake 2021-11-14 11:42:23 +00:00
Daniel Eklöf
9fedb43511
themes: solarized-dark: add commented out selection fg/bg colors 2021-11-13 17:48:04 +01:00
Daniel Eklöf
d8c7536124
themes: add solarized-dark-normal-brights
This is a custom version of solarized-dark, where the bright colors
have been generated by increasing the regular colors’ luminance by
20%.

In other words, this version does *not* have the solarized colors that
normally occupy the bright colors. Thus, if you want the full
solarized experience in e.g. editors, make sure to use editor-specific
24-bit themes.
2021-11-13 17:45:43 +01:00
Daniel Eklöf
d1a76a67c0
Merge branch 'configurable-dim-colors'
Closes #776
2021-11-13 17:40:34 +01:00
Daniel Eklöf
c01904a2c7
config: add [colors].dim0-7
This allows you to configure custom colors to be used when colors are
being dimmed (`\E[2m`).

It is implemented by color matching (just like
bold-text-in-bright=palette-based); the color-to-be-dimmed is matched
against the current color palette.

If it matches one of the regular colors (colors 0-7), the
corresponding “dim” color will be used.

If it matches one of the bright colors (colors 8-15), the
corresponding “regular” color will be used (but *only* if the “dim”
color has been set).

Otherwise, the color is dimmed by reducing its luminance.

The default behavior, i.e. when dim0-7 hasn’t been configured, is to
dim by reducing luminance for *all* colors. I.e. we don’t do any color
matching at all. In particular, this means that dimming a bright color
will *not* result in the corresponding “regular” color.

Closes #776
2021-11-13 17:39:08 +01:00
Daniel Eklöf
0d2a429109
doc: foot.ini: try to clear up the meaning of (AA)RRGGBB 2021-11-13 17:22:07 +01:00
Daniel Eklöf
c0e67e7c2f
config: scrollback.indicator.text: use value_to_wchars() 2021-11-13 12:40:59 +01:00
Daniel Eklöf
ff6b0fe011
Merge branch 'modify-other-keys-mode-2' 2021-11-13 11:38:08 +01:00
Daniel Eklöf
4a74050999
input: add support for modifyOtherKeys=2
Similar to modifyOtherKeys=1 (foot’s default, and only, mode), except
that:

* All modifiers (and not just Ctrl) generate \E[27;m;n~ escapes
* Regular keys (with modifiers) also generate \E[27;m;n~ escapes (for
  example, C-h no longer generates ^H, but \E[27;5;104~)

For our keymap based lookups, this is handled by adding
MOD_MODIFY_OTHER_KEYS_STATE<N> variants.

For “generic” keys, we simply adjust the conditions for when to emit a
\E[27;m;n~ escape - the only requirement is that at least one modifier
is active.
2021-11-13 11:09:07 +01:00
Daniel Eklöf
9412389051
Merge branch 'no-scrollback-multiplier-on-alt-screen'
Closes #787
2021-11-13 11:05:45 +01:00
Daniel Eklöf
ebcf5a4b4f
input: don’t apply [scrollback].multiplier when alt screen is in use
Closes #787
2021-11-13 11:05:36 +01:00
Daniel Eklöf
e026ef22f4
Merge branch 'config-refactor' 2021-11-13 11:04:54 +01:00
Daniel Eklöf
b5f7c414a9
changelog: boolean options 2021-11-13 11:04:30 +01:00
Daniel Eklöf
73c5754f5d
config: value_to_wchars(): free the target variable 2021-11-13 11:04:30 +01:00
Daniel Eklöf
2f0ab1da89
config: appease compiler
../../foot/config.c:154:50: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
    log_msg(log_class, LOG_MODULE, file, lineno, formatted_msg);
                                                 ^~~~~~~~~~~~~
../../foot/config.c:154:50: note: treat the string as an argument to avoid this
    log_msg(log_class, LOG_MODULE, file, lineno, formatted_msg)
2021-11-13 11:04:30 +01:00
Daniel Eklöf
d4b9ef7607
config: drop all warning logs from the tweak section 2021-11-13 11:04:30 +01:00
Daniel Eklöf
1f39c46c17
config: value_to_enum(), return conversion success/failure as a bool
Result is set through a pointer passed as an argument. Note that we
assume enums are 32-bit, and explicitly cast them to int*.

Static asserts have been added to ensure this invariant holds.
2021-11-13 11:04:29 +01:00
Daniel Eklöf
205f1f7c02
config: parse_section_main(): explicit return from each branch
Add UNREACHABLE() at the bottom
2021-11-13 11:04:29 +01:00
Daniel Eklöf
0c0a78498f
config: add value_to_dimensions() 2021-11-13 11:04:29 +01:00
Daniel Eklöf
d29c3cf7b7
config: add {str,value}_to_uint{16,32}()
This allows us to pass the final pointer directly to the conversion
functions, as well as allowing us to print outside-range errors.
2021-11-13 11:04:29 +01:00
Daniel Eklöf
3b27a665da
config: add value_to_str()
Takes a pointer to a char*, free:s it, and strdups the current value.
2021-11-13 11:04:29 +01:00
Daniel Eklöf
c2127fb2de
config: value_to_bool: return success/fail
Write boolean value to a pointer passed as argument, return conversion
success/failure
2021-11-13 11:04:29 +01:00
Daniel Eklöf
57c7fb33af
config: add value_to_enum() 2021-11-13 11:04:28 +01:00
Daniel Eklöf
328b53b166
config: let value_to_double() log errors 2021-11-13 11:04:28 +01:00
Daniel Eklöf
def2d80b0a
config: let value_to_ulong() log errors 2021-11-13 11:04:28 +01:00
Daniel Eklöf
176b85cb10
config: add LOG_CONTEXTUAL_{ERR,WARN,ERRNO}
These work like LOG_AND_NOTIFY_* but add contextual information: path
of the conf file, line number, section name, key/option name and the
value.
2021-11-13 11:04:28 +01:00
Daniel Eklöf
534e9d8bef
config: first argument to log_and_notify() is now a ‘struct context’ 2021-11-13 11:04:28 +01:00
Daniel Eklöf
958ef9dd3b
config: rename str_to_spawn_template() -> value_to_spawn_template() 2021-11-13 11:04:27 +01:00
Daniel Eklöf
70aec2068a
config: rename str_to_fonts() -> value_to_fonts() 2021-11-13 11:04:27 +01:00
Daniel Eklöf
4aa3d1d5f8
config: rename str_to_wchars() -> value_to_wchars() 2021-11-13 11:04:27 +01:00
Daniel Eklöf
5fb86859df
config: rename str_to_double() -> value_to_double()
* str_to_double() -> value_to_double()
* str_to_pt_or_px() -> value_to_pt_or_px()
2021-11-13 11:04:27 +01:00
Daniel Eklöf
922490217e
config: rename str_to_ulong() -> value_to_ulong()
* str_to_ulong() -> value_to_ulong()
* str_to_color() -> value_to_color()
* str_to_two_colors() -> value_to_two_colors()
2021-11-13 11:04:27 +01:00
Daniel Eklöf
92e08a04ed
config: value_to_bool(): fixup 2021-11-13 11:04:27 +01:00
Daniel Eklöf
5bb2973c39
config: rename str_to_bool() -> value_to_bool()
Change argument to a ‘struct context’ pointer
2021-11-13 11:04:26 +01:00
Daniel Eklöf
82a7885324
config: pass aggregated struct to top-level section handlers 2021-11-13 11:04:26 +01:00
Craig Barnes
0e5e68d82e main: improve handling of setlocale(3) return value
There's no need to call setlocale() twice, since the first call
returns the same value as the second.

We also handle a NULL return value explicitly and show a distinct
error message for that case, since it typically indicates a
misconfigured locale and not just a non-UTF8 locale.
2021-11-10 17:41:48 +00:00
Daniel Eklöf
3e04c4e4f4
wayland: guard XDG startup notification with HAVE_XDG_ACTIVATION
Fixes compilation on systems with “too old” wayland-protocols
2021-11-09 18:23:44 +01:00
Daniel Eklöf
a08f4bc551
PKGBUILD: drop
The bundled PKGBUILD has been pretty much identical to the one in the
AUR package “foot-git” for a long time now.
2021-11-07 15:58:42 +01:00
Daniel Eklöf
64f71c32f0
doc: foot.ini: mention “xkbcli interactive-wayland” 2021-11-07 15:51:53 +01:00
Daniel Eklöf
15a5a0e62e
Merge branch 'error-out-on-too-old-wl-seat-interface'
Closes #779
2021-11-07 15:39:10 +01:00
Daniel Eklöf
0183e13f50
wayland: error out if there aren’t any seats available
If there aren’t any seats available, input is not possible (neither
keyboard nor mouse input).

Note that this is not the same thing as e.g. no keyboard being plugged
in. In this case, there will be a seat, but without the keybaord
capability. Input may not be possible _right now_, but may be later,
if the user plugs in a keyboard.

Closes #779
2021-11-07 11:29:25 +01:00
Daniel Eklöf
347b90eaae
Merge branch 'xdga-launch' 2021-11-03 12:58:55 +01:00
Ronan Pigott
99d5bf64bc foot/client: implement xdga client activation
This is an application of the xdg activation protocol that will allow
compositors to associate new foot toplevels with the command that
launched them.

footclient receives an activation token from the launcher which the
compositor can use to track application startup. It passes the token
to the foot server, which then activates the new window with the token
to complete the startup sequence.
2021-10-31 18:52:29 -07:00
Daniel Eklöf
347e79f8a1
config: format all (well, most) error messages in the same way
path:lineno: [section].key: value: message desribing what’s wrong with value
2021-10-31 20:58:17 +01:00
Daniel Eklöf
86cc0e0c95
config: use "[section].key" syntax when logging errors 2021-10-31 20:25:54 +01:00