tonyn@lemmy.mltoLinux@lemmy.ml•What's a unique customization on your Linux machine you think no one else has?
0·
2 days agoWhen I press Super + PrtSc, a bash script performs the following:
Takes a screenshot of the entire desktop (import -window root) and saves it as ~/screenshot.png…
Analyzes the screenshot to calculate the “mean brightness” value of the image. It converts the image to grayscale and determines the average pixel brightness (a value between 0 and 1, where 0 is black and 1 is white).
Checks if the image is dark by comparing the mean brightness to a threshold of 0.2. If the mean brightness is less than 0.2 (i.e., the image is very dark), it applies a negative filter to the image (convert -negate), effectively inverting the colors (black becomes white and vice versa).
Sends the image to a printer (lp command) named MF741C-743C for printing.
Honestly I print out anything my little kiddo does at school on his Chromebook, and some stuff has black backgrounds. I got tired of wasting toner so I made a script that would print a negative screenshot if it’s a dark image. One keystroke and I get what I want