Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions hundered_days_togo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/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 <[email protected]>

# 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 <http://www.gnu.org/licenses/>.

# 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

# 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}PyCon India 2019!${reset}"

# TODO : add support for colors and decoration