New project, file structures and bash!

Every time we start a new project, whether it be a video, 2D graphics or any other creation on a computer, we have to (should 🙂 ) start with a clean folder structure that makes navigating the ever growing number of files easy, or at least relatively easy!

Say I am doing a logo in Inkscape, I’ll create a ‘root’ project folder, that resides in ‘Documents/Graphics/’ lets say it’s called ‘New_Logo’. (Note that I never use spaces).

Within that root folder, I will need others – ‘Assets’, ‘SRC’ and ‘Exports’ that will contain sub folders too. Assets will have ‘Img’ and possibly ‘Inspiration’. I may add others manually too, depending on what other assets I collect.

The SRC (source) folder, or directory may not need any other folders, but if I need to edit an image (from the assets folder) and keep the .xcf file, I may include a ‘GIMP’ folder too.

This is not a difficult task, but it’s still nice if all that is set up quickly and easily, so I can get on with the job in hand.

Enter my latest bash script! Nattily entitled ‘Make_Project_Dirs.sh’.

Double clicking on this file that I now keep in the ‘Graphics’ folder (found in my Documents folder) launches the script and asks me what I want to call my new project and then instantly creates the folder structure. What’s more, as we work from the Desktop, I have it ask me if I want a link on the Desktop too.


Click on ‘Run In terminal’.


Enter the project name.


Decide if I want a link on my Desktop.

The script creates many sub-folders to cover the main types of projects that I do these days, so some may not be needed. I just delete those.

Here’s the code…

#!/bin/bash
#Script to create directory structures for multimedia projects by Peter Green
#Website - https://greenpete.co.uk/
#Version - 1.5
#Date - 16-09-2018 | 17-09-2018
#Licence - Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
echo "
################################################################################
# Script to create directory structures for multimedia projects by Peter Green #
# Website - https://greenpete.co.uk/ #
# Version - 1.5 #
# Date - 16-09-2018 | 17-09-2018 #
# Licence - Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) #
################################################################################

#################################
# #
# NEW MULTIMEDIA PROJECT! :-) #
# #
#################################

What would you like to call your new project? (No_spaces_please)."
read project_name
mkdir $project_name
cd $project_name
mkdir -p SRC/Audacity SRC/Ardour SRC/Inkscape SRC/GIMP SRC/Scribus Export SRC/Kdenlive Assets/Inspiration Assets/Img Assets/Audio Assets/Rushes
echo "
Your project folder, '$project_name' has been created!"
echo "
Would you like me to make you a link on your Desktop to '$project_name'? [y/n]"
read answer
if [ $answer = y ]; then
ln -s $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/$project_name ~/Desktop/Link_to_$project_name
else
echo "
Ok, no problem! :-)"
fi
echo "
All finished! Please press enter to close this window."
read

If you want to use this code just copy and paste the code into a file called whatever you want, but that ends with ‘.sh’ and don’t forget to make it executable!

I will probably update it from time to time, so check back if you want the latest version.

I may also play with Zenity too. (Check back for updates).