rfvgyhn / min-ed-launcher

Minimal Elite Dangerous Launcher
MIT License
267 stars 10 forks source link

Spaces in cmd? #17

Closed alexzk1 closed 3 years ago

alexzk1 commented 3 years ago

Using bash script to launch launcher (see in its comment what is on steam):

#!/bin/bash

#add in steam
#qterminal -e ./run_ed.sh %command%

DELAY=60
GOV=$(cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor)
if [[ $GOV == *"ondemand"* ]]; then
   echo "CPU is set properly"
else
   echo "CPU is not set, setting to ondemand"
   sudo cpupower frequency-set -g ondemand
fi

echo "Running: $@"

./MinEdLauncher $@ /autoquit /EDH

read -t $DELAY -p "I am going to wait for $DELAY seconds only or press Enter ..."

Then it seems it parses wrong space (also I tried to do "$@" in bash script): image

rfvgyhn commented 3 years ago

I think this might be a quirk with qterminal. Not quoting the params causes that issue in all terminal emulators I tried but using "$@" in alacritty, konsole and gnome-terminal work. I'm not familiar enough with qterminal to know what's causing it. Do you have another terminal emulator you can try?

alexzk1 commented 3 years ago

Interesting, xterm worked. However it ignored /EDH switch asking for product.

rfvgyhn commented 3 years ago

Are you using v0.3.1? If so, you'll need to specify the /autorun flag.

alexzk1 commented 3 years ago

yes, that work, but now I can't figure /autorun + /autoquit, tried both and each 1. I need launcher close once game launched. It was before but not now... That's why I have pause in script 60s. So your launcher closes, but bash remains 60 more secs to read logs and closes too.

rfvgyhn commented 3 years ago

/autoquit only closes the launcher after the game has exited. Are you saying it's not closing after elite closes or are you wanting it to close right after it launches elite? If the former, can you post the last run of your log file with /autorun /autoquit? If the latter, that's not supported.

alexzk1 commented 3 years ago

Close itself when it launched elite immediately, i.e. exe should exit. It was so in version of 29th December (and it was ok with qterminal too). And why not supported? I can close console with all sub processes and elite keeps running.

alexzk1 commented 3 years ago

That was exact function I need from your launcher - self close on game started, so it do not appear in alt+tab and i don't have to click it. Other functions were nice bonus.

rfvgyhn commented 3 years ago

Not supported as in it was designed to mirror the default launcher's behavior since it uses the same flag.

I'm a little confused by what you want though. It sounds like you just don't want an extra window to appear but your script has a call to read -p which makes it seem like you do want a window to appear. If you don't want a window to appear, don't use the -e argument in your steam launch options. ./run_ed.sh %command%. Do note that the min launcher expects an interactive console if you don't specify both /autorun and /autoquit and will likely crash if you don't.

alexzk1 commented 3 years ago

read has timeout, so I can read what console says, like often it is "bad json" 2-3-4 times. Then it should auto close. Question is why it was working initially in such, i.e. it was autoclosing, so I upgraded script to have read.

rfvgyhn commented 3 years ago

Ah, I think I understand now. It's certainly unexpected that that's how it was working before v3.1. In fact, I'm unable to get it to run with qterminal with either v3.0 or v3.1 and I'm not sure how it ran for you in the first place.

After playing around with qterminal, I think there's an issue with how it implements the -e argument or you're expected to run it differently (again, not familiar with qterminal). It doesn't seem to prepare passed in arguments with spaces the same as the others I tried. Creating the following script test.sh and launching elite in steam via [terminal] -e ./test.sh %command% I get the following output. All are expected except qterminal.

#!/bin/sh

for i in "$@"
do
    echo "$i"
done

sleep 20
exit
# Alacritty
/mnt/games/Steam/Linux/steamapps/common/Proton 5.0/proton
waitforexitandrun
/mnt/games/Steam/Linux/steamapps/common/Elite Dangerous/EDLaunch.exe
/Steam
/novr

# Konsole
/mnt/games/Steam/Linux/steamapps/common/Proton 5.0/proton
waitforexitandrun
/mnt/games/Steam/Linux/steamapps/common/Elite Dangerous/EDLaunch.exe
/Steam
/novr

# Gnome Terminal
/mnt/games/Steam/Linux/steamapps/common/Proton 5.0/proton
waitforexitandrun
/mnt/games/Steam/Linux/steamapps/common/Elite Dangerous/EDLaunch.exe
/Steam
/novr

# xterm
/mnt/games/Steam/Linux/steamapps/common/Proton 5.0/proton
waitforexitandrun
/mnt/games/Steam/Linux/steamapps/common/Elite Dangerous/EDLaunch.exe
/Steam
/novr

# QTerminal
/mnt/games/Steam/Linux/steamapps/common/Proton
5.0/proton
waitforexitandrun
/mnt/games/Steam/Linux/steamapps/common/Elite
Dangerous/EDLaunch.exe
/Steam
/novr
rfvgyhn commented 3 years ago

Since this seems to be an issue with qterminal, I'm going to close this. Feel free to re-open if I've missed something.