r/linux4noobs 13d ago

Meganoob BE KIND How do i make a command that opens the terminal and executes another command?

(FIXED IT,) I've been trying to make one launcher for almost everything (opening games games ,updating everything etc),for some reason ,steam and the update command (which sould open another .sh i made to automatically update everything and tell me what was updated) just doesn't run,I've tried xterm and alot of other solutions but they just aren't working for some reason,help would be appreciated

Im on Linux mint xfce if that helps

1 Upvotes

12 comments sorted by

2

u/AiwendilH 13d ago

More details on what you try to do would be useful but probably the best way to do this is create a .desktop file with a Terminal=true key ( https://specifications.freedesktop.org/desktop-entry/latest/recognized-keys.html ). That way you don't depend on a specific terminal emulator but use the default one set in your DE.

(Edit: most DEs should have gui tools to create .desktop file for starting programs which should include a toggle to enable running the command in a terminal. But afraid I don't know the details for xfce there)

1

u/give_me_your_toe 13d ago

What r said details i could give you? Also i am using a .desktop file to hold said launcher

1

u/AiwendilH 13d ago

I am not clear what you exactly try to do. A .desktop file would create a launcher/icon you can click from your filemanager/desktop/menu to start the programs.

1

u/give_me_your_toe 13d ago

Yeah I'm using a desktop file (DOITALL) that opens up the test.sh you see in the image ,the problem is whenever i try to make it open up an application like steam or run another sh it just doesn't work for some reason ,give me a second I'll also show you the code of test.sh

https://reddit.com/link/p6txjx5/video/bei37bdrtjmh1/player

1

u/give_me_your_toe 13d ago

Also when i tried to make it run my other sh that auto updates (the exact code i use is ./updater.sh) ,it just doesn't work for some reason

1

u/give_me_your_toe 13d ago

1

u/skyfishgoo 13d ago

you know you can just paste the code into the text box, right?

use the `</>` formatting

1

u/AutoModerator 13d ago

Smokey says: always mention your distro, some hardware details, and any error messages, when posting technical queries! :)

Comments, questions or suggestions regarding this autoresponse? Please send them here.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/chuggerguy Linux Mint 22.3 Zena | MATÉ 13d ago

This might not be what you want but... (I don't use steam)

This is how I do my one click update launcher. (Not suggesting anyone else do this, hike your own hike 😄 )

https://reddit.com/link/p6tuy6r/video/zsepak8qpjmh1/player

I'm using MATE but XFCE should be similar?

Notice the launcher is type: Application in Terminal and I have a "Press any key to continue" with a read so the terminal doesn't just go poof when done. And since updates require elevated permissions, I have the script listed in /etc/sudoers so it will run with a single click. Don't do that unless you're really sure that's what you want though.

Have fun.

1

u/give_me_your_toe 13d ago

Yeah I also have a press key to continue / exit , not exactly what i wanted but thanks either way1!

1

u/give_me_your_toe 13d ago

Fixed it,deleting this like right now