This guide will help you configure the necessary scripts and services so that when you turn on your computer it will automatically check if it is a working day or not, if so it will verify if it is a local holiday to be able to launch the applications and services needed to work comfortably.
- Create an API app (Google Calendar API) in the google developer account
- Have systemd installer (or other if you know how manage services)
IMPORTANT: Read each step of this guide
- From the "Credentials" tab you can create an API key, you get something like this
AIzaSyBcOT_DpEQysiwFmmmZXupKpnrOdJYAhhM
- Set your API Key into enviroment variables
GOOGLE_CALENDAR_APIKEY=<Your API Key>
# Add these other variables as well, or you can place them as variables in the script below,
# either in the sh or in the service
CAL_BASE_URL=https://www.googleapis.com/calendar/v3/calendars
BASE_CALENDAR_ID_FOR_PUBLIC_HOLIDAY=holiday@group.v.calendar.google.com
- Create the files in this gist and read their head comments where they indicate the path where they should be and also some recommendations
- Change the working day start-end in
sh
script - Make the
sh
script as excecutable with this commandchmod +x ~/.config/script/init-workspace.sh
- Enable service with command
systemctl --user enable workapps.service