Skip to content

Commit c25fb1a

Browse files
committed
Final touches + add README and LICENSE
1 parent f6c9332 commit c25fb1a

File tree

3 files changed

+83
-1
lines changed

3 files changed

+83
-1
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Roni Lehto
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+

clogtank.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,6 @@ rm temp.png
8888
#
8989
# Print the file
9090
#
91-
lp -o fit-to-page temp.jpg
91+
lp -o fit-to-page -d $1 temp.jpg
9292

9393
echo "All done! (I hope!)"

0 commit comments

Comments
 (0)