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

double clicking to run #10

Open
capricorez opened this issue Dec 28, 2023 · 4 comments
Open

double clicking to run #10

capricorez opened this issue Dec 28, 2023 · 4 comments

Comments

@capricorez
Copy link

i wan't able to run a shell script with java inside by double clicking. unless i added "[[ -f ~/.profile ]] && source ~/.profile" to .bash_profile. also to run a jar by double clicking I need to fix java.desktop "Exec=/home/deck/.local/jdk/jdk1.8.0_391/bin/java" by adding "-jar %f" like "Exec=/home/deck/.local/jdk/jdk1.8.0_391/bin/java -jar %f"

@BlackCorsair
Copy link
Owner

Hi! Sorry, but this script only installs the jdk, it doens't automate any kind of .desktop file.

@Anthonyn56
Copy link

Anthonyn56 commented Jan 28, 2024

I ran into the same issue, so just wanted to document/walk through my experience.

After successfully installing the jdk, I was able to run my program with

java -jar Game.jar

Trying to make it simpler to launch the application (add to Steam as non-Steam game or by double-clicking instead of typing) I made a RunGame.sh with

#!/bin/bash
clear
java -jar Game.jar

It worked on my laptop with openSUSE Tumbleweed but did not on my Steam Deck. Running the script in Konsole it said

line 3: java: command not found

I added the new line to .bash_profile with the suggestion above

[[ -f ~/.profile ]] && source ~/.profile`

but nothing changed for me until restarting. After restart, RunGame.sh ran correctly in desktop mode. It launches and works through Steam as a Non-Steam game in desktop mode.

Edit: I forgot I was able to run and play Game.jar in gaming mode by enabling terminal in Dolphin, running Dolphin as Non-Steam game, and running 'java -jar -Game.jar' there. So...???...I have even less of an idea

In gaming mode, however, it launches and crashes. In addition, I had a script to have a "desktop mode" in gaming mode. Trying RunGame.jar through Konsole in the nested "desktop mode" returned the same error. I'd imagine it could be a gamescope/wayland or whatever conflict with my specific app, but I am out of my depth even guessing.

Thank you guys for the jdk script and the additions!

@BlackCorsair
Copy link
Owner

Hi @Anthonyn56 !

I'm glad that my script helps you :)

About your issue... Could you describe me what game or program are you trying to run? Or if you're using a guide, link it here so I can see your use case.

I've just tested what you said. I created a file in the desktop named RunGame.sh. This is the content of the file:

#!/bin/bash

clear
echo "testing java version"
java -version
echo "did you see it?"

Then I set the file as executable, you can do it from the terminal or from the desktop UI, it doesn't matter:
image

And then added the game to steam as a non-steam game. If I run the "game", nothing happens since everything I'm executing in the script is really intended for a shell output, but if I run steam from a terminal*...
image

I can check what it says. So please, try doing the same so I can help you debugging what's happening here.

If you post me the entire log of steam for some reason, please make sure there's no personal information. If you miss something I'll delete your post, but please check it before posting.

BR

*You just need to type steam in konsole to run steam, nothing fancier.

@Anthonyn56
Copy link

Sorry, about that, got bombarded with tests, and this kept getting pushed back and back.
The game is XMage.
I was able to get the echo script working in desktop mode. I had difficulties doing this in gaming mode as...Steam is running and I can't start it from terminal...I think?
My end goal was to get this game easily running in gaming mode like any other Non-Steam game.
I understand if this is too late or not interesting anymore. I can try to promptly provide images this time around.
Thank you!

@BlackCorsair BlackCorsair reopened this May 31, 2024
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

3 participants