Commit graph

17 commits

Author SHA1 Message Date
sewn
16872ecc41
meson: use meson feed feature for scdoc input
Removes the need for a shell dependency.
2023-06-14 17:15:20 +00:00
Daniel Eklöf
e78319fccd
utmp: rewrite utmp logging
This patch generalizes the utmp support, to not only support
libutempter, but also ulog (and in the future, even more interfaces).

* Rename config option main.utempter to main.utmp-helper
* Add meson option -Dutmp-backend=none|libutempter|ulog|auto
* Rename meson option -Ddefault-utempter-path to -Dutmp-default-helper-path
* utmp is no longer detected at compile time, but at runtime instead.

Meson will configure the following pre-processor macros, based on the
selected utmp backend:

* UTMP_ADD - argument to pass to utmp helper when adding a record (starting foot)
* UTMP_DEL - argument to pass to utmp helper when removing a record (exiting foot)
* UTMP_DEL_HAVE_ARGUMENT - if defined, UTMP_DEL expects an extra argument ($WAYLAND_DISPLAY)
* UTMP_DEFAULT_HELPER_PATH - path to the default utmp helper binary

The documentation has been updated to mention which arguments are
passed to the helper binary.

Closes #1314
2023-05-22 18:47:25 +02:00
Daniel Eklöf
aa10b1d2da
Add support for creating utmp records
This patch adds support for creating utmp records using the ‘utempter’
helper binary from the ‘libutempter’ package.

* New config option ‘main.utempter’
* New meson command line option, -Ddefault-utempter-path. Defaults to
  auto-detecting the path.

The default value of the new ‘main.utempter’ config option depends on
the meson command line option ‘-Ddefault-utempter-path’.

If ‘main.utempter’ is *not* set to ‘none’, foot will try to execute
the utempter helper binary to create utmp records when a new terminal
is instantiated. The record is removed when the terminal instance is
destroyed.
2022-09-23 23:02:25 +02:00
Daniel Eklöf
9b343fd9fb
meson: stop using deprecated functions, require meson >= 0.58
* get_pkgconfig_variable() -> get_variable()
* prog.path() -> prog.full_path()
* meson.build_root() -> meson.global_build_root()
2022-02-27 11:28:11 +01:00
Daniel Eklöf
7639186865
terminfo: install to $datadir/foot/terminfo by default, append to TERMINFO_DIRS
As of 2021-07-31, ncurses ships its own version of foot’s terminfo.

Since:

* It doesn’t have the non-standard Sync,Tc,setrgbf,setrgbb
  capabilities.
* It doesn’t set hs,fsl,dsl (statusbar).
* We want to be able to update our termminfo without waiting for an
  ncurses release.
* Foot should be installable and usable on Linux systems that doesn’t
  have the latest ncurses.

we still want to ship our own version. We can however not install it
to the default terminfo location (e.g. /usr/share/terminfo), since it
will collide with the ncurses provided files.

Our options are to either rename our terminfo to something else, or to
keep the name, but install our terminfo files somewhere else.

The first option would be the easy one. However, I think it makes
sense to use the same name. For example, a user that SSH’s into a
remote system that does *not* have our own version installed,
but *does* have the ncurses one, will gracefully fall back to that
one, which is better than manually having to set
e.g. TERM=xterm-256color.

Now, if we want to use the same name, we need to install it somewhere
else. But where? And how do we ensure our version is preferred over
the ncurses one?

I opted to $datadir/foot/terminfo (e.g. /usr/share/foot/terminfo) by
default. It makes it namespaced to foot (i.e. we’re not introducing a
new “standard” terminfo location), thus guaranteeing it wont collide
with ncurses.

To enable applications to find it, we export TERMINFO_DIRS. This is a
list of *additional* directories to search for terminfo files. If it’s
already defined, we *append* to it.

The nice thing with this is, if there’s no terminfo in that
location (e.g. when you SSH into a remote), the default terminfo
location is *also* searched. But only *after* having searched through
TERMINFO_DIRS.

In short: our version is preferred, but the ncurses one (or an older
version of our terminfo package!) will be used if ours cannot be
found.

To enable packagers full control over the new behavior, the existing
meson command line options have been modified, and a new option added:

-Dterminfo=disabled|enabled|auto: *build* and *install* the terminfo
files.

-Dcustom-terminfo-install-location=<path>: *where* the terminfo files
are expected to be found.

This *needs* to be set *even* if -Dterminfo=disabled. For example, if
the packaging script builds and packages the terminfo files separate
from the regular foot build. The path is *relative to $prefix*, and
defaults to $datadir/foot/terminfo.

This is the value that will be appended to TERMINFO_DIRS. Note that
you can set it to ‘no’, in which case foot will *not* set/modify
TERMINFO_DIRS. Only do this if you don’t intend to package foot’s
terminfo files at all (i.e. you plan on using the ncurses ones only).

-Ddefault-terminfo=foot. Allows overriding the default TERM
value. This should only be changed if the target platform doesn’t
support terminfo files.

Closes #671
2021-08-17 21:04:30 +02:00
Daniel Eklöf
51250c64cc
doc: meson: no need to check for scdoc again
We’re already checking for scdoc in the top-level meson.build
2021-07-24 16:42:47 +02:00
Craig Barnes
9b208f56de doc: ctlseqs: rename "foot-ctlseqs.5" man page to "foot-ctlseqs.7"
Section 5 is for "file formats and conventions", which doesn't really
apply to terminal escape sequences. Section 7 is for "miscellaneous".
2021-02-23 18:49:57 +00:00
Daniel Eklöf
38e2700f74
doc: ctlseqs: document CC0 control sequences 2021-02-23 09:31:44 +01:00
Daniel Eklöf
a683a13120
Revert "meson: add -Dwith-docs=disabled|enabled|auto"
This reverts commit 9d6b2c9342.
2020-09-24 16:44:26 +02:00
Daniel Eklöf
9d6b2c9342
meson: add -Dwith-docs=disabled|enabled|auto
When enabled, man pages are generated and installed, along with
README.md, CHANGELOG.md and LICENSE. This requires ‘scdoc’ as a make
dependency.

When disabled, ‘scdoc’ is no longer required, no man pages will be
built, and no documentation at all is installed.

Defaults to ‘enabled’.
2020-09-24 16:39:19 +02:00
Daniel Eklöf
b957f2faa7
doc: meson: @01@ -> @1@ 2020-08-27 21:22:27 +02:00
Daniel Eklöf
5c4af880fc
doc: rename footrc.5 to foot.ini.5, and update references 2020-08-27 20:02:30 +02:00
Daniel Eklöf
62c4f1e5b4
doc: rename foot.5 -> footrc.5 2020-07-27 20:09:40 +02:00
Daniel Eklöf
0c4d43e285
man: footclient.1: initial documentation 2019-11-03 13:47:19 +01:00
Daniel Eklöf
286db002f8
meson: fix version generation from git
run_command() was only run at configure time, meaning the generated
version (that was passed on to the sources via -DFUZZEL_VERSION)
became stale.

Fix by implementing a shell script that generates a header file, and
wrap this in a custom target that is run every time (but the generated
file is only updated when the version changes)
2019-10-19 22:09:52 +02:00
Daniel Eklöf
9855d18ba7
doc: add foot.5 (configuration) 2019-08-12 20:00:09 +02:00
Daniel Eklöf
d405c7022f
doc: add foot.1 man page 2019-08-11 20:54:28 +02:00