Working late nights on server migrations and code architectures often means typing in low-light environments. While USB lamps or backlit keyboards are the standard solutions, they consume extra power and add physical clutter. I realized the ultimate light source was already directly in front of me: the monitor.
With a clear vision in mind, I partnered with Google's Gemini AI to rapidly prototype and refine what became LightBar For Keyboard, a lightweight Windows application that creates a reflective light bar at the bottom of the screen to illuminate the keys. Here is how we built it using C# and WPF, tackled the Windows API to manage screen space, and optimized it for modern OLED energy consumption.
The simplest approach to creating a light bar is a borderless, top-most window. However, the immediate UX flaw is that maximized applications (like Chrome or Visual Studio) will either cover the bar or be partially obscured by it.
To solve this, the application needed to behave like the Windows Taskbar. I implemented the native Windows Application Desktop Toolbar (AppBar) API using SHAppBarMessage
from shell32.dll
.
ABE_BOTTOM
, Windows automatically recalculates the working area of the desktop. MouseLeftButtonDown
.Because the app directly manipulates the desktop working area, launching multiple overlapping instances would cause UI glitches. To prevent this, I implemented a Mutex
in App.xaml.cs
to guarantee a single instance constraint.
protected override void OnStartup(StartupEventArgs e)
{
const string appName = "LightBarForKeyboard_UniqueInstance";
bool createdNew;
_mutex = new Mutex(true, appName, out createdNew);
if (!createdNew)
{
Environment.Exit(0);
}
base.OnStartup(e);
// ...
}
Initially, the application featured a pure white bar. On standard LCD panels (IPS, TN, VA), the monitor's backlight is entirely on anyway. Displaying a white bar at the bottom of the screen simply twists the liquid crystals to let the existing light pass through. The extra power required is literally 0 W.
However, OLED displays generate light per pixel. A full white bar firing all RGB subpixels across the bottom of a wide monitor consumes approximately 2,0 W. To make the software highly efficient on modern displays, we introduced custom color profiles targeting specific subpixels:
Users can seamlessly right-click the bar to switch between these profiles depending on their hardware and lighting preferences.
I packaged the project as a self-contained, single-file executable using .NET 10.0:
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
For distribution, I generated an Inno Setup installer. As an independent developer releasing free tools, purchasing an expensive EV Code Signing certificate isn't always practical. Consequently, early adopters will encounter the classic Windows Defender SmartScreen "Windows protected your PC" blue prompt. I added a quick disclaimer in the documentation to guide users to click More info > Run anyway, knowing that as the software gains organic downloads, its Microsoft SmartScreen reputation will naturally build.
Building this utility—and co-piloting the development process with Gemini—was a highly satisfying exercise in merging legacy Windows APIs with modern hardware considerations. It is a completely free, software-only solution to a hardware problem.
If you want to try it out, check the code, or compile it yourself, the entire project is open-source on GitHub: LightBarForKeyboard Repository.