Skip to content

fix: find whisper-cli in ~/.local/bin when PATH omits it#34

Merged
ElbertePlinio merged 2 commits into
mainfrom
fix/whisper-cli-local-bin-fallback
Jul 9, 2026
Merged

fix: find whisper-cli in ~/.local/bin when PATH omits it#34
ElbertePlinio merged 2 commits into
mainfrom
fix/whisper-cli-local-bin-fallback

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

What

The engine's find_command only walked PATH, so a menu-launched app on a desktop session whose PATH omits ~/.local/bin could not find the whisper-cli that setup itself installs there (GNOME/Wayland sessions often don't source .profile for GUI apps).

  • engine::find_command now falls back to ~/.local/bin after the PATH walk; lookup extracted into a testable find_in_dirs.
  • The CLI's duplicate find_command now reuses the engine's (keeping its explicit-path handling), so whisper-cli, pickscribe-cleanup-gui, etc. get the same fallback.
  • This supersedes the .desktop PATH-wrapper idea from the issue: fixing lookup in the engine covers every launch path (menu, autostart, file manager), not just the installer-written launcher. install.sh is untouched.

docs/releases/UNRELEASED.md updated.

Tested

  • cargo test --workspace --locked --all-targets (80 passed, incl. new find_in_dirs regression test)
  • cargo check -p pickscribe-app --features pickscribe-app/custom-protocol

Not tested

  • Live repro on a session without ~/.local/bin on PATH.

Closes #5

The engine's find_command only walked PATH, so a menu-launched app on a
desktop session without ~/.local/bin on PATH could not find the
whisper-cli that setup itself installs there. Fall back to ~/.local/bin
after the PATH walk, and make the CLI's find_command reuse the engine's
instead of duplicating the lookup.

Fixes #5
@ElbertePlinio

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa6f913f4e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/engine/mod.rs
.map(|path| std::env::split_paths(&path).collect())
.unwrap_or_default();
if let Some(home) = std::env::var_os("HOME") {
dirs.push(PathBuf::from(home).join(".local/bin"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid reporting fallback-only helpers as runnable by name

When a GUI session omits ~/.local/bin from PATH, this fallback makes command_exists("wl-copy")/ydotool/wtype return true for files that Command::new("wl-copy") cannot actually spawn, because paste.rs and sounds.rs still execute the bare command name rather than the resolved PathBuf. In that environment, a local-only wl-copy can now short-circuit clipboard fallback to /usr/bin/xclip and fail with starting wl-copy; before this change command_exists stayed false and the next PATH-visible backend was tried.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Valid — fixed. paste.rs, sounds.rs, and kwin.rs now resolve tools via find_command and spawn the returned path instead of the bare name, so command_exists and the actual spawn can no longer disagree. The recorder default (pw-record) gets the same resolution.

…pawns

With the ~/.local/bin fallback, command_exists could report a tool that
Command::new(bare_name) cannot spawn. Resolve via find_command and spawn
the returned path in paste, sounds, kwin, and the recorder default.
@ElbertePlinio

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 931a804d08

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ElbertePlinio ElbertePlinio merged commit dd1761a into main Jul 9, 2026
1 check passed
@ElbertePlinio ElbertePlinio deleted the fix/whisper-cli-local-bin-fallback branch July 9, 2026 22:50
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.

curl installer: ensure ~/.local/bin is on PATH for menu-launched app (whisper-cli discovery)

1 participant