Skip to content

config: add jay.env file#1121

Merged
mahkoh merged 5 commits into
masterfrom
jorth/jay-env
Jul 21, 2026
Merged

config: add jay.env file#1121
mahkoh merged 5 commits into
masterfrom
jorth/jay-env

Conversation

@mahkoh

@mahkoh mahkoh commented Jul 21, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 21, 2026 13:49
github-actions[bot]
github-actions Bot previously approved these changes Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a centralized environment-variable layer (src/env.rs) that can also load overrides from a jay.env file in Jay’s config directory, and migrates existing std::env lookups / hardcoded env-var name constants to this new mechanism across the compositor and CLI tooling.

Changes:

  • Add src/env.rs to load jay.env, provide typed env accessors, and unify env-var naming/precedence.
  • Migrate many call sites (compositor, portal, dbus, xwayland, Vulkan, cursor handling, CLI tools) to use crate::env::* instead of ad-hoc std::env reads and local constants.
  • Add CLI global options (--log-level, --config-dir) and update docs to describe jay.env and config-dir resolution.

Reviewed changes

Copilot reviewed 54 out of 54 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/xwayland.rs Switch DISPLAY env handling to crate::env.
src/xcon/xauthority.rs Load XAUTHORITY/HOME via crate::env accessors.
src/xcon.rs Read DISPLAY via crate::env accessor.
src/vulkan_core.rs Use JAY_VULKAN_VALIDATION from crate::env.
src/utils/xrd.rs Remove legacy XDG_RUNTIME_DIR helper.
src/utils/nice.rs Use JAY_NO_REALTIME and config dir via crate::env.
src/utils.rs Remove utils::xrd module export.
src/tools/tool_client.rs Derive log level and env paths from crate::env; adjust API.
src/tagged_acceptor.rs Use XDG_RUNTIME_DIR from crate::env.
src/state.rs Change State.config_dir to Option<&'static str>.
src/portal/ptl_display.rs Adjust runtime-dir watch path type usage.
src/portal.rs Use XDG_RUNTIME_DIR and initial_log_level() from crate::env; store runtime dir as &'static str.
src/pipewire/pw_con.rs Use XDG_RUNTIME_DIR from crate::env.
src/main.rs Add the new env module.
src/logind.rs Use XDG_SESSION_ID from crate::env.
src/logger.rs Log jay.env settings during logger install.
src/ifs/wl_surface/prime.rs Use JAY_NO_CLIENT_PRIME from crate::env.
src/gfx_apis/vulkan/device.rs Use JAY_NO_DESCRIPTOR_HEAP from crate::env.
src/forker.rs Use env-var names via crate::env (DISPLAY/WAYLAND_DISPLAY).
src/env.rs New module: parse/load jay.env, typed env accessors, config dir + initial log level.
src/ei/ei_acceptor.rs Use XDG_RUNTIME_DIR from crate::env.
src/dbus.rs Use DBUS_SESSION_BUS_ADDRESS / XDG_RUNTIME_DIR from crate::env and improve warnings.
src/cursor.rs Use cursor-related env vars via crate::env.
src/control_center/cc_xwayland.rs Display DISPLAY name via crate::env.
src/control_center/cc_compositor.rs Display WAYLAND_DISPLAY/config dir via crate::env.
src/config/handler.rs Use WAYLAND_DISPLAY name via crate::env; adjust config-dir response for new type.
src/config.rs Use JAY_NO_REALTIME from crate::env; adjust config-dir plumbing for new type.
src/compositor.rs Use initial_log_level()/config_dir()/WAYLAND_DISPLAY from crate::env; remove legacy constants + config_dir impl.
src/cli/xwayland.rs Update tool-client initialization API (log level via env).
src/cli/unlock.rs Update tool-client initialization API (log level via env).
src/cli/tree.rs Update tool-client initialization API (log level via env).
src/cli/set_log_level.rs Update tool-client initialization API (log level via env).
src/cli/seat_test.rs Update tool-client initialization API (log level via env).
src/cli/screenshot.rs Update tool-client initialization API (log level via env).
src/cli/run_tagged.rs Use WAYLAND_DISPLAY name via crate::env; update tool-client init API.
src/cli/run_privileged.rs Use XDG_RUNTIME_DIR/WAYLAND_DISPLAY/initial_log_level() via crate::env.
src/cli/reexec.rs Update tool-client initialization API (log level via env).
src/cli/randr.rs Update tool-client initialization API (log level via env).
src/cli/quit.rs Update tool-client initialization API (log level via env).
src/cli/pid.rs Update tool-client initialization API (log level via env).
src/cli/log.rs Update tool-client initialization API (log level via env).
src/cli/input.rs Update tool-client initialization API (log level via env).
src/cli/idle.rs Update tool-client initialization API (log level via env).
src/cli/damage_tracking.rs Update tool-client initialization API (log level via env).
src/cli/control_center.rs Update tool-client initialization API (log level via env).
src/cli/config.rs Use config_dir()/initial_log_level() from crate::env.
src/cli/color_management.rs Update tool-client initialization API (log level via env).
src/cli/clients.rs Update tool-client initialization API (log level via env).
src/cli.rs Add global --log-level/--config-dir and plumb into crate::env OnceLocks.
src/backends/metal/allocator.rs Use JAY_PRIME_METHODS from crate::env.
src/acceptor.rs Use XDG_RUNTIME_DIR from crate::env.
book/src/environment-variables.md Document jay.env, config-dir resolution, and JAY_LOG_LEVEL.
book/src/configuration/index.md Document config-dir override and jay.env placement.
book/src/cli.md Document new global CLI options (--log-level, --config-dir).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/env.rs
@mahkoh
mahkoh merged commit 2a5a60a into master Jul 21, 2026
13 checks passed
@mahkoh
mahkoh deleted the jorth/jay-env branch July 21, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants