How To Create A Panel Icon That Launches Terminal & Runs A Command?

This is a question primarily for @Aravisian

If you recall, I made a post about how launching flatpak's via icons causes an X11 window manager crash, which logs me out of the system. However, if I launch Steam Flatpak via terminal using this command, it launches successfully without logging me out of the OS.

flatpak run -v com.valvesoftware.Steam

I'd like to create an icon that I can place on my panel, that within a single click, will launch terminal, and run that command above. How do I do this? I'd appreciate it if you could help me with this. Thanks!


Try with;

sh -c "COMMANDS"

Sorry, but I am not a terminal wizard, this is why I am asking Aravisian on how to do this, because he is. Also, I had to correct a major error in my post, as it still had a different game in my dang clipboard, a game in which I have since removed off the drive. And I fixed an error in my title too, to clarify better.


Okay, I'll let @Aravisian answer then.

I'm curious about how @Aravisian will reply, here i will try to give you an answer anyway (so i can learn from him too) :slight_smile:

  • Right click on your desktop folder

  • Create an empty txt

  • Save it as you like "file.txt"

  • Copy this into the file created and save it.

#!bin/bash
flatpak run -v com.valvesoftware.Steam
  • Right click on the file -> Properties -> Permissions

  • Allow executing file as program

Then when you double-click on it it's gonna ask you if you wanna run it or display the content of it. If you run it, it should work.

I didn't test it, but I'm very curious to see if my idea is good or nah :slight_smile:

3 Likes

First, I've noticed that you are a newcomer to the forum, so I wanted to welcome you officially, to Zorin OS. :blush:

Second, I've already noticed you helping other users on the forum, and now you are helping me. So you just earned yourself a :star2: for being so stellar!

Text file created, and named Steam...

There was a slight error in your commands that was causing a failure. You need to remove the hashtag, or the execution will not work. This is how the text file needed to be.

I already changed the permission in the properties of the file, to allow run as program. Now choosing, executing in terminal...

Steam has been launched!

Terminal does show that Steam is throwing lots of can't connect to the x session manager, but despite those errors, which I always get in terminal, Steam launches fine with that command, and I can play games too.

And now, one last screenshot to show that I just beautified the Steam icon, to match my beautiful theme...HEHE

Thank you so much DV1sual, your amazing! :grin:


1 Like

Glad it kinda worked :slight_smile:

Great icon too!

3 Likes

I will reply with:
I'm too late to the party. :wink:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.