As I play more and more with Ubuntu, I'm starting to see how I can automate the majority of the repetitive commands that I perform whenever I reinstall the operating system. Thus far, it's just one gigantic apt-get script/terminal command list that's connected by dozens of && symbols.
I used to be decent at python, but I've forgotten quite a lot. Here's what my apt-get command looks like right now (which I simply paste in and press enter):
sudo add-apt-repository -y ppa:numix/ppa && sudo add-apt-repository -y ppa:gwendal-lebihan-dev/hexchat-stable && sudo add-apt-repository -y ppa:webupd8team/nemo && sudo apt-get update && sudo apt-get install -y numix-icon-theme numix-gtk-theme docky hexchat nemo nemo-fileroller dconf-tools vlc unity-tweak-tool gnome-tweak-tool python-pip && sudo pip install speedtest-cli && gsettings set org.gnome.desktop.background show-desktop-icons false && xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search && gsettings set org.gnome.desktop.interface gtk-theme "Numix" && gsettings set org.gnome.desktop.interface icon-theme 'Numix-Circle' && gsettings set com.canonical.desktop.interface scrollbar-mode normal
I know, it's not exactly clean. I don't want to keep doing it this way and I'd like to turn it into a script of sorts that would be far easier for me to update, maintain, and read. Here's some pseudo code I typed up of what I'd like to do.
#Install/Config Script
#Add Repos
print ("Adding Numix, Hexchat, and Webupd8 Repositories...")
enter.line ('sudo add-apt-repository -y ppa:numix/ppa && sudo add-apt-repository -y ppa:gwendal-lebihan-dev/hexchat-stable && sudo add-apt-repository -y ppa:webupd8team/nemo')
#Update Repos
print ("Updating repostiory lists...")
enter.line ('sudo apt-get update')
#Install apps
print ("Installing Numix Icon Theme...")
enter.line ('sudo apt-get install -y numix-icon-theme')
print ("Installing etc etc...")
#Configure Nemo File Explorer
print ("Configuring Nemo as default file manager")
enter.line ('gsettings set org.gnome.desktop.background show-desktop-icons false')
enter.line ('xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search')
#Set Numix Theme and fix scrollbars
print ("Setting Numix GTK and Icon Set...")
enter.line ('gsettings set org.gnome.desktop.interface gtk-theme "Numix"')
enter.line ('gsettings set org.gnome.desktop.interface icon-theme 'Numix-Circle'')
enter.line ('gsettings set com.canonical.desktop.interface scrollbar-mode normal
')
Essentially, I'd like to be able to save it as some sort of executable script, and simply run it in the terminal and let it do its thing. I'm familiar with Java, C++, and Python, but it has been a long time since I have coded.
Any suggestions for someone trying to get back into the game would be much appreciated! Please note I am not asking for anyone to do all the work for me. I'm looking forward to trying and failing as I figure it out on my own, I'd just love for some input on how to start, what language to use, organizational layouts, and any other helpful tips for getting started.