Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to open login page if xterm is not installed #2

Closed
KaffeinatedKat opened this issue Dec 30, 2020 · 19 comments
Closed

Fails to open login page if xterm is not installed #2

KaffeinatedKat opened this issue Dec 30, 2020 · 19 comments

Comments

@KaffeinatedKat
Copy link

If xterm is not installed and you try to open Heroic it asks if you want to log in and then does nothing. You should make it so if xterm is not installed ask if it wants you to install it for you or tell you to go install it

@yuyutsupoudel
Copy link

Yea. Just a black screen is not helpful at all. Having error message would be really nice.

@SergeyLatyshev
Copy link

Yea. Just a black screen is not helpful at all. Having error message would be really nice.

You can see one when you launch it in your terminal.
Anyway, I think that specifying a terminal should be added to the HGL config.

@KaffeinatedKat
Copy link
Author

You can see one when you launch it in your terminal.

Yea but to the average user there gunna open it and the window will just be blank and they wont think to launch it via the terminal and think its just broke

@flavioislima
Copy link
Member

Hey guys! Thanks for testing this!
I'm trying to figure out a way of getting the default terminal but it seems there is none right now.
I'll add a check for xterm and if there is no xterm I'll check for the most common ones like Konsole, gnome-terminal, and rxvt.
I thought would be possible to get from $TERMINAL or $TERM but at least on my distro, this returns nothing.

@SergeyLatyshev
Copy link

I'll add a check for xterm and if there is no xterm I'll check for the most common ones like Konsole, gnome-terminal, and rxvt.

Don't forget about lxterminal and xfce4-terminal.

@flavioislima
Copy link
Member

I'll add a check for xterm and if there is no xterm I'll check for the most common ones like Konsole, gnome-terminal, and rxvt.

Don't forget about lxterminal and xfce4-terminal.

That's why would be nice to have a ENV variable with the default terminal on all distros.
I'll try to put an embedded terminal on the app, that would be easier.

@KaffeinatedKat
Copy link
Author

You can just replace xterm in the code with x-terminal-emulator, x-terminal-emulator opens in the system default terminal

@flavioislima
Copy link
Member

You can just replace xterm in the code with x-terminal-emulator, x-terminal-emulator opens in the system default terminal

I saw some people saying this but on Manjaro it just says that not exists so I don't think this will work on all distros :(

@KaffeinatedKat
Copy link
Author

A stack exchange post says you can run update-alternatives --config x-terminal-emulator and then it should work so you can try that. and if that does make it work you can configure heroic to run that the first time you open it

@Newbytee
Copy link
Contributor

I wonder, is it necessary to do this in a terminal emulator at all? I imagine it'd be nicer to just paste the SID into the application directly.

@SergeyLatyshev
Copy link

x-terminal-emulator opens in the system default terminal

AFAIK, it's for Debian/Ubuntu only.

@Newbytee
Copy link
Contributor

Newbytee commented Jan 1, 2021

x-terminal-emulator opens in the system default terminal

AFAIK, it's for Debian/Ubuntu only.

Seems to be available on Fedora as well.

@SergeyLatyshev
Copy link

Seems to be available on Fedora as well.

But not on Arch or Manjaro.

@flavioislima
Copy link
Member

I wonder, is it necessary to do this in a terminal emulator at all? I imagine it'd be nicer to just paste the SID into the application directly.

That's true.

Most of the things we have now are part of this first MVP I did, there is a lot of things that need to be improved.

For some things, I'm limited on how NodeJS handle execution on external programs, like Legendary. Node does not support getting the output of the execution in real-time, I can only get the result of the call. Because Javascript is Single-threaded. So I searched everywhere and discovered that this is a feature request not implemented yet.

So that's why I will never be able to show the output of the installation process, the terminal will need to be used in that case.

For the login, it is possible to call legendary auth, without the xterm, and open a dialog to put the SID, and then call legendary auth --sid ${sid}.

I'll make this change on the next release. But after that I'll start working on personalizing the WINEPREFIX and Wine version to launch games, I think this will be the most important one.

My wife is working on the Logo and on the design. So I'll make some visual improvements soon as well.

@Newbytee
Copy link
Contributor

Newbytee commented Jan 1, 2021

I wonder, is it necessary to do this in a terminal emulator at all? I imagine it'd be nicer to just paste the SID into the application directly.

For some things, I'm limited on how NodeJS handle execution on external programs, like Legendary. Node does not support getting the output of the execution in real-time, I can only get the result of the call. Because Javascript is Single-threaded. So I searched everywhere and discovered that this is a feature request not implemented yet.

So that's why I will never be able to show the output of the installation process, the terminal will need to be used in that case.

I'm thinking a possible way of handling this better would be to team up with the Legendary developer and let Legendary expose a programmer-friendly API that can be used instead of shell commands. Granted, this would require a fair bit of work and I imagine there are more pressing issues at the moment.

@flavioislima
Copy link
Member

I wonder, is it necessary to do this in a terminal emulator at all? I imagine it'd be nicer to just paste the SID into the application directly.

For some things, I'm limited on how NodeJS handle execution on external programs, like Legendary. Node does not support getting the output of the execution in real-time, I can only get the result of the call. Because Javascript is Single-threaded. So I searched everywhere and discovered that this is a feature request not implemented yet.
So that's why I will never be able to show the output of the installation process, the terminal will need to be used in that case.

I'm thinking a possible way of handling this better would be to team up with the Legendary developer and let Legendary expose a programmer-friendly API that can be used instead of shell commands. Granted, this would require a fair bit of work and I imagine there are more pressing issues at the moment.

Yeah, that would be ideal.
There are some people asking about an API and they have already one that works with Python but they said that do not will implement it for other languages: derrod/legendary#129

So I don't know, I think I'll need to deal with those limitations or implement an API in Javascript but I was looking for it on the EGS website and I could not find anything related to how to use theirs to implement mine.

@Newbytee
Copy link
Contributor

Newbytee commented Jan 1, 2021

Yeah, that would be ideal.
There are some people asking about an API and they have already one that works with Python but they said that do not will implement it for other languages: derrod/legendary#129

It is possible to call Python functions from Node.js via e.g. zerorpc though it would require you to create some sort of bindings manually I think.

So I don't know, I think I'll need to deal with those limitations or implement an API in Javascript but I was looking for it on the EGS website and I could not find anything related to how to use theirs to implement mine.

Pretty sure it's all reverse-engineered.

@flavioislima
Copy link
Member

Yeah, that would be ideal.
There are some people asking about an API and they have already one that works with Python but they said that do not will implement it for other languages: derrod/legendary#129

It is possible to call Python functions from Node.js via e.g. zerorpc though it would require you to create some sort of bindings manually I think.

So I don't know, I think I'll need to deal with those limitations or implement an API in Javascript but I was looking for it on the EGS website and I could not find anything related to how to use theirs to implement mine.

Pretty sure it's all reverse-engineered.

Nice, I'll take a look.

For now, I'll replace Xterm with a shell inside the app using this: https://shelljs.io/examples.
looks good but I never used it before.

@flavioislima
Copy link
Member

So, as version 0.4.0 changed the Login Flow, I'll close this Issue. Thanks!

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

No branches or pull requests

5 participants