What is the most portable Unix shell
Shell scripting to create a .desktop file for a portable application
Bash Shell Scripting: Create a portable app link.
The term shell used in operating systems refers to the operating system's command interpreter. In general, it is a powerful text interface that manifests itself in the form of a terminal (console) and essentially performs three important work areas: managing the operating system, running applications and interacting with them, and as basic environmental programming. And scripting refers to the technique of designing and creating scripts using a shell.
Shell scripts are extremely useful. It's a good idea to write the requirements that we have and then edit scripts that do that work for us. In this particular case, we will use it to create application links (shortcuts) in the start menu and on the desktop of portable, self-executing, and self-contained apps.
Often times we have downloaded and installed applications that when installed or run are not or are not in the repositories of our GNU / Linux distribution. The corresponding .desktop files are not created in the process by the same, or in the best case, it will not be placed in the correct path, so after refreshing the start menu it will be read and displayed in the list of installed packages of the operating system.
Hence, we have to rely on using applications such as "Alacarte" or "Menulibre" to manually create the corresponding link in the start menu.
And while these graphics applications are very easy to use for this purpose, it is never too much to know Create your own script to perform this operation and know exactly how this operation is performed within the operating system.
If you are unfamiliar with creating and / or using shell scripting files, this is the place to go read this previous post (Shell, Bash and Scripts) Para Empezar and then if necessary, explore all publications on the subject.
Creating the program with shell scripting
For space reasons we assume that we already know how to create a script from scratch, i.e. we already know how to create the header or the first few parts of our script, and we go straight to the contents of the script.
However, when in doubt, check this out Previous post (Building Your Program Step-by-Step Using Shell Scripting - Part 1) to clear up any doubts.
Script content on mousepad
Since you can use the code to analyze and omit the header, the following script automatically performs the following processes:
- Check if it is being used as super user root or super user root.
- Delete previous links in the application that were created by a previous version.
- Create the new desktop file (link) for the application in its own folder at the user's home.
- Assign user owner permission to the created file.
- Assign the appropriate read / write / execute permissions to the created file.
- Create the new symbolic links to the required routes.
- Refresh the Start menu to see the .desktop file that was created.
- Run a specific url for the application being built.
It is recommended to create this file in the folder that contains the application / executable in question with the icon (picture / logo) indicated in it and that this folder is in the path instead of the route ie.
I hope this little script will enable you to resolve your related needs on the subject! Until the next article.
As I leave you the link on the official Gnome website on the subject and this video:
- How to make sky lantern fuel
- Is service a good company to work for?
- Can you create an impenetrable force field?
- Why should it be legal to be gay?
- How did Marilyn Milian become a judge
- Which music genres are ethnically different
- Nurses What's wrong with our profession
- Bleaches damaged paint
- Which is the best 2032 battery
- What are Shiats University Hostal Reviews
- Why is God unfair to people
- What did community college teach you
- What is Amazon Spark
- How fast can Ichigo Flash step
- How do business setup consultants advise the UAE
- What was the Qutub Minar used for?
- Can INTPs ever really understand each other completely?
- What is the importance of friendship counseling
- What is construction vacuum cleaner
- What will happen in the long night
- What is a financial report
- Has anyone ever really eaten a baby
- Why is wearing black considered nifty
- What is a dream what is reality