-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running foot server as a service results in incomplete terminal environment #9
Comments
That is the right assumption. I'm being very careful with the list of copied variables, so it is includes only those that I deemed absolutely necessary. Still less conservative than Arch defaults though. If you run the shell in On the possible actions:
|
The issue that led me to this was actually the path variable not being set correctly (in foot the path was completely different from the default path set by arch, and I dont think environment.d could solve this (unless it can somehow get the original path variable and then set the new path variable to the old one. I wanted to avoid starting daemons from the sway config because of the note that they wouldnt be picked up by the assign cgroups script, of course its not a huge deal but its less than ideal. Im not sure import-environment x would be ideal either, it would work for the path, but theres various other variables that get set by arch by different packages, such as the CLOUDSDK_* variables. Obviously I am not very clear on the ins and outs of all of this, so am curious what your thoughts are about the above |
Good point. It can be worked around with
There's no original path.
There is a way to import a PATH value used by the shell with user environment generators though, something like this: Code#!/usr/bin/sh
# /etc/systemd/user-environment-generators/99-profile-d-path
# Get PATH from /etc/profile and all /etc/profile.d/* snippets and pass it to the systemd
if [ -f /etc/profile ]; then
source /etc/profile
echo PATH=$PATH
fi And I believe ArchWiki/systemd/User can offer much more on that topic.
No, I wish there was but alas... There's only But I'm thinking I need to add Sorry if I skipped any important point, but it's past midnight here so I'll check once again in the morning. |
Thankyou for all of this, it all makes sense. I've started using.config/environment.d which is loaded into zsh shells through .zshenv, which is working well, and also applying to anything started by sway (eg firefox and MOZ_ENABLE_WAYLAND). |
I added the I'd actually prefer if another new option for adding an explicitly specified set of variables would be used instead. I.e. |
Note that soon foot is likely to add systemd socket activation. https://codeberg.org/dnkl/foot/pulls/890 So, after starting the systemd socket unit for foot, |
Yep, I saw #13. Just been busy between work and Fedora things to draft a proper reply. In regards to the topic of the current issue, I have following (incomplete) solution: #!/bin/sh
# vim: ts=4 sw=4 noet
# /etc/systemd/user-generators/foot-server-env
#
# Generate environment for the specific user service
# `systemd-generator(7)`
# Generator arguments: normal-dir, early-dir, late-dir
# We need to use the last one for the drop-in files
LATE_DIR="$3"
# Read environment variable from the user's shell
get_user_var () {
/usr/bin/env -- "$SHELL" -l -c "echo \$$1"
}
generate_path_dropin () {
DESTDIR="$LATE_DIR/$1.d"
mkdir -p "$DESTDIR"
cat >"$DESTDIR/environment.conf" <<-EOF
# Automatically generated by $0 at $(date --utc)
[Service]
Environment=PATH=$(get_user_var PATH)
EOF
}
generate_path_dropin foot-server.service I believe my debugging has stopped on an attempt to figure out why this script completely ignores |
When starting foot --server as a systemd user service, the resulting foot clients are missing many environment variables which are present in terminals not started as a user service (starting alacritty directly). I believe this is because the session.sh only exports a small number of variables to systemd and dbus, but am not sure the best course of action to resolves this.
#6 related
The text was updated successfully, but these errors were encountered: