Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _data/faqs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ main:
answer: |
As the unprivileged user, run this command to allow the local user's X session:

```text
```sh
xhost si:localuser:root
```

When finished, disable the access:

```text
```sh
xhost -si:localuser:root
```

Expand Down
63 changes: 1 addition & 62 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,68 +60,7 @@
</div>

<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
<script>
// Add copy buttons to code blocks
var codeBlocks = document.querySelectorAll('div.highlighter-rouge');

// For console blocks, copy only the commands, not the prompt or output.
// Rouge marks the prompt with span.gp and the output with span.go.
function extractCommands(codeEl) {
var lines = [];
var line = { hasPrompt: false, text: '' };
function walk(node) {
if (node.nodeType === Node.TEXT_NODE) {
var parts = node.textContent.split('\n');
parts.forEach(function(part, i) {
if (i > 0) {
lines.push(line);
line = { hasPrompt: false, text: '' };
}
line.text += part;
});
} else if (node.nodeType === Node.ELEMENT_NODE) {
if (node.classList.contains('gp')) {
line.hasPrompt = true;
return; // exclude the prompt itself from the copied text
}
node.childNodes.forEach(walk);
}
}
Array.prototype.forEach.call(codeEl.childNodes, walk);
lines.push(line);
return lines.filter(function(l) { return l.hasPrompt; })
.map(function(l) { return l.text.trim(); })
.join('\n');
}

codeBlocks.forEach(function(codeBlock) {
var button = document.createElement('button');
button.className = 'copy-button';
button.type = 'button';
button.ariaLabel = 'Copy code to clipboard';
button.textContent = 'Copy';

button.addEventListener('click', function() {
var codeEl = codeBlock.querySelector('code');
var isConsole = codeEl.querySelectorAll('span.gp').length > 0;
// Rouge always ends the block with a newline
var code = isConsole
? extractCommands(codeEl)
: codeEl.textContent.replace(/\n+$/, '');
navigator.clipboard.writeText(code).then(function() {
button.textContent = 'Copied!';
setTimeout(function() {
button.textContent = 'Copy';
}, 2000);
}).catch(function(err) {
console.error('Failed to copy: ', err);
});
});

codeBlock.style.position = 'relative';
codeBlock.appendChild(button);
});
</script>
<script defer src="{{ site.baseurl }}/js/main.js"></script>
{%- if site.google_analytics_id != "" %}
{% include google_analytics.html %}
{%- endif %}
Expand Down
68 changes: 52 additions & 16 deletions _posts/2015-09-25-command-line-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,29 @@ Running `bleachbit` (which is in the path) with arguments runs BleachBit in comm

To see a list of cleaners and their options, run:

`bleachbit --list-cleaners`
```sh
bleachbit --list-cleaners
```

Aliases are `-l` and `--list`.

## Preview

To preview deleting Firefox cache, run:

`bleachbit --preview firefox.cache`
```sh
bleachbit --preview firefox.cache
```

An alias is `--p`.

## Deleting files

When you are ready to delete files and make other permanent changes, replace `--preview` with `--clean`. To delete Firefox cache, for example, run:

`bleachbit --clean firefox.vacuum`
```sh
bleachbit --clean firefox.vacuum
```

An alias is `--c`.

Expand All @@ -59,39 +65,57 @@ Preview and cleaning modes accept the same options for including and excluding c

Multiple arguments are allowed. To preview deleting Firefox cache and Opera cache, list them separated by a space:

`bleachbit --preview firefox.cache opera.cache`
```sh
bleachbit --preview firefox.cache opera.cache
```

Wildcards are allowed for options, so to preview deleting all options for Opera, run:

`bleachbit --preview opera.*`
```sh
bleachbit --preview opera.*
```

Wildcards are not allowed for cleaners, so do _not_ run `bleachbit --preview *.*`.

To select the same options as in the GUI, use `--preset`, which may be combined with other options:

`bleachbit --preview --preset firefox.cache`
```sh
bleachbit --preview --preset firefox.cache
```

To enable all cleaners and options that do not have a warning, use `--all-but-warning`, which may be combined with other options. Use this with caution, as it will delete many files.

`bleachbit --preview --all-but-warning firefox.cache`
```sh
bleachbit --preview --all-but-warning firefox.cache
```

## Excluding options

To except cleaning options, combine `--except` with inclusion options. The following previews all of Firefox except cookies.

