Advertisement
Guest User

Today Scripts: notification centre calendar

a guest
Jun 30th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.62 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. case $# in
  4.   0) month=$(date +%m) year=$(date +%Y);;
  5.   2) month=$1 year=$2;;
  6.   *) echo 1>&2 "Usage: $0 [MONTH YEAR]"; exit 3;;
  7. esac
  8. month=${month#"${month%%[!0]*}"};
  9. if ((month == 1)); then
  10.  previous_month=12 previous_year=$((year-1))
  11. else
  12.  previous_month=$((month-1)) previous_year=$year
  13. fi
  14. if ((month == 12)); then
  15.  next_month=1 next_year=$((year+1))
  16. else
  17.  next_month=$((month+1)) next_year=$year
  18. fi
  19. paste <(cal $previous_month $previous_year)
  20. paste <(cal $month $year) | grep --before-context 6 --after-context 6 --color -e " $(date +%e)" -e "^$(date +%e)"
  21. paste <(cal $next_month $next_year)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement