How to automate your start of day as a developer with Bash?
As a developer, when you sit down at your desk to start your regular work day, you will obviously open a few applications. It may be the browser and a few links like Gmail, Facebook, LinkedIn, GitHub, or skype. You will open all these apps one by one for your use.
So why not automate these things with a single script so that you do not need to open them one by one? So let's learn it now. This guide is for mac users and of course, there are also ways to automate these things in other OS platforms.
- You need to create a file and let’s name it as
letstart.sh
. - You can place this file at any location you want.
- Now add commands in the file as:
open -a “Skype.app”
Above line will open skype. - Similarly, you can add commands in the next line to open other applications like:
open -a “Notes.app”
open -a “Visual Studio Code.app” work
open -a “Google Chrome.app” https://www.facebook.com/ https://mail.google.com/mail/u/0/#inbox - You can open a folder in VS code directly by placing the folder name as used in the above example.
- You can also open the browser and links by placing links as used in the above example.
- Once you are done, save the file.
- Now you can open your terminal and navigate to the file’s location and type the following command to execute your script.
./letstart.sh - You can also add an alias command in your .bashrc file so that you do not have to navigate to the folder and type the filename to run it.
- Open your .bashrc file. Usually, it should be at the root.
nano ~/.bashrc - Now add the following line in your .bashrc file.
alias letstart=”cd pathofthefile && ./letstart.sh” - Now every time you need to run the script, you can open the terminal and type
letstart
. All the apps you mentioned in the file will open one by one.
Enjoy your day.