ElBruno.ClockTray 1.0.0

dotnet tool install --global ElBruno.ClockTray --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local ElBruno.ClockTray --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=ElBruno.ClockTray&version=1.0.0
                    
nuke :add-package ElBruno.ClockTray --version 1.0.0
                    

๐Ÿ• ClockTray โ€” Toggle Windows Taskbar Clock

NuGet License: MIT Build

A lightweight Windows system tray application that lets you show or hide the taskbar date/time with a single click or keyboard shortcut.

ClockTray Demo

Features

  • System tray icon with right-click context menu
  • Show/Hide Date & Time in the Windows taskbar
  • Global hotkey: Ctrl+Alt+T to toggle
  • Windows 11 23H2+: Instant toggle via WM_SETTINGCHANGE (no Explorer restart)
  • Older Windows: Falls back to policy registry key + Explorer restart
  • Chinese Lunar Calendar Overlay: Optional floating overlay showing lunar calendar info
  • Sexagenary Cycle (ๅนฒๆ”ฏ): Heavenly Stems and Earthly Branches year display
  • Chinese Zodiac (็”Ÿ่‚–): Current zodiac animal
  • Lunar Date Display: Traditional Chinese month and day names
  • 24 Solar Terms (่Š‚ๆฐ”): Shows current or upcoming solar term
  • CJK Font Support: Auto-detects best available Chinese font
  • CLI Commands: Use clocktray show, clocktray hide, and clocktray status to control the clock from scripts and automation

Installation

Install as a .NET Global Tool

dotnet tool install --global ElBruno.ClockTray

After installation, run clocktray from any command prompt to launch the system tray app.

CLI Commands

ClockTray includes command-line commands for automation and scripting:

clocktray show        # Show the taskbar clock
clocktray hide        # Hide the taskbar clock
clocktray status      # Check current visibility state
clocktray --help      # Display help and command list

These commands are useful for presentations, streaming, scripts, and automation. For detailed examples, options, and troubleshooting, see the CLI Reference Guide.

Examples:

# Check if clock is visible
clocktray status

# Hide clock before a presentation
clocktray hide

# Show clock when done
clocktray show

# Use in a script
if clocktray status | findstr "Visible" > nul (
    echo Clock is visible
)

Build from source

git clone https://github.com/elbruno/ElBruno.ClockTray.git
cd ElBruno.ClockTray
dotnet build
dotnet run

Publish as self-contained executable

dotnet publish -c Release -r win-x64 --self-contained

Chinese Calendar Overlay

ClockTray includes an optional floating overlay that displays Chinese lunar calendar information, inspired by the classic KClock tool. Toggle it from the system tray right-click menu โ†’ Show Chinese Calendar.

The overlay shows:

  • Current time and Gregorian date
  • Sexagenary cycle year (ๅนฒๆ”ฏ) with zodiac animal (็”Ÿ่‚–)
  • Lunar month and day in traditional Chinese numerals
  • Chinese day of the week
  • Current or upcoming solar term (่Š‚ๆฐ”)

For detailed information about the calendar calculations, see Chinese Calendar Documentation.

Requirements

Usage

  1. Run the app โ€” it starts minimized to the system tray (clock icon near the Windows clock)
  2. Right-click the tray icon to Show/Hide the taskbar date & time, or Exit
  3. Double-click the tray icon to toggle
  4. Ctrl+Alt+T anywhere to toggle via global hotkey

Architecture

File Purpose
Program.cs Entry point, runs the ApplicationContext
ClockTrayApplicationContext.cs NotifyIcon, context menu, app lifecycle
ClockToggler.cs Registry read/write + SendMessageTimeout P/Invoke
HotkeyWindow.cs Global hotkey via RegisterHotKey P/Invoke
ChineseCalendarHelper.cs Lunar calendar conversions (stems, branches, zodiac, month/day names)
SolarTermCalculator.cs 24 solar terms astronomical calculation
LunarClockOverlay.cs Floating always-on-top calendar overlay window

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

This project could potentially evolve into a PowerToys module. If you're interested in helping make that happen, let's discuss it in the issues.

๐Ÿ‘‹ About the Author

Hi! I'm ElBruno ๐Ÿงก, a passionate developer and content creator exploring AI, .NET, and modern development practices.

Made with โค๏ธ by ElBruno

If you like this project, consider following my work across platforms:

  • ๐Ÿ“ป Podcast: No Tienen Nombre โ€” Spanish-language episodes on AI, development, and tech culture
  • ๐Ÿ’ป Blog: ElBruno.com โ€” Deep dives on embeddings, RAG, .NET, and local AI
  • ๐Ÿ“บ YouTube: youtube.com/elbruno โ€” Demos, tutorials, and live coding
  • ๐Ÿ”— LinkedIn: @elbruno โ€” Professional updates and insights
  • ๐• Twitter: @elbruno โ€” Quick tips, releases, and tech news

License

MIT ยฉ Bruno Capuano

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.0 121 4/22/2026
0.6.0 112 4/16/2026
0.5.5 122 3/3/2026
0.5.4 116 3/3/2026
0.5.3 105 3/3/2026