Today I wanted to make my script easier to use on my Linux desktop. I wanted to add it like a regular app, so I did some digging and here’s what I found and did.
First things first
I made my script executable. Oh, and I also got rid of the .sh at the end of the file name. It’s cleaner that way, you know? I made sure I did the same for the .desktop file I was going to create. Also, I considered whether I wanted to use this script system-wide or just for me. But let’s keep it simple and focus on the personal use for now.
Permissions and all that jazz
I learned that I had to give execute permission to my script file to avoid those annoying ‘permission denied’ errors. I found out the easiest way to do this was to right-click on the file, go to properties, and then permissions, and check the box that says “Allow executing file as program”. I guess I could have done it with the command line, but this was way easier.
Running the script
Before going all fancy, I made sure I could run the script from the terminal. I just typed ./ followed by my script’s name and hit enter. Worked like a charm! Then I moved on to the actual task of turning it into an app.
Finding my way through the desktop menus
I found out that if I right-clicked on the main menu icon, there’s this “configure” option. Clicking that and then “Open the menu editor” gave me all the options I needed. It was pretty straightforward from there. I could add new items, categorize them, the works!
Putting it all together
I created a new item in the menu editor, filled in the name of my script, the command to run it, and even a nice icon to go with it. There’s this “Browse” button in the icon section that lets you pick any image you want. I spent a bit of time finding a good one, not gonna lie. I wanted it to look just right.
The end result
After saving my changes in the menu editor, my script was right there in the application menu, just like any other app. Clicking it launched my script, no terminal needed. It felt pretty good to see it all come together. Now, I can easily access and run my script without digging through folders or typing commands.
It was way easier than I thought it would be. It was a good learning experience, and now I can add any of my scripts as apps. Maybe I’ll try making them system-wide apps later, but for now, I’m happy with how things turned out.