“Ninite” like bash script to install and configure some basic apps in Ubuntu
For many people who use Windows, “Ninite” seems to be an easy and effective way to install many of the applications that they use everyday after a fresh install of the OS.
The makers of Ninite even recently released a Linux version found here. Although this is very helpful to Linux users, I thought the die-hard terminal and scripting fans would like a simple bash script better to make the automation even easier so I created a simplistic one below:
Ok a few things to note here:
The applications I am adding here that you might not know of are
- Guake - a beautiful terminal app with a rich amount of features. My terminal app of choice. It supports multiple tabs, different backgrounds, transparency, etc. but more importantly, can be configured to show and hide upon a keystroke. It was inspired from the Quake command line.
- Gnome-Do is a simple OS X like spotlight app that allows the user to search for or run apps and files easily. The user can just summon/hide it with a keystroke and allows him to launch applications without using the mouse.
If you are still learning bash scripting (and I still am :P ), it is important to note that:
- I originally recommend the user to run with elevated privileges using sudo and not su because I use it later to get the user’s home directory. The current user is gotten through the $SUDO_USER variable. It cannot be gotten from the $USER variable as it will return ‘root’ from the script being run with elevated privileges. If I run it as su, the information as to who originally ran the script with elevated privileges will not available so easily.
- The checking of whether the application is installed or not is not necessary but has been included mainly for adding custom messages or code later if I need to revise it.
- If you are wondering what the ‘2>&-’ means, it is a form of IO redirection. It is not necessary for the script but is done as a good practice. There is a lot more information than what I can describe here
To download, just click on the Snipt icon on the bottom of the code view and then select the download link on the bottom of the page. Remove the extension so it ends in .sh. chmod +x the file (essentially making the file executable) and run it using sudo.
If you have any questions, feel free to ask!