wiki

Help! I'm trapped in a wiki!

Site Tools


projects:diskblinker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
projects:diskblinker [2026/02/06 22:42] – created azzyprojects:diskblinker [2026/05/11 16:22] (current) edml
Line 1: Line 1:
 +# disk blinker - use caps lock LED as disk activity indicator
 +
 +C program, linux.
 +Focus on making it work for me first, then figure out how to make it portable and efficient
 +Not a big project, something interesting though to start with
 +
 +https://github.com/MeanEYE/Disk-Indicator/ works but is a bit complex, incorporates Xorg and command line client.
 + - Based on a much simpler (albeit in C++) program: https://stahlke.org/dan/hdd_led/
 +
 +# Unbuffered writes to /sys
 +Need to make fp an unbuffered stream with `setvbuf (fp, NULL, _IONBF, 0);`. This flushes writes to the leds as soon as they are written.
 +
 +
 +# Without polling
 +I only need: daemon that watches when disk activity file is changed (read or written) and sets LED to 1 for a few ms, then off.
 +
 +https://www.kernel.org/doc/Documentation/block/stat.txt
 +
 +Looks like there's only one file that has all values together.
 +Also I'm not sure if files from /sys can be watched with inotify API.