Skip to main content

waybar-jalali-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-jalali-calendar

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


📦 Installation Options

pip install waybar-jalali-calendar

From source

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

Using pipx (isolated)

git clone https://github.com/sunba91-su/waybar-jalali-calendar.git
cd waybar-jalali-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-jalali-calendar",
    "format": "{}",
    "interval": 3600,
    "return-type": "json",
    "signal": 1,
    "on-click": "waybar-jalali-calendar --reset && pkill -SIGRTMIN+1 waybar",
    "on-scroll-up": "waybar-jalali-calendar --next && pkill -SIGRTMIN+1 waybar",
    "on-scroll-down": "waybar-jalali-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-jalali-calendar          # Output Waybar JSON (called by Waybar)
waybar-jalali-calendar --reset  # Reset to current month
waybar-jalali-calendar --next   # Show next month
waybar-jalali-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-jalali-calendar
pip install -e ".[test]"
python -m pytest tests/ -v --cov

📝 Uninstall

pip uninstall waybar-jalali-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.

Metadata

Release files for waybar-jalali-calendar 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for waybar-jalali-calendar 1.2.1
File Size Uploaded
waybar_jalali_calendar-1.2.1.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for waybar-jalali-calendar 1.2.1
File Interpreter ABI Platform
waybar_jalali_calendar-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 19.4 kB

Release files / waybar_jalali_calendar-1.2.1.tar.gz

Download URL waybar_jalali_calendar-1.2.1.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0b93ba3192c38e66e2f6a5324e3586bb7004828ec608fb527959ca195a72779a
BLAKE2b-256 checksum
How to use checksums
06898df00308806318d31e870c4a58546a6bcb2c4b34c5c510a1314def7dc373
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / waybar_jalali_calendar-1.2.1-py3-none-any.whl

Download URL waybar_jalali_calendar-1.2.1-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
523c455338587892dbcbeb8b5df62871fa501f0b1658ed6cc2b073b0045a76d1
BLAKE2b-256 checksum
How to use checksums
34ed00f772cb7a4c099f5e2f9e155b9ae230c2f89207e4051fff7328a66a7150
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page