1

I recently installed Firefox developer edition following this tutorial and I want to start Firefox by pressing Alt+F2 and writing firefox in there. In terminal I added an alias,

firefox=/opt/firefox/firefox

and it works but it doesn't work from Alt+F2. How do I do that?

1 Answers1

1

Bash aliases do not work from the Alt+F2 prompt as aliases are not expanded when the shell is not interactive (as per man bash).

If you want to run /opt/firefox/firefox by typing firefox in the Alt+F2 prompt then follow the steps below.

  1. Create a folder named bin in your home directory. Make sure ~/bin/ is in your PATH. If not, add it.
  2. Create a text file named firefox in the the aforementioned crated folder (i.e. in ~/bin/).
  3. Add the following lines to the firefox file

    #!/bin/bash
    /opt/firefox/firefox
    
  4. Save the firefox file and make it executable.

Note: now you can remove the alias you created if you wish as it would be redundant after following the steps above.

pomsky
  • 68,507
  • Hello, I did all the steps mentioned by you above, but my problem still persists.. – C. Cristi Feb 12 '19 at 12:30
  • sadly, I haven't rebooted, but I will right now, I will comment the response! 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux this is my unaname -a output, for the version and flavour, UBUNTU 18.04 LTS, and this is my echo $PATH output: /opt/firefox/firefox:/home/darenian/.local/share/umake/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin – C. Cristi Feb 12 '19 at 14:17
  • Came back with an answer, and yeah! It definetely works, thank you so much, can I ask you one more thing? such that can I edit the question and repond how can I make possible one more thing? – C. Cristi Feb 12 '19 at 14:19
  • @C.Cristi Please remove the newly added part from the question as otherwise it may get closed as "too broad" (questions should be limited to a specific problem with enough detail here). Post a new question for the other issue if needed, but refer to this first: https://askubuntu.com/q/975178/480481 I believe this should be enough to solve your other problem. – pomsky Feb 12 '19 at 14:34
  • done! and than you so much for the linked post! – C. Cristi Feb 12 '19 at 14:51