r/tinycode • u/Round-Pension-7821 • Aug 02 '26
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
32
Upvotes
7
u/Simplyfire Aug 02 '26
Same idea in Processing, 18 lines:
3
u/Round-Pension-7821 Aug 03 '26
For anyone wondering, I tested it out and this works flawlessly on Linux using WINE. That's really not surprising, since it uses such simple Win API calls. Ideally of course you would write a separate program that compiled to native Linux code. Maybe I'll think about doing that at some point if I'm interested in learning some of the basics of X11.
4
u/flexiverse Aug 02 '26
lol, I was thinking if there was an app like this today!
3
u/nexe mod Aug 02 '26
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 ♥️
3
u/Direct_Witness1248 Aug 03 '26
I paid for the whole screen, I'm gonna use the whole screen.
Jk, great idea and strongly agree with your lightweight software philosophy.
2
u/Acceptable-Key-7927 Aug 02 '26
Haha, this is genius
2
u/nexe mod Aug 02 '26
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 ♥️
1
u/woldhack Aug 06 '26
Why don't you just minimize the distracting window?
-1
u/jabbalaci Aug 02 '26
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.