How can I create an executable in Linux (beginner)?

The deal is that I just recently began to use Linux (Lubuntu) and I need some basic knowledge. My brightness on my Packard Bell Dot netbook is always on the highest, and the brightness control buttons aren't working. I found a command line to set the brightness level to a specific percentage. I‘d like to create three executables: 85%, 50%, 25%. My question is how do I make a file on my desktop which when clicked upon it runs a certain line of command. I don‘t want to open the terminal every single time.

Thanks.


Initially, you need to write a shell script. Just open a text editor and write

#!/usr/bin
your command here

Next, all you need to do is just to create a .desktop file in Ubuntu.

Open your terminal and type as

sudo -i
cd /usr/share/applications/
nano <your_scriptname.desktop>

Then, it will give you an opened file and copy & paste these lines there one by one.

[Desktop Entry]
Type=Application
Terminal=true
Name=<what script name you want write here >
Icon=<any icon you want to give that iconspath>
Exec=<place here path of your script>

Save and close with CTRL+X+Y and hit Enter. You will have that script on your desktop as an application.

Like this, you can similarly create three applications for the three scripts you made.

I hope that helps.