Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 10463  / 3 Years ago, fri, november 12, 2021, 5:01:17

I'm new to this and can't quite wrap my head around it.
I want to run specific firefox profile which, so I just put this line in a text file:
firefox -p Profile
make it executable and run it. It works fine.



Now what advantages I gain if I make a .desktop file that has in the command line basically the same?
Other than the option to set an icon and add it to the launcher?
Are there any fundamental differences?


More From » executable

 Answers
6

For using by command-line:




  1. You can make executable file (let by command gedit myfp)as follows:



    #!/bin/bash
    [Your commands Here]

  2. Give it execution permission by chmod +x myfp and put this file in location: /usr/local/bin


  3. Now you can easily execute [Your commands Here] by running command mypf in Terminal.




For using by GUI (as a Launcher):




  1. You can create a desktop file (let by command gedit mypf.desktop) as follows:



    [Desktop Entry]
    Name=My Firefox
    Comment=My Profile
    Exec=[your command here]
    Type=Application
    Icon=[path/to/icon-file]


    where [Desktop Entry] remains constant and [your command here] is may be firefox -p or directly mypf if available. [path/to/icon-file] is path to icon file.


  2. Give it execution permission by chmod +x mypf.desktop and put in location /usr/share/applications.

  3. You can also create symbolic link to your desktop by ln -s /usr/share/applications/mypf.desktop ~/Desktop and launch from Desktop easily.



Additional Info: It can be run at startup by putting Desktop file in $HOME/.config/autostart.






Which method/way should you make? is depends upon How it will be executed and For what purpose?



Also visit following community helps:





Hope this helps you to create executable file for using by command-line script and/or desktop file for using by GUI as a launcher.


[#23534] Saturday, November 13, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mocipe

Total Points: 161
Total Questions: 106
Total Answers: 118

Location: Cambodia
Member since Thu, Oct 7, 2021
3 Years ago
;