Hi Greg,

This has occurred to me, but seemed like a bit of a hack and less
convenient to transfer to other machines...

> do it manually, not with update-alternatives
Why so? Could I not feed the script path to update-alternatives install?


Thanks

On Thu, 22 Aug 2024 at 14:02, Greg Wooledge <g...@wooledge.org> wrote:
>
> On Thu, Aug 22, 2024 at 13:09:06 +0300, Dmitrii Odintcov wrote:
> > Let's say I want to install VS Code / Codium as an alternative for
> > `/usr/bin/editor`, but I want it to always run with `--wait
> > --reuse-window` so that other software can rely on the editor
> > returning after the file is saved (like `crontab -e` does, for
> > example)
> >
> > I cannot do `update-alternatives --install /usr/bin/editor editor
> > "$(which codium) --wait --reuse-window" 0` because the "alternative
> > path doesn't exist".
> >
> > Suggestions?
>
> Write a wrapper script like
>
>
> #!/bin/sh
> exec codium --wait --reuse-window "$@"
>
>
> and use this script as the symlink target of /usr/bin/editor (do it
> manually, not with update-alternatives).  Don't forget to chmod 755.
>

Reply via email to