Bottles icon indicating copy to clipboard operation
Bottles copied to clipboard

[Bug]: flatpak run --command='bottles-cli' com.usebottles.bottles run... error

Open indigomirage opened this issue 1 year ago • 6 comments

Describe the bug

Hi There - I am having an issue with the "Use Bottles as wine command" technique mentioned on the help site (https://docs.usebottles.com/advanced/use-bottles-as-wine-command).

Bottles, in general, seems to work (successfully installed several programs from within the application/GUI, but after creating the wine stub file for cli access as follows...:

#!/bin/sh flatpak run --command='bottles-cli' com.usebottles.bottles run -b mybottle -e "$@"

...I can't get anything to run. At a minimum, I'd expect a "wine --version" command to work, but it returns an error as follows...: myname@myhost:~$ wine --version usage: bottles-cli run [-h] -b BOTTLE [-e EXECUTABLE] [-p PROGRAM] [--args-replace] [args ...] bottles-cli run: error: argument -e/--executable: expected one argument

Any help would be greatly appreciated!

To Reproduce

  • Install Bottles from Flatpak
  • Create new bottle within application (and verify it's working by running application from within UI)
  • Make a new file named wine in ~/.local/bin or any directory in your PATH with the following content (as per documentation):
  • #!/bin/sh
  • flatpak run --command='bottles-cli' com.usebottles.bottles run -b MyBottle -e "$@"
  • chmod +x ~/.local/bin/wine
  • Run wine --version (produces error)

Package

Flatpak from Flathub

Distribution

Fedora 39

Debugging Information

Official Package: true
Version: '51.10'
DE/WM: gnome
Display:
    X.org: true
    X.org (port): :0
    Wayland: true
Graphics:
    vendors:
        intel:
            vendor: intel
            envs:
                DRI_PRIME: '1'
            icd: /usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/intel_hasvk_icd.x86_64.json:/usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/intel_icd.x86_64.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/intel_hasvk_icd.i686.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/intel_icd.i686.json
    prime:
        integrated: null
        discrete: null
Kernel:
    Type: Linux
    Version: 6.6.12-200.fc39.x86_64
Disk:
    Total: 8320196608
    Free: 8320028672
RAM:
    MemTotal: 15.5GiB
    MemAvailable: 13.9GiB
Bottles_envs: null

Troubleshooting Logs

No response

Additional context

No response

indigomirage avatar Jan 23 '24 19:01 indigomirage

Looks like a duplicate of #3210

13xforever avatar Jan 29 '24 07:01 13xforever

Having looked at the links in #3210 and related, I am still at a loss as to how to make this work.

The closest thing to a solution mentions running preferences from within the cli, but I can't find any documentation on how to do this.

There's another comment about using the --args-replace option, but I've had no luck with that either (same issue, or broken commands).

Would be grateful for any ideas, or some indication that there might be a fix forthcoming.

indigomirage avatar Jan 30 '24 01:01 indigomirage

I don't think #3210 is related, but this would fix it:

flatpak run --command='bottles-cli' com.usebottles.bottles run --args-replace -b MyBottle -e "$@"

That being said - wine --version results in flatpak run --command='bottles-cli' com.usebottles.bottles run --args-replace -b MyBottle -e --version, which makes the argument parser think that --version is a separate option, not part of the -e option.
Do you maybe fundamentally misunderstand what "Use Bottles as wine command" is used for?

promisedlandt avatar Feb 14 '24 14:02 promisedlandt

I don't think #3210 is related, but this would fix it:

flatpak run --command='bottles-cli' com.usebottles.bottles run --args-replace -b MyBottle -e "$@"

That being said - wine --version results in flatpak run --command='bottles-cli' com.usebottles.bottles run --args-replace -b MyBottle -e --version, which makes the argument parser think that --version is a separate option, not part of the -e option.
Do you maybe fundamentally misunderstand what "Use Bottles as wine command" is used for?

Well, I've got a tool (yabridge) that makes a wine --version call inside it. Following the advice on the bottles documentation, I created a bottles wrapper script (named 'wine') so that yabridge wouldn't have to know I'm using bottles. Unfortunately it breaks. When I run wine -- version, I get the error. Since I'm not in a position to rewrite yabridge, I'm at an impasse if I want to use Bottles to ease my various winev(and similar) configuration woes.

indigomirage avatar Feb 14 '24 14:02 indigomirage

Well, I've got a tool (yabridge) that makes a wine --version call inside it. Following the advice on the bottles documentation, I created a bottles wrapper script (named 'wine') so that yabridge wouldn't have to know I'm using bottles. Unfortunately it breaks. When I run wine -- version, I get the error. Since I'm not in a position to rewrite yabridge, I'm at an impasse if I want to use Bottles to ease my various winev(and similar) configuration woes.

I guess you'll have to adapt the wine shell script to print something if --version or --help are passed, using getopt or getopts.

promisedlandt avatar Feb 14 '24 14:02 promisedlandt

That's actually not a bad idea, you know...!

I'll tinker.

indigomirage avatar Feb 14 '24 14:02 indigomirage