Open vorot93 opened 11 years ago
Isn't there such a thing as $TERM which they use? If you set it to konsole it should use that.
I guess implementing a function such as I use in one of my scripts, would work nicely? Basically it just goes through a list of terminals, and the first terminal it gets a hit on, it will use that terminal.
function check() {
if command -v $1; then
return "1"
else
return "0"
fi
}
function checkterms() {
TERMS=(rxvt urxvt xterm uxterm aterm konsole gnome-terminal)
for i in "${TERMS[@]}"; do
check $i
if [ $? == 1 ]; then
TERMINAL="$i"
break
fi
done
}
I believe he’s just asking for
Depends: xterm | gnome-terminal | konsole
@swordfischer here is a simpler version of your script:
function checkterms() {
TERMS=(rxvt urxvt xterm uxterm aterm konsole gnome-terminal)
for i in "${TERMS[@]}"; do
if command -v $i &>/dev/null; then
TERMINAL="$i"
break
fi
done
}
Actually this functions doesn't recognize which desktop you are running, so it's not the best approach $TERM normally is already set do a default terminal, but usually is set to a simple xterm.
The best solution around is available in this script:
code.google.com/p/chromium-source-browsing/source/browse/scripts/xdg-terminal?repo=third-party--xdg-utils
Actually this repository is full of interesting "xdg like" scripts with a very permissive license.
Now steam-launcher depend on "xterm | gnome-terminal | konsole" but if Konsole is installed and xterm is not - Steam still trying to install xterm on launch.
Steam package or the application? I note the steam launch script tries to run xterm if zenity is not installed, that could probably use $TERM
Steam package or the application?
Application.
@johndrinkwater $TERM doesn't necessarily output the terminal, and is not really used for something like this. @thor27 Usually the terminal sets the $TERM variable, and as mentioned to @johndrinkwater, is it not likely to work.
Instead @james147 solutions seems to be the smartest workaround, as we're already working with the shell in the launch script, and don't really need any dependencies :)
@swordfischer I don't think so.
My Konsole $TERM variable is "xterm", which was not set by konsole. @james147 solution, as I mentioned, is NOT completely correct, because, as I sad before, It doesn't prioritize which desktop you are actually running.
The BEST solution, as I said before, is found, freely, in a very permissive license, over Google-Chrome open source project "Chromium" here:
@thor27 You don't think so what? $TERM for xterm coincidentally returns the name of the binary, this it not true with the rxvt variants for instance. As far as I know, $TERM is mostly used for termcolors and screen settings for editors/terminal multiplexers etc. How would you go about prioritizing terminals via desktop, as not everyone has a DE, nor a standard setup? It would make more sense if the launcher just walked through a list of the most common terminals, launching the first hit. Also xdg-terminal is not from Chromium but freedesktop.org (XDG = X Desktop Group).
@swordfischer sorry, I misunderstood what you said before about $TERM, you are right!
Why not use xdg-terminal? If you just walk by a list of desktops, it will open Konsole on my unity just because is the first on the list, and I somehow have it installed because of Kate dependency which is awfull!
with xdg-terminal, and you are not using any DE, the script will do EXACTLY what you are saying, take a look at line 399 from it.
I know that xdg-terminal is not from Chromium, I didn't said that, sorry if didn't make it clear before. What I said is that is available there (was just the first search I did on google)
All xdg* scripts are pretty nice to make the best choice available, if you are running any DE or are not running any.
Anyway this discussion is pointless. Valve doesn't seems to care about it
For what it's worth, the conventional Debian/Ubuntu-centric way of doing this is to depend on xterm | x-terminal-emulator
so that the user can choose any package which provides the x-terminal-emulator
virtual package and default to xterm
if none are currently installed. Then launch the terminal by running the x-terminal-emulator
command, which runs the terminal configured by the user through the Alternatives system (possibly after doing some checks similar to the xdg-terminal script to try to match the terminal to the current running desktop environment under the assumption that users don't know about the Alternatives system).
Hate to bump this, but I just tried to install the latest steam_latest.deb because steam complained about the client being out of date, and I get the deb complaining about me not having xterm, gnome-terminal, and konsole. I run Lubuntu 12.04.1, which uses lxterminal.
Now, the right thing would to be to use x-terminal-emulator instead of adding every terminal as a dependency. Eventually it just gets silly.
@wmarone That's addressed by #665.
Not a chance this could be extended to include xfce4-terminal
?
Currently Ubuntu package depends on either gnome-terminal or xterm. It'd be nice to add support for Konsole KDE terminal emulator.