mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
Merge branch 'systemd-units-socket-activation'
This commit is contained in:
commit
098f0aafd4
8 changed files with 41 additions and 22 deletions
|
|
@ -53,9 +53,16 @@
|
|||
* Starlight theme (the default theme) updated to [V4][starlight-v4]
|
||||
* Background transparency (alpha) is now disabled in fullscreened
|
||||
windows ([#1416][1416]).
|
||||
* Foot server systemd units now use the standard
|
||||
graphical-session.target ([#1281][1281]).
|
||||
* If `$XDG_RUNTIME_DIR/foot-$WAYLAND_DISPLAY.sock` does not exist,
|
||||
`footclient` now tries `$XDG_RUNTIME_DIR/foot.sock`, then
|
||||
`/tmp/foot.sock`, even if `$WAYLAND_DISPLAY` and/or
|
||||
`$XDG_RUNTIME_DIR` are defined ([#1281][1281]).
|
||||
|
||||
[starlight-v4]: https://github.com/CosmicToast/starlight/blob/v4/CHANGELOG.md#v4
|
||||
[1416]: https://codeberg.org/dnkl/foot/issues/1416
|
||||
[1281]: https://codeberg.org/dnkl/foot/pulls/1281
|
||||
|
||||
|
||||
### Deprecated
|
||||
|
|
|
|||
15
client.c
15
client.c
|
|
@ -374,16 +374,19 @@ main(int argc, char *const *argv)
|
|||
const char *xdg_runtime = getenv("XDG_RUNTIME_DIR");
|
||||
if (xdg_runtime != NULL) {
|
||||
const char *wayland_display = getenv("WAYLAND_DISPLAY");
|
||||
if (wayland_display != NULL)
|
||||
if (wayland_display != NULL) {
|
||||
snprintf(addr.sun_path, sizeof(addr.sun_path),
|
||||
"%s/foot-%s.sock", xdg_runtime, wayland_display);
|
||||
else
|
||||
connected = (connect(fd, (const struct sockaddr *)&addr, sizeof(addr)) == 0);
|
||||
}
|
||||
if (!connected) {
|
||||
LOG_WARN("%s: failed to connect, will now try %s/foot.sock",
|
||||
addr.sun_path, xdg_runtime);
|
||||
snprintf(addr.sun_path, sizeof(addr.sun_path),
|
||||
"%s/foot.sock", xdg_runtime);
|
||||
|
||||
if (connect(fd, (const struct sockaddr *)&addr, sizeof(addr)) == 0)
|
||||
connected = true;
|
||||
else
|
||||
connected = (connect(fd, (const struct sockaddr *)&addr, sizeof(addr)) == 0);
|
||||
}
|
||||
if (!connected)
|
||||
LOG_WARN("%s: failed to connect, will now try /tmp/foot.sock", addr.sun_path);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -121,14 +121,14 @@ the foot command line
|
|||
of a socket provided by a supervision daemon (such as systemd or s6), and
|
||||
use that socket as it's own.
|
||||
|
||||
Two systemd units (foot-server@.{service,socket}) are provided to use that
|
||||
feature with systemd. They need to be instantiated with the value of
|
||||
$WAYLAND_DISPLAY (multiples instances can co-exists).
|
||||
Two systemd units (foot-server.{service,socket}) are provided to use that
|
||||
feature with systemd. To use socket activation, only enable the
|
||||
socket unit.
|
||||
|
||||
Note that starting *foot --server* as a systemd service will use
|
||||
the environment of the systemd user instance; thus, if you need specific
|
||||
environment variables, you'll need to import them using *systemctl --user
|
||||
import-environment* or use a drop-in for the foot-server service.
|
||||
the environment of the systemd user instance; thus, you'll need
|
||||
to import *$WAYLAND_DISPLAY* in it using *systemctl --user
|
||||
import-environment WAYLAND_DISPLAY*.
|
||||
|
||||
*-H*,*--hold*
|
||||
Remain open after child process exits.
|
||||
|
|
|
|||
|
|
@ -146,6 +146,11 @@ terminfo entries manually, by copying *foot* and *foot-direct* to
|
|||
Used to construct the default _PATH_ for the *--server-socket*
|
||||
option, when no explicit argument is given (see above).
|
||||
|
||||
If the socket at default _PATH_ does not exist, *footclient* will
|
||||
fallback to the less specific path, with the following priority:
|
||||
*$XDG\_RUNTIME\_DIR/foot-$WAYLAND\_DISPLAY.sock*,
|
||||
*$XDG\_RUNTIME\_DIR/foot.sock*, */tmp/foot.sock*.
|
||||
|
||||
## Variables set in the child process
|
||||
|
||||
*TERM*
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
[Service]
|
||||
ExecStart=@bindir@/foot --server=3
|
||||
Environment=WAYLAND_DISPLAY=%i
|
||||
UnsetEnvironment=LISTEN_PID LISTEN_FDS LISTEN_FDNAMES
|
||||
NonBlocking=true
|
||||
|
||||
[Unit]
|
||||
Requires=%N.socket
|
||||
Description=Foot terminal server mode for WAYLAND_DISPLAY=%i
|
||||
Description=Foot terminal server mode
|
||||
Documentation=man:foot(1)
|
||||
PartOf=graphical-session.target
|
||||
|
||||
[Install]
|
||||
WantedBy=wayland-instance@.target
|
||||
WantedBy=graphical-session.target
|
||||
9
foot-server.socket
Normal file
9
foot-server.socket
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[Socket]
|
||||
ListenStream=%t/foot.sock
|
||||
|
||||
[Unit]
|
||||
PartOf=graphical-session.target
|
||||
ConditionEnvironment=WAYLAND_DISPLAY
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical-session.target
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[Socket]
|
||||
ListenStream=%t/foot-%i.sock
|
||||
|
||||
[Install]
|
||||
WantedBy=wayland-instance@.target
|
||||
|
|
@ -329,13 +329,13 @@ if systemd.found() or custom_systemd_units_dir != ''
|
|||
|
||||
configure_file(
|
||||
configuration: configuration,
|
||||
input: 'foot-server@.service.in',
|
||||
input: 'foot-server.service.in',
|
||||
output: '@BASENAME@',
|
||||
install_dir: systemd_units_dir
|
||||
)
|
||||
|
||||
install_data(
|
||||
'foot-server@.socket',
|
||||
'foot-server.socket',
|
||||
install_dir: systemd_units_dir)
|
||||
endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue