Page 2 of 2

Re: exit terminal when script is done? SOLVED

Posted: Thu Jul 24, 2014 10:05 pm
by GDixon
In the morning i will give this a go.

Againg thank you for helping the feeble and simple mnded. This week my eyes have been crossing and my fingers have been making simple mistakes so i need to give it a rest.

My HP with the huge 15" screen is being rebuilt and i have it in pieces and so far i have decided a 10" aspire netbook helps in making typing errors :)

Question: what do you mean by calling it the same way or from the same place?

I normally just type the script in a terminal but would like to make a desktop link for some to just click on them and have them run. For now it's better to understand and have them work before doing more and then i can play some more.

Joany do you still use Firestarter and if you do is it still needed to make the change in it's config to make sure it don't look for the network connection too soon at boot?

Re: exit terminal when script is done?

Posted: Thu Jul 24, 2014 10:41 pm
by Adrian
You can call a script from a terminal, you can call it from another script, you can click on them to run if the Desktop Environment allows to run scripts (I think XFCE for example runs scripts but doesn't open a terminal window for them). Depending how you start the script it will have a different parent/grandparent, that's why is not a good idea to kill things blindly from a script.

Re: exit terminal when script is done?

Posted: Sat Oct 11, 2014 2:57 pm
by GDixon
Finally fat fingered it out and the simplist solution is to make it into a desktop Icon. Click the icon and the script runs when the script is done and you type q to quit the menu in the script the terminal closes.
I placed the desktop entry in /usr/local/bin with allmy other scripts and made a copy on the desktop.
Works as expected. Don't forget to make the desktop entry executable.

You can do this with any script I imagine but I tried it out with the ssd trim script and the wol script so far.

Code: Select all

[Desktop Entry]

Version=1.0

Name=Trim

Comment=To trim the ssd

Exec=/usr/local/bin/trim

Icon=/usr/share/icons/msystem.png

Terminal=true

Type=Application

Categories=Utility;Application;

Re: exit terminal when script is done?

Posted: Mon Oct 20, 2014 1:54 pm
by GDixon
Make a *.desktop file, I put it in the /usr/local/bin with my scripts. Make it a desktop icon and when you start the script from the desktop icon it will close the terminal after the script runs.
I forgot about doing it like this way back in m-3. something and it works still.

problem solved and it gets a nice launcher on the desktop with an icon.

Re: exit terminal when script is done?

Posted: Sat Oct 01, 2016 4:30 pm
by yop
make sure you dont kill init , if sourced ;-)