`bleachbit --preview firefox.* --except firefox.cookies`
```sh
bleachbit --preview firefox.* --except firefox.cookies
```

These three commands are equivalent: they include all Firefox and Chromium options except their passwords. The first option demonstrates that `--except` accepts multiple cleaner options, separated by commas.

```text
```sh
bleachbit --clean firefox.* chromium.* --except firefox.passwords,chromium.passwords
```

```sh
bleachbit --clean firefox.* chromium.* --except firefox.passwords --except chromium.passwords
```

```sh
bleachbit --clean chromium.* --except firefox.passwords firefox.* --except chromium.passwords
```

However, the following command _will_ delete passwords in Chromium.

`bleachbit --clean firefox.* chromium.* --except firefox.passwords chromium.passwords`
```sh
bleachbit --clean firefox.* chromium.* --except firefox.passwords chromium.passwords
```

Notes:

Expand All @@ -107,19 +131,25 @@ Notes:

To overwrite the contents of files, so they cannot be undeleted later, add `--overwrite`:

`bleachbit --overwrite --clean firefox.vacuum`
```sh
bleachbit --overwrite --clean firefox.vacuum
```

Without `--overwrite`, BleachBit checks the configuration set in the graphical user interface.

## Shredding files

To shred any file, so its contents cannot be recovered, use `--shred`. While `--overwrite` refers to the files identified by `--clean`, the option `--shred` shreds any file anywhere. For example, this shreds one file named `yoga_emails.txt`:

`bleachbit --shred ~/yoga_email.txt`
```sh
bleachbit --shred ~/yoga_email.txt
```

To shred all files under a directory, pass the name of the directory like this:

`bleachbit --shred "C:\Microsoft Exchange\Top Secret Emails\"`
```bat
bleachbit --shred "C:\Microsoft Exchange\Top Secret Emails\"
```


## Wiping empty space
Expand All @@ -130,7 +160,9 @@ You might want to wipe empty space for each logical drive. For example, on Windo

To wipe any partition, pass any writable directory in that partition to `--wipe-empty-space`. For example:

`bleachbit --wipe-empty-space ~/.cache/`
```sh
bleachbit --wipe-empty-space ~/.cache/
```

Wiping empty space does not change how much free space is left, when the process is done. For example, if you start with 10GB free, then you will still have 10GB free when the process is done.

Expand All @@ -141,11 +173,15 @@ BleachBit 5.0.2 and earlier used `--wipe-free-space` instead of `--wipe-empty-sp

To vacuum Firefox each night at 03:00, run this to edit cron jobs:

`crontab -e`
```sh
crontab -e
```

and add this line:

`0 3 * * * bleachbit --clean firefox.vacuum`
```text
0 3 * * * bleachbit --clean firefox.vacuum
```

## Windows Task Scheduler

Expand Down
12 changes: 8 additions & 4 deletions _posts/2015-09-30-install-on-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ gpg: using RSA key A9E582E4054A159315EDC943D6D447B02B4D4C9D
gpg: Good signature from "Andrew Ziem <ahz001@gmail.com>" [ultimate]
gpg: WARNING: not a detached signature; file 'bleachbit-5.0.2-sha256sum.txt' was NOT verified!
```

Watch for the "Good signature," and ignore the warning.

Second, verify the checksums like this:
Expand Down Expand Up @@ -182,8 +183,8 @@ bleachbit-5.0.2.tar.gz: OK
bleachbit-5.0.2.tar.bz2: OK
bleachbit-5.0.2.tar.lzma: OK
sha256sum: WARNING: 15 lines are improperly formatted

```

If you did not download all the files in the release, you will see
"No such file or directory" errors for the missing files. This is expected.
Focus on confirming that the file you downloaded shows "OK" in the output.
Expand All @@ -201,7 +202,9 @@ Double click on the downloaded installation package which has a name like `bleac

Install using the command line like this:

`sudo apt install bleachbit_5.0.2-0_all_ubuntu2504.deb`
```sh
sudo apt install bleachbit_5.0.2-0_all_ubuntu2504.deb
```

Using apt is recommended over dpkg because it will automatically install dependencies.

Expand All @@ -215,5 +218,6 @@ To install BleachBit using the graphical package manager, double click on the do

Alternatively, install using the command line like this.

`sudo dnf install bleachbit-5.0.2-1.1.fc43.noarch.rpm`

