|
1 | | -# Bleach |
| 1 | +# Bleach (Bash Edition) |
2 | 2 |
|
3 | | -**A safe, cross-platform terminal-based system cleaner.** |
| 3 | +> **Automated System Cleanup & Maintenance Tool for Linux** |
| 4 | +> _Inspired by [ChrisTitusTech/linutil](https://github.com/ChrisTitusTech/linutil)_ |
4 | 5 |
|
5 | | - |
6 | | - |
| 6 | +Bleach is a powerful, interactive terminal utility designed to keep your Linux system clean, fast, and private. Rewritten entirely in **Bash** for maximum portability and control, it uses [gum](https://github.com/charmbracelet/gum) to provide a modern, easy-to-use interface. |
7 | 7 |
|
8 | | -**Bleach** is a modern system maintenance tool designed for developers. It helps you keep your Linux environment fast and clean by removing unused caches, logs, and temporary files safely. |
9 | | - |
10 | | -Unlike aggressive cleaning tools, Bleach respects your development environment—it never touches `.git` folders, source code, or active databases. |
| 8 | + |
| 9 | +*(Example of the Gum interface used in Bleach)* |
11 | 10 |
|
12 | 11 | ## ✨ Features |
13 | 12 |
|
14 | | -- **🖥️ Modern TUI**: built with [Textual](https://textual.textualize.io/) for a beautiful, interactive terminal experience. |
15 | | -- **🛡️ Safe by Default**: Explicitly ignores `.git` directories and critical system files. |
16 | | -- **🐧 Cross-Distro**: Smartly detects your package manager (APT, DNF, Pacman, etc.). |
17 | | -- **🧹 Deep Cleaning**: |
18 | | - - **System**: Journal logs, temporary files, thumbnails. |
19 | | - - **Dev Tools**: Docker (unused images/containers), NPM cache, Pip cache. |
20 | | - - **Package Managers**: Clean APT/DNF/Pacman caches and autoremove unused packages. |
21 | | - |
22 | | -## 📦 Installation |
23 | | - |
24 | | -### Option 1: One-Line Installer (Recommended) |
25 | | - |
26 | | -Quickly install and setup Bleach with a single command: |
27 | | - |
28 | | -```bash |
29 | | -curl -sL https://raw.githubusercontent.com/maruf-pfc/bleach/main/install.sh | bash |
30 | | -``` |
31 | | - |
32 | | -### Option 2: Debian/Ubuntu (.deb) |
33 | | - |
34 | | -Download the latest release from the [Releases Page](https://github.com/maruf-pfc/bleach/releases). |
| 13 | +- **Interactive TUI**: Navigate easy menus to select exactly what you want to clean. |
| 14 | +- **Deep Clean & Storage Recovery**: |
| 15 | + - **System**: APT (autoremove/clean), Docker (prune), Logs (vacuum), Temp files (`/tmp`), Trash. |
| 16 | + - **Dev**: Node (`npm`, `pnpm`, `yarn`), Python (deep `__pycache__` scan), Build Artifacts (`dist`, `build`). |
| 17 | + - **IDE**: Clear caches for VS Code and JetBrains IDEs. |
| 18 | + - **Privacy**: Clear user thumbnail caches. |
| 19 | +- **System Maintenance**: |
| 20 | + - **SSD Trim**: Optimize SSD performance via `fstrim`. |
| 21 | + - **Storage Reporting**: Tracks and reports exactly how much disk space was reclaimed after every session. |
| 22 | +- **Auto-Updates**: |
| 23 | + - **Self-Update**: Built-in weekly check for new versions. |
| 24 | + - **APT Hook**: Optional integration to check for Bleach updates whenever you run `sudo apt update`. |
| 25 | +- **Logging**: Detailed logs of every action kept in `~/.local/share/bleach/logs`. |
| 26 | + |
| 27 | +## 🚀 Installation |
| 28 | + |
| 29 | +### One-Line Installer |
| 30 | +This will install Bleach to `/opt/bleach`, create a symlink at `/usr/local/bin/bleach`, and install the `gum` dependency automatically. |
35 | 31 |
|
36 | 32 | ```bash |
37 | | -sudo dpkg -i bleach_*.deb |
38 | | -sudo apt-get install -f # Fix dependencies if needed |
| 33 | +curl -fsSL https://raw.githubusercontent.com/yourusername/bleach/main/install.sh | sudo bash |
39 | 34 | ``` |
40 | 35 |
|
41 | | -### Option 2: Python (Universal) |
| 36 | +*(Note: If you are running from a local clone, just run `sudo ./install.sh`)* |
42 | 37 |
|
43 | | -Install directly from the repository using `pip` (requires Python 3.8+): |
44 | | - |
45 | | -```bash |
46 | | -pip install git+https://github.com/maruf-pfc/bleach.git |
47 | | -``` |
| 38 | +### Prerequisites |
| 39 | +Bleach uses **[gum](https://github.com/charmbracelet/gum)** for its UI. The installer handles this for you on Debian/Ubuntu systems. |
48 | 40 |
|
49 | | -### Option 3: Build from Source |
| 41 | +## 🛠 Usage |
50 | 42 |
|
51 | | -If you want to build the `.deb` package yourself: |
52 | | - |
53 | | -```bash |
54 | | -git clone https://github.com/maruf-pfc/bleach.git |
55 | | -cd bleach |
56 | | -./build_deb.sh |
57 | | -sudo dpkg -i build/bleach_0.1.0_all.deb |
58 | | -``` |
59 | | - |
60 | | -## 🚀 Usage |
61 | | - |
62 | | -Simply run `bleach` in your terminal: |
| 43 | +Run the tool anytime from your terminal: |
63 | 44 |
|
64 | 45 | ```bash |
65 | 46 | bleach |
66 | 47 | ``` |
67 | 48 |
|
68 | | -- Navigate using **Arrow Keys** or **Mouse**. |
69 | | -- Toggle items with **Space** or **Click**. |
70 | | -- Run cleanup by clicking **"Run Cleanup"**. |
71 | | - |
72 | | -### CLI Options |
| 49 | +### Modes |
| 50 | +- **System Cleanup**: Quick access to disk space recovery tools. |
| 51 | +- **System Updates**: Centralized update management for APT, Flatpak, and Snap. |
| 52 | +- **Maintenance**: Utilities for long-term health (SSD Trim, etc.). |
| 53 | +- **View Logs**: Read what Bleach has done recently. |
73 | 54 |
|
| 55 | +### Auto-Update |
| 56 | +Bleach checks for updates weekly. You can also manually trigger a check: |
74 | 57 | ```bash |
75 | | -bleach --version # Show version |
76 | | -bleach --help # Show help message |
| 58 | +bleach --check-update |
77 | 59 | ``` |
78 | 60 |
|
79 | | -## 🛠️ Development |
80 | | - |
81 | | -We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details. |
82 | | - |
83 | | -1. **Clone the repo** |
84 | | - ```bash |
85 | | - git clone https://github.com/maruf-pfc/bleach.git |
86 | | - cd bleach |
87 | | - ``` |
88 | | - |
89 | | -2. **Install dev dependencies** |
90 | | - ```bash |
91 | | - pip install -e ".[dev]" |
92 | | - ``` |
93 | | - |
94 | | -3. **Run Linting & Tests** |
95 | | - ```bash |
96 | | - ruff check . |
97 | | - mypy . |
98 | | - pytest |
99 | | - ``` |
100 | | - |
101 | | -## 📄 License |
| 61 | +## 🤝 Contributing |
102 | 62 |
|
103 | | -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 63 | +We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to add new modules or improve existing ones. |
104 | 64 |
|
105 | | ---- |
| 65 | +## 📜 License |
106 | 66 |
|
107 | | -<p align="center"> |
108 | | - Made with ❤️ by <a href="https://github.com/maruf-pfc">Md. Maruf Sarker</a> |
109 | | -</p> |
| 67 | +MIT License. See [LICENSE](LICENSE) for details. |
0 commit comments