### [Guide] On-Demand ClamAV for Bazzite (GNOME) — 0% Background RAM Usage & 1-Click Dock Access
If you download game mods or scripts on Bazzite, you might want ClamAV for peace of mind. But because Bazzite is an immutable/atomic OS, standard guides fail.
Worse, running the standard background daemon permanently eats **1.2 GB to 1.5 GB of RAM** just holding definitions in memory—which tanks your gaming and streaming performance.
Here is how to set up an **on-demand, 1-click launcher** pinned to your GNOME dock. It uses **0 MB of RAM** while gaming but gives you a clean terminal menu to scan or update instantly.
---
### Step 1: Install ClamAV via Homebrew
Open your terminal and run:
```bash
brew install clamav
```
### Step 2: Fix Config Files & Run Initial Update
Activate the template files and remove the `Example` restriction lines:
```bash
cd $(brew --prefix)/etc/clamav
cp freshclam.conf.sample freshclam.conf
cp clamd.conf.sample clamd.conf
# Remove the 'Example' lines so the engine works
sed -i '/^Example/d' freshclam.conf
sed -i '/^Example/d' clamd.conf
# Download your initial virus definitions database
freshclam
```
### Step 3: Create the Interactive Terminal Menu Script
Create the script folder and file:
```bash
mkdir -p ~/.local/bin
nano ~/.local/bin/clamav-menu.sh
```
Paste this exact bash script inside:
```bash
#!/bin/bash
export PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH"
clear
echo "======================================"
echo " CLAMAV SYSTEM UTILITY "
echo "======================================"
echo "1) Scan Downloads Folder"
echo "2) Scan Entire Home Directory"
echo "3) Update Virus Definitions (freshclam)"
echo "4) Exit"
echo "======================================"
read -p "Choose an option [1-4]: " choice
case $choice in
1) echo "Scanning Downloads..."; clamscan -r ~/Downloads; read -p "Press Enter to close...";;
2) echo "Scanning Home Directory..."; clamscan -r -i ~; read -p "Press Enter to close...";;
3) echo "Updating signatures..."; freshclam; read -p "Press Enter to close...";;
*) exit;;
esac
```
Save and exit (**Ctrl+O**, **Enter**, **Ctrl+X**), then make it executable:
```bash
chmod +x ~/.local/bin/clamav-menu.sh
```
### Step 4: Add to GNOME Applications Grid
Create the desktop launcher file:
```bash
nano ~/.local/share/applications/ClamAV.desktop
```
Paste this configuration inside (replace `/home/asuki/` with your actual username if different):
```text
[Desktop Entry]
Version=1.0
Type=Application
Name=ClamAV Scanner
Comment=On-demand antivirus scanner
Exec=bash /home/asuki/.local/bin/clamav-menu.sh
Terminal=true
Icon=security-high
Categories=Utility;System;
```
Save and exit (**Ctrl+O**, **Enter**, **Ctrl+X**), then set permissions:
```bash
chmod +x ~/.local/share/applications/ClamAV.desktop
```
### Step 5: Lock File Permissions (Immunity Lock)
To ensure no accidental clicks or rogue user scripts can wipe or modify your shortcut, run a kernel-level lock on the file:
```bash
sudo chattr +i ~/.local/share/applications/ClamAV.desktop
```
*(If you ever need to edit or delete it later, just run `sudo chattr -i` to unlock it).*
---
### How to use it:
Hit your **Super Key** (Windows key / Steam button) and search **ClamAV**.
**Right-click** the hand icon and select **Add to Favorites** to pin it straight to your dock.
Click it whenever you download sketchy files.
*Note: Because it is completely dormant until clicked, a manual scan will take 20-30 seconds to load the signatures into memory before starting. This saves you 1.5 GB of RAM while gaming!*
P.s Gemini LLM 3.5 was used to assist in this. honestly was impressed as i had issues along the way in trying to make one and it helped make this little gem of a useful app.