```sh
sudo dnf install bleachbit-5.0.2-1.1.fc43.noarch.rpm
```
12 changes: 9 additions & 3 deletions _posts/2015-09-30-install-on-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,21 @@ process of installing an application across many systems.
Using BleachBit 5.0.2 as an example, run the following command to install the application for all
users. It requires the calling process to have administrator privileges:

`BleachBit-5.0.2-setup.exe /S /allusers`
```bat
BleachBit-5.0.2-setup.exe /S /allusers
```

To install for only the current user, run this command:

`BleachBit-5.0.2-setup.exe /S /currentuser`
```bat
BleachBit-5.0.2-setup.exe /S /currentuser
```

To omit the desktop shortcut, add `/NoDesktopShortcut` directly after `/S`:

`BleachBit-5.0.2-setup.exe /S /NoDesktopShortcut /currentuser`
```bat
BleachBit-5.0.2-setup.exe /S /NoDesktopShortcut /currentuser
```

Because the installer is silent, it will not throw an error such as if you forget
to choose between `/allusers` and `/currentuser` or if the calling process has
Expand Down
14 changes: 10 additions & 4 deletions _posts/2018-03-14-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ file, follow these steps instead:
1. Hold down the `Windows` key while pressing `R`. This brings up the Run
dialog.
2. Type or paste the command
`"%ProgramFiles(x86)%\BleachBit\bleachbit_console.exe" --gui --debug-log=%USERPROFILE%\desktop\bleachbit.log`

```text
"%ProgramFiles(x86)%\BleachBit\bleachbit_console.exe" --gui --debug-log=%USERPROFILE%\desktop\bleachbit.log
```

3. Click **Run**.

![Screenshot of the Windows run dialog](/images/run-dialog-windows10.png)
Expand All @@ -58,9 +62,11 @@ console window.
On Linux systems, use these steps to show verbose logging information:

1. Open a terminal such as GNOME Terminal.
2. Type or paste the command
`bleachbit --gui --debug-log=/home/username/bleachbit.log`
(replace *username* with your system username).
2. Type or paste the command (replace *username* with your system username)

```sh
bleachbit --gui --debug-log=/home/username/bleachbit.log
```

The log will appear in your home directory.

Expand Down
22 changes: 16 additions & 6 deletions _posts/2021-04-17-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,27 +170,37 @@ If you are comfortable using the command line and are
[prepared to run BleachBit from source code]({% link _posts/2015-09-25-running-from-source-code.md %}),
run the unit tests with this command:

`python3 tests/TestAll.py`
```sh
python3 tests/TestAll.py
```

To run a special test case (such as General):

`python3 -m unittest tests.TestGeneral`
```sh
python3 -m unittest tests.TestGeneral
```

To run a specific test:

`python3 -m unittest tests.TestGeneral.GeneralTestCase.test_boolstr_to_bool`
```sh
python3 -m unittest tests.TestGeneral.GeneralTestCase.test_boolstr_to_bool
```

Normally the unit tests skip over any permanent changes to your system, but if you
want to enable destructive tests (which make changes without any confirmation) set
the environment variable `DESTRUCTIVE_TEST=T`. **Use with caution!** Normally you
the environment variable `DESTRUCTIVE_TESTS=T`. **Use with caution!** Normally you

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a typo

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on the typo, thank you

would only enable destructive tests on a test machine such as a virtual machine.
On Linux enable destructive tests like this:

`export DESTRUCTIVE_TESTS=T`
```sh
export DESTRUCTIVE_TESTS=T
```

On Windows enable destructive tests with:

`set DESTRUCTIVE_TESTS=T`
```bat
set DESTRUCTIVE_TESTS=T
```

To avoid changing your normal `bleachbit.ini` configuration file, set the
environment variable `BLEACHBIT_TEST_OPTIONS_DIR` to an alternate directory. When
Expand Down
7 changes: 6 additions & 1 deletion _sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ body.rtl {
}

/* ── Copy button ───────────────────────────────────────────── */
div.highlighter-rouge {
position: relative;
}

.copy-button {
position: absolute;
top: 5px;
Expand All @@ -231,7 +235,8 @@ body.rtl {
opacity: 0;
transition: opacity 0.2s ease-in-out, background-color 0.15s ease;

div.highlighter-rouge:hover & {
div.highlighter-rouge:hover &,
&:focus-visible {
opacity: 1;
}

Expand Down
Loading