Skip to main content

Jalali (Persian/Solar Hijri) calendar module for Waybar with holiday detection, Nowruz countdown, and monthly calendar grid

Project description

waybar-jalaly-calendar

Test PyPI version Python versions License Stars

Jalali (Persian/Solar Hijri) calendar module for Waybar.
Works on Sway, Hyprland, and any Wayland compositor using Waybar.

screenshot


✨ Features

  • Jalali date in the bar with full Persian text (e.g., ۱۶ خرداد ۱۴۰۵)
  • Calendar grid in tooltip showing the full month with today highlighted
  • Holiday detection — both fixed Jalali holidays (Nowruz, 22 Bahman, etc.) and movable Hijri holidays (Ashura, Ramadan, Eid)
  • Nowruz countdown — shows days remaining until the Persian New Year
  • Year-end countdown — remaining days in the current year
  • Gregorian & Hijri dates in tooltip
  • Click navigation — scroll through months in the tooltip via scroll wheel; click to reset
  • Weekend styling — Friday (جمعه) gets a special CSS class
  • Persian numerals — numbers displayed in Arabic-Indic digits (۰-۹)

⚡ Quick Start

pip install waybar-jalaly-calendar

Then add to your Waybar config (see Configuration below).


📦 Installation Options

Using pip (recommended)

pip install waybar-jalaly-calendar

From source

git clone https://github.com/sunba91-su/waybar-jalali-calendar.git
cd waybar-jalaly-calendar
pip install .

Using pipx (isolated)

git clone https://github.com/sunba91-su/waybar-jalali-calendar.git
cd waybar-jalaly-calendar
pipx install .

Using Makefile

make install       # user install
# or
make install-system  # system-wide

Arch Linux (AUR)

# Coming soon — or build from dist/arch/PKGBUILD

🎨 Waybar Configuration

config (~/.config/waybar/config)
"custom/shamsi-date": {
    "exec": "waybar-jalaly-calendar",
    "format": "{}",
    "interval": 3600,
    "return-type": "json",
    "signal": 1,
    "on-click": "waybar-jalaly-calendar --reset && pkill -SIGRTMIN+1 waybar",
    "on-scroll-up": "waybar-jalaly-calendar --next && pkill -SIGRTMIN+1 waybar",
    "on-scroll-down": "waybar-jalaly-calendar --prev && pkill -SIGRTMIN+1 waybar"
}
style (~/.config/waybar/style.css)
#custom-shamsi-date {
    font-weight: bold;
    padding: 0 8px;
    margin: 2px 0;
    border-radius: 4px;
}

#custom-shamsi-date.holiday {
    color: #bf616a; /* red for holidays */
}

#custom-shamsi-date.weekend {
    color: #ebcb8b; /* yellow for Friday (Jomeh) */
}

Restart Waybar:

pkill waybar && waybar &
# or, if signals are configured:
pkill -SIGRTMIN+1 waybar

🕹 Usage

Once installed and configured, the calendar appears in your Waybar:

  • Bar text:  ۱۶ خرداد ۱۴۰۵ (current date with Persian digits) — shows a 🎉 icon on holidays
  • Tooltip (hover): Full date info, Hijri date, Nowruz countdown, and a monthly calendar grid with today highlighted
  • Scroll up/down: Navigate through months in the tooltip
  • Click: Reset back to the current month

CLI Commands

waybar-jalaly-calendar          # Output Waybar JSON (called by Waybar)
waybar-jalaly-calendar --reset  # Reset to current month
waybar-jalaly-calendar --next   # Show next month
waybar-jalaly-calendar --prev   # Show previous month

📅 Holiday Coverage

Fixed Jalali Holidays

  • Nowruz (1–4 Farvardin)
  • Islamic Republic Day (12 Farvardin)
  • Sizdah Bedar (13 Farvardin)
  • Death of Khomeini (14 Khordad)
  • 15 Khordad Uprising (15 Khordad)
  • Islamic Revolution Victory (22 Bahman)
  • Nationalization of Oil (29 Esfand)

Hijri (Lunar) Holidays

  • Tasua (9 Muharram)
  • Ashura (10 Muharram)
  • Arba'een (20 Safar)
  • Death of Prophet (28 Safar)
  • Martyrdom of Imam Reza (30 Safar)
  • Mab'ath (27 Rajab)
  • Birth of Imam Mahdi (15 Sha'ban)
  • Ramadan (1 Ramadan)
  • Eid al-Fitr (1–2 Shawwal)
  • Eid al-Adha (10 Dhu al-Hijjah)
  • Eid al-Ghadir (18 Dhu al-Hijjah)

🛠 Development

git clone https://github.com/sunba91-su/waybar-jalali-calendar.git
cd waybar-jalaly-calendar
pip install -e ".[test]"
python -m pytest tests/ -v --cov

📝 Uninstall

pip uninstall waybar-jalaly-calendar
rm -f ${XDG_RUNTIME_DIR:-/tmp}/waybar-jalaly-state  # clean up state file

📄 License

GNU General Public License v3.0 or later. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

waybar_jalaly_calendar-1.2.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

waybar_jalaly_calendar-1.2.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file waybar_jalaly_calendar-1.2.0.tar.gz.

File metadata

  • Download URL: waybar_jalaly_calendar-1.2.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for waybar_jalaly_calendar-1.2.0.tar.gz
Algorithm Hash digest
SHA256 3ae6bf7a5cf1e3bc5699a8c9e6a481bf761285d3eecbb3ed43b8188f97a032d8
MD5 753694594e73b0898cb5b9149040e7dd
BLAKE2b-256 fae2d1b74fd05911bf95788426cf0b90a3c03af719251123a53013afd6ff0c05

See more details on using hashes here.

File details

Details for the file waybar_jalaly_calendar-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for waybar_jalaly_calendar-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26a241e9243c49c85a30a56c2756f890dcb10e6050f0e9bde7439cdbfe391fa7
MD5 f48887efe9acbe14410f04f309f5ca42
BLAKE2b-256 cdaf7e0e1cf799fb41833a32a172da7a409d8c13c6774ee4dab07bc75f8de737

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page