MomentDerek/cal2

cal2 (calendar2) is a terminal calendar application inspired by the classic cal program, enhanced with color and event support.

โ˜… 0Forks 0C++GitHub โ†—Compare

README

cal2 - A Modern Terminal Calendar with Color and Event Support

๐Ÿ’ก Introduction

cal2 (calendar2) is a terminal calendar application inspired by the classic cal program, enhanced with color and event support. It is currently tested on Windows Terminal, MSYS2 and Ubuntu Terminal. The entire program is contained in a single C++ file, with approximately 95% of the code generated by AI.

cal2 Screenshot
Colorful calendar with event highlighting and multi-month views

๐Ÿš€ Features

  • Event Management: Track holidays, birthdays, and reminders
  • ANSI Colors: Full color support across platforms
  • Multiple Views:
    • Single month (cal2)
    • Three months (cal2 -3)
    • Full year (cal2 -y)
    • Twelve-month rolling (cal2 -Y)
  • Week Customization: Monday-first week support (-m flag)
  • Cross-Platform: Works on MSYS2 (Windows), Linux, and macOS
  • Zero Dependencies: Pure C++17 with standard libraries

๐Ÿ” Comparison: cal vs cal2

Feature cal cal2
Event Support โŒ โœ…
Color Output โŒ โœ…
Color Themes โŒ โœ…
Week Start Day Sunday Configurable
Config File โŒ โœ…

๐Ÿ“ฆ Installation

Visual Studio

# open visual studio development command prompt
mkdir build && cd build
cmake ..
# open visual studio solution and build
# copy calc2.exe to any directory in PATH

MSYS2

mkdir build && cd build
cmake ..
make
# copy calc2.exe to /usr/bin or copy to any directory in PATH

Linux/macOS

mkdir build && cd build
cmake ..
make
sudo make install  # System-wide (or omit sudo for ~/.local/bin)

๐Ÿ› ๏ธ Configuration

Create ~/.cal2/cal2.ini (or %USERPROFILE%\.cal2\cal2.ini on Windows):

# Format: MM/DD Description (type auto-detected)
[colors]
sunday_title = bright_red
saturday_title = bright_blue
workday_title = default

# Date number colors
sunday_date = bright_red
saturday_date = bright_blue
workday_date = default

# Event type colors
holiday = bright_red
birthday = bright_magenta
reminder = bright_cyan

[holidays]
1/1 New Year's Day
11/24 Thanksgiving
12/25 Christmas Day

[birthdays]
3/15 Alice's Birthday

[reminders]
2/14 Valentine's Day
4/15 Tax Day

๐ŸŽจ Color Themes

Dark Terminal Theme

For dark backgrounds, use bright and vivid colors:

[colors]
sunday_title = bright_red
saturday_title = bright_blue
workday_title = default

sunday_date = bright_red
saturday_date = bright_blue
workday_date = default

holiday = bright_red
birthday = bright_magenta
reminder = bright_cyan

Light Terminal Theme

For light backgrounds, use darker colors for better contrast:

[colors]
sunday_title = crimson
saturday_title = royal_blue
workday_title = charcoal

sunday_date = crimson
saturday_date = royal_blue
workday_date = slate

holiday = deep_red
birthday = deep_purple
reminder = forest

Alternative Light Theme

[colors]
sunday_title = wine
saturday_title = navy
workday_title = midnight

sunday_date = wine
saturday_date = navy
workday_date = steel

holiday = crimson
birthday = violet
reminder = emerald

๐ŸŽจ Usage Examples

# Basic usage (current month)
cal2

# Three-month view
cal2 -3

# Year view with Monday-first weeks
cal2 -y -m

# Twelve-month rolling view
cal2 -Y

# Specific month (July 2024)
cal2 7 2024

๐Ÿ“ Event Types

  • Holiday: Shown in ๐Ÿ”ด red
  • Birthday: Shown in ๐ŸŸฃ magenta
  • Reminder: Shown in ๐ŸŸข green

๐Ÿ–ฅ๏ธ Screenshots

Three Month View
Three-month view with color-coded events

๐Ÿค Contributing

PRs welcome! Please:

  1. Follow existing code style
  2. Add tests for new features
  3. Update documentation

๐Ÿ“œ License

MIT License - See LICENSE file

Contributors

AI4EngrMomentDerek

Issues