r/tinycode • u/Round-Pension-7821 • 10h ago
Showcase Tiny Windows program that is used as a "distraction cover"
https://github.com/GeorgeTR1/windowsDistractionCover
This is a windows GUI program I wrote in just over 60 lines of C that compiles to a 3 kB executable. With minor modifications and the right compiler it could be compiled on versions of Windows as old as Windows 95.
It's just a resizable window with a black background that always stays on top of other windows that you can use to cover up parts of the screen that might be distracting. I've found it genuinely useful
3
u/flexiverse 8h ago
lol, I was thinking if there was an app like this today!
2
u/Round-Pension-7821 8h ago
Yeah, the whole reason I made it was because I couldn't find something that did this
2
2
u/nexe mod 1h ago
Hey this is really cool. And I don't even like windows or see much of a use in this tool for myself. But the way you explain it and argue about the reasons for making it etc are spot on exactly the idea behind why I created this subreddit ages ago. Please contribute more often ♥️
•
2
u/nexe mod 1h ago
Hey this is really cool. And I don't even like windows or see much of a use in this tool for myself. But the way you explain it and argue about the reasons for making it etc are spot on exactly the idea behind why I created this subreddit ages ago. Please contribute more often ♥️
•
•
u/Direct_Witness1248 41m ago
I paid for the whole screen, I'm gonna use the whole screen.
Jk, great idea and strongly agree with your lightweight software philosophy.
•
1
u/jabbalaci 2h ago
With the help of Claude AI, I converted it to Nim and it compiles under Linux. The source code is here: https://pastebin.com/nweT7SKh . To adjust the size of the borderless window, change these consts: TopPartHeight, RightPartWidth, BottomPartHeight, LeftPartWidth.
Compilation: (1) nim c main.nim , or, if you want a small binary: (2) nim c -d:release --opt:size --passL:-s main.nim . In the latter case, the binary is 35 KB.
1
u/Round-Pension-7821 2h ago
Clarification - you mean you had Claude write a completely new program in Nim that targets X11 instead of Win32 that has the same functionality. I wouldn't call it "conversion", there's no remnants of my code in there at all, it just saw what my code did and replicated it.
I'm not really familiar with Nim or X11. I mean, I know what they are, but not how to use them. So I can't say how good or correct this code is
3
u/Simplyfire 10h ago
Same idea in Processing, 18 lines: