Skip to content

Conversation

@mio-19
Copy link
Contributor

@mio-19 mio-19 commented Dec 22, 2025

fix #189

@intgr
Copy link
Owner

intgr commented Dec 30, 2025

Thanks! Sorry, I forgot about this PR for a little while.

Looking into it. Also, Clippy has some suggestions, see failing checks.

src/main.rs Outdated
if !envs.is_empty() {
envs.extend(prepare_pulseaudio_cookie(ctx)?);
} else {
return Ok(envs);
Copy link
Owner

Choose a reason for hiding this comment

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

Seems weird to me that you've made both the socket and the cookie optional.

So we can get into a state where ego adds permissions to the socket, sets PULSE_SERVER variable, but then fails to handle the cookie, so PulseAudio will be half-configured.

I would use presence of either the socket or the cookie as signal whether PulseAudio should be enabled. If the other part can't be found, then still error out, as something is misconfigured.

Seems it would be as simple as changing the detection logic above ...

    let path = ctx.runtime_dir.join("pulse");
    if !path.is_dir() {

... to check existence of the socket /run/user/1000/pulse/native, not the directory /run/user/1000/pulse as it does now.

Unless you see any downsides with this approach?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made only socket optional in latest commit

Copy link
Owner

@intgr intgr left a comment

Choose a reason for hiding this comment

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

Thanks! Pushed a few Clippy fixes, but other than that, this is great!

@intgr intgr changed the title Handle missing PulseAudio socket/cookie fix(pulse): handle missing PulseAudio socket when directory exists Jan 6, 2026
@intgr intgr merged commit 3379837 into intgr:main Jan 6, 2026
1 check passed
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.

error with systemwide pulseaudio

2 participants