You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
559 B

  1. #!/usr/bin/env ruby
  2. #
  3. cal, today, week_color, day_color, reset = %x(cal).split(%r(\n)), Time.now.day, %x(tput sgr0;tput setab 4;tput setaf 7), %x(tput sgr0; tput setab 0;tput setaf 7;tput bold), %x(tput sgr0)
  4. done=false
  5. cal.each do |line|
  6. if done then
  7. puts line
  8. next
  9. end
  10. if(line =~ /^(.*\s+?)#{today}(\s+?.*)$/ or
  11. line =~ /^(.*\s+?)#{today}$/ or
  12. line =~ /^()#{today}(\s+?.*)$/ or
  13. line =~ /^#{today}$/ ) then
  14. puts "#{week_color}#{$1}#{day_color}#{today}#{week_color}#{$2}#{reset}"
  15. done=true
  16. else
  17. puts line
  18. end
  19. end