From 1d0ef1016f4e3165ffe0577467bdf4a22315bdab Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Tue, 26 Jun 2018 23:06:43 +0530 Subject: [PATCH 1/3] Basic version Runs on start-up and notifies user of CLI how many days to PyCon. --- hundered_days_togo.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 hundered_days_togo.sh diff --git a/hundered_days_togo.sh b/hundered_days_togo.sh new file mode 100644 index 0000000..a936685 --- /dev/null +++ b/hundered_days_togo.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# 100 Days to go! - a CLI Bash script to show the number of days to PyCon India, 2018 + +# Within ~/.bashrc, append the following on a newline, so that this is run on bash start. +# '/location/to/hundered_days_togo.sh' + +# Copyright (c) 2018 Devdutt Shenoi + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# All ideas or/and suggestions would be appreciated either by email me or by +# http://github.com/devdutt-shenoi/social-media-scripts. +# Thank you. + +# Requires: bash 4.0+ + +# Some Variables +reset=$'\033[0m' # Reset Text +bold=$'\033[1m' # Bold Text +underline=$'\033[4m' # Underline Text + +dest_date="2005-10-18 +diff=$(( ($(date '+%s' -d "$dest_date") - $(date '+%s')) / 86400)) + +echo "There are ${bold}$diff${reset} days to go for ${bold}${underline}in.PyCon.org${reset}" + +# TODO : add support for colors and decoration From 6d27d784604c5e218ff9e75c2e065c384afff3b1 Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Tue, 30 Oct 2018 07:07:14 +0530 Subject: [PATCH 2/3] Made resolving changes to correct Erorrs --- hundered_days_togo.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hundered_days_togo.sh b/hundered_days_togo.sh index a936685..a5f8578 100644 --- a/hundered_days_togo.sh +++ b/hundered_days_togo.sh @@ -31,7 +31,8 @@ reset=$'\033[0m' # Reset Text bold=$'\033[1m' # Bold Text underline=$'\033[4m' # Underline Text -dest_date="2005-10-18 +# Set the following date to that for PyCon India 2019 +dest_date="2019-10-06" diff=$(( ($(date '+%s' -d "$dest_date") - $(date '+%s')) / 86400)) echo "There are ${bold}$diff${reset} days to go for ${bold}${underline}in.PyCon.org${reset}" From 478349c11897124d9376cbe54f92f6e82d3f1b90 Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Tue, 30 Oct 2018 07:08:29 +0530 Subject: [PATCH 3/3] Made change to allow for future use --- hundered_days_togo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hundered_days_togo.sh b/hundered_days_togo.sh index a5f8578..fa7ec68 100644 --- a/hundered_days_togo.sh +++ b/hundered_days_togo.sh @@ -35,6 +35,6 @@ underline=$'\033[4m' # Underline Text dest_date="2019-10-06" diff=$(( ($(date '+%s' -d "$dest_date") - $(date '+%s')) / 86400)) -echo "There are ${bold}$diff${reset} days to go for ${bold}${underline}in.PyCon.org${reset}" +echo "There are ${bold}$diff${reset} days to go for ${bold}${underline}PyCon India 2019!${reset}" # TODO : add support for colors and decoration