0

I downloaded cool-retro-term and put it in /home/crs/cool-retro-term/ and I copied the cool-retro-term.desktop to /usr/share/applications/.

I used sudo nano cool-retro-term.desktop to modify the EXEC to /home/crs/cool-retro-term/cool-retro-term.

I don't know what to run in the terminal, maybe cool-retro-term or sudo cool-retro-term -h to open the application.

What are the steps? (I am a beginner)

4
  • Did you download the source? If so have you compiled it yet as described here? You might also need to make the program executable with chmod +x /home/crs/cool-retro-term/cool-retro-term.
    – TheSchwa
    Oct 31, 2014 at 16:59
  • yes, i did everything like there and i ran alson the command you told me
    – xyz
    Oct 31, 2014 at 17:06
  • 1
    As @Bernd mentioned below, you can't execute the script using cool-retro-term from anywhere because it isn't on your PATH. Running /home/crs/cool-retro-term/cool-retro-term from the terminal or clicking the .desktop icon you added to the Dash should work however. If it does not please post the terminal output for the first command.
    – TheSchwa
    Oct 31, 2014 at 17:09
  • yes, like this it works, but i want to know if i can make a command like cool-retro-term so when i call it to run the application
    – xyz
    Oct 31, 2014 at 17:12

2 Answers 2

0

assuming that your program resides in /home/crs/cool-retro-term/
open .bashrc file by typing gedit .bashrc in terminal
scroll down to the last line, add new line and then paste this PATH=$PATH:/home/crs/bin
make a new file in gedit/terminal, add following code:

#!/bin/bash
/home/crs/cool-retro-term/cool-retro-term

then save it in /home/crs/bin by whatever name you want.
make this file executable by chmod u+x /home/crs/bin/<filename you just saved above>
then run this file from terminal it should launch the program.

if you have any problem please comment.

6
  • /home/student/uso/tema1/year/cool-retro-term/cool-retro-term: /home/student/uso/tema1/year/cool-retro-term/cool-retro-term: cannot execute binary file this is the error
    – xyz
    Oct 31, 2014 at 17:40
  • This is wrong. The bash in front of /home/crs/cool-retro-term/cool-retro-term is what causes the error. Also the script is not needed if you would just put everthing from /home/crs/cool-retro-term/ in /home/crs/bin. That wouldn't clutter your home directory. Just follow my answer.
    – Bernd
    Oct 31, 2014 at 18:01
  • @user3582615 I have edited my answer. I made correction in bash script(please take a look to my answer again) by removing bash from bash /home/crs/cool-retro-term/cool-retro-term. you should now get error now.
    – Alex Jones
    Oct 31, 2014 at 23:26
  • yes it works. THanks . i have another question . if i want to run it with sudo cool-retro-term it says the command not found. if i run sudo cool-retro-term/cool-retro-term it is OK. how to make now to run just sudo cool-retro-term -h for example?
    – xyz
    Nov 1, 2014 at 9:46
  • @user3582615 see when you added new PATH in .bashrc file all the commands in bin folder will be available for only crs user. when you use sudo you are becoming root user. for root user your bashrc file does not work ! for that you have to have to use full path ! i dont recommend you to modify profile file(similar to .bashrc file for you) for root user ! besides when you will run that program by becoming root i.e. using sudo, the program will have settings different from when run without sudo. hope it helps, if not pls comment.
    – Alex Jones
    Nov 2, 2014 at 13:15
0

Edit ~/.profile and put in:

if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Then move everything from /home/crs/cool-retro-term/ to /home/crs/bin

Now every time you put something in /home/crs/bin you can just execute it with the name of the file.

8
  • if i write ~/.profile in terminal it says Permision Denied
    – xyz
    Oct 31, 2014 at 16:48
  • That is because just putting ~/.profile in your terminal tries to run that file, but it isn't a program so it is not allowed to run. You need to edit that file with an editor. You can use nano in the terminal or gedit without a terminal to do that. Also note that those lines maybe are already in there. In that case you don't need to put it in twice, but you just continue with the steps after that.
    – Bernd
    Oct 31, 2014 at 16:51
  • still it does not run when i type cool-retro-term, i did like you said, i need to run another command to make it exectubale? or the modifiy the exec from cool-retro-term.desktop?
    – xyz
    Oct 31, 2014 at 17:03
  • Somebody (wrongly..) edited my stuff to say "$HOME/crs/bin" please check again it looks like the above. Also could you execute tree while you are in /home/crs/bin for me please?
    – Bernd
    Oct 31, 2014 at 17:58
  • Just put in pastebin or something.
    – Bernd
    Oct 31, 2014 at 18:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .