Commit graph

26 commits

Author SHA1 Message Date
Johannes Altmanninger
4a2e5df554 Allow any theme to be dark or light, determine it automatically
By definition, "[colors]" is a dark theme and the alternate theme
("[colors2]") is light.

A user who doesn't know about this definition (or about "[colors2]"),
might configure "[colors]" to be a light theme.
This is a reasonable mistake because
a. "colors" is an innocuous name
b. users who failed to run
   "git merge-file ~/.config/foot/foot.ini $old_foot/foot.ini $new_foot/foot.ini"
   after upgrading foot might not have "colors2" in their config.

The wrongly reported color theme (CSI 997) causes issues when apps
use it for selecting colors.  I don't know if any relevant app does,
but learning this cost me some time, and maybe it's a good idea to
address this, even though it's technically a user error.

Solution 1:
Stop responding to CSI 996.
The Contour spec is [ambiguous](https://github.com/contour-terminal/contour/issues/1659#issuecomment-3596983337).
Apps might want to prefer the more widely available OSC 10/11 for detecting dark/light mode.
I think Vim does; and at least NeoVim still uses the Contour protocol to subscribe to notifications.
We'd still send DSR 2031 notifications, however that would work just fine for apps like NeoVim that ignore the payload and only use it as trigger to query for the theme again via OSC 10/11.
(Since we can only switch between two themes, we wouldn't even waste bandwidth.)

Solution 2:
Assuming the themes are only meant for the dark/light mode toggle,
rename them to "colors-dark" and "colors-light",
and maybe report color theme only for those
(and not when the user has the legacy "colors" and "colors2").

Solution 3 (implemented here):
Assuming the themes are intended to be used for things other than
dark/light toggle,
- have foot automatically detect whether the current theme is dark or light
- if needed, allow users to override this (e.g. "colors.is_dark = true")

I guess I have a slight preference for solution 2 because it seems
relatively simple. But I don't know what's the goal.

Apparently switching to dark/light mode at dusk/dawn is a feature
of macOS and there are solutions like darkmon for other OSes, so I
guess dynamic switching is a useful feature in principle.
2025-12-11 13:21:25 +01:00
Daniel Eklöf
34520aa16e
meson: allow building with wayland-protocols as a subproject 2023-08-08 19:32:45 +02:00
Craig Barnes
013cca646d meson: use wrap files for fcft/tllist subprojects
See: https://mesonbuild.com/Wrap-dependency-system-manual.html
2020-12-19 22:43:09 +00:00
Daniel Eklöf
d86b0ddc21
fcft/tllist: remove git submodules 2020-01-11 14:59:39 +01:00
Daniel Eklöf
70f0f02016
fcft: bump 2020-01-09 21:09:25 +01:00
Daniel Eklöf
9829539af8
fcft: ignore embeddedbitmap for non-scalable fonts 2020-01-02 18:42:21 +01:00
Daniel Eklöf
434da5cc27
fcft: update to 0.4.0 2019-12-05 19:33:18 +01:00
Daniel Eklöf
7e0e6762eb
fcft: update to 0.3.5 2019-12-04 21:49:56 +01:00
Daniel Eklöf
faaf6b7972
fcft: update to 0.3.4 2019-12-04 21:46:27 +01:00
Daniel Eklöf
bbb8f8af49
fcft: update to 0.3.3 2019-12-04 20:15:52 +01:00
Daniel Eklöf
bb425be8ac
fcft: update to 0.3.2 2019-12-03 21:39:22 +01:00
Daniel Eklöf
0f15f0ba43
fcft: update to 0.3.0
fcft now calculates the underline and strikeout integer positions,
making our rendering code much simpler.
2019-12-03 21:03:52 +01:00
Daniel Eklöf
644f114909
fcft: fixup 2019-12-01 19:25:06 +01:00
Daniel Eklöf
69dc53409e
fcft: bump to 0.2.0 2019-12-01 19:22:09 +01:00
Daniel Eklöf
e5b588977f
fcft: bump 2019-12-01 18:04:03 +01:00
Daniel Eklöf
a041b334af
fcft: bump 2019-12-01 17:45:43 +01:00
Daniel Eklöf
1585edd194
fcft: bump 2019-12-01 16:32:34 +01:00
Daniel Eklöf
30335ef32a
fcft: include <fcft/fcft.h>, and use fcft/stride.h instead of local copy 2019-12-01 14:03:24 +01:00
Daniel Eklöf
fd9c28464d
fcft: use fcft instead of local copy of font.c/font.h 2019-12-01 13:43:51 +01:00
Daniel Eklöf
9f91760886
tllist: add git submodule directly under subprojects 2019-12-01 13:39:35 +01:00
Daniel Eklöf
ed176352e2
tllist: remove git submodule and local copy under subprojects 2019-12-01 13:38:59 +01:00
Daniel Eklöf
55d65e049f
tllist: import static copy under 'subprojects' 2019-11-24 15:38:31 +01:00
Daniel Eklöf
0c8f7f2694
tllist: completely remove 2019-11-24 15:36:51 +01:00
Daniel Eklöf
248935cce6
tllist: switch to codeberg repo + bump 2019-11-18 22:28:31 +01:00
Daniel Eklöf
df9a77663c
tllist: bump 2019-11-18 16:55:07 +01:00
Daniel Eklöf
dd7058d368
tllist: use tllist from external git repository 2019-11-17 19:10:35 +01:00