|
| 1 | +# clogtank.sh 🖨️🩸 |
| 2 | + |
| 3 | +Do you have an inkjet tank printer, such as an Epson EcoTank? |
| 4 | +Do you not print often enough, thus your printheads get clogged, and you reduce the lifetime of your printer by filling up the waste sponge with each head cleaning? |
| 5 | + |
| 6 | +Here, take **clogtank.sh**, a Bash script which generates a simple image with many colors and prints it with the given printer. Just add it to a cronjob, remember to keep paper loaded to your printer, and never have a clogged printhead again! (Hopefully!) |
| 7 | + |
| 8 | +## Requirements |
| 9 | +- **Bash** on Linux (might work on WSL too?) |
| 10 | + - Tested to work on `Debian 6.1.106-3` |
| 11 | +- **CUPS** (`sudo apt install cups cups-client`) and a printer configured on it |
| 12 | +- **ImageMagick** (`sudo apt install imagemagick`) |
| 13 | + - Tested to work with version `ImageMagick 6.9.11-60 Q16 x86_64` |
| 14 | + |
| 15 | +If you want to automate the printing, you will need a Linux server, NAS, Raspberry Pi, or anything connected to your printer (or network, if you want to get fancy). Then you will also need **Cron**. |
| 16 | + |
| 17 | +## Usage |
| 18 | +```bash |
| 19 | +./clogtank.sh cups_printer_id_here |
| 20 | +``` |
| 21 | + |
| 22 | +Tested on a network EcoTank with the following command: |
| 23 | +```bash |
| 24 | +./clogtank.sh EPSON_ET_2870_Series |
| 25 | +``` |
| 26 | + |
| 27 | +## Example of installation |
| 28 | +Run `crontab -e` to edit your Cron jobs. |
| 29 | +Then add the following line: |
| 30 | +``` |
| 31 | +0 15 */3 * * /path/to/clogtank.sh cups_printer_id_here |
| 32 | +``` |
| 33 | +This will print a random page every 3 days at 15:00. |
| 34 | + |
| 35 | +## Word of caution |
| 36 | +**ImageMagick and Cups might work differently based on the installed version.** |
| 37 | +Go ahead and modify the script parameters for your need, if it doesn't work at first! |
| 38 | + |
| 39 | +## What does it do? |
| 40 | + |
| 41 | +Below is an example of the produced image. |
| 42 | +The script generates some noise, masks it with other noise, |
| 43 | +and overlays the current timestamp in many colors on top. |
| 44 | + |
| 45 | +Then the script sends the image to your chosen printer via `lp`, |
| 46 | +and requests the image to be fit to the page. |
| 47 | + |
| 48 | +The idea is that by printing all colors often enough, |
| 49 | +the printheads shouldn't get clogged. |
| 50 | + |
| 51 | +Does this waste a lot of ink? Honestly, I'm not concerned of that. After printing hundreds and hundreds of pages on an ink tank printer, and only seeing the ink levels drop a little, it shouldn't be an issue. |
| 52 | + |
| 53 | +And afterall, less head cleanings means less money spent on a maintenance box or a new printer in the future, even if a few A4 sheets were wasted in the process. |
| 54 | + |
| 55 | +<img src="https://lehtodigital.fi/f/awy0n" style="width: 300px;"> |
| 56 | + |
| 57 | +# License |
| 58 | +The script is licensed under the MIT license. |
| 59 | +This project was made just for fun (and for a very specific use of the author), |
| 60 | +but useful commits are welcome! |
| 61 | + |
0 commit comments