initial commit
This commit is contained in:
parent
19e48d3a5a
commit
314787210e
|
@ -0,0 +1,139 @@
|
|||
# NoisyPC
|
||||
|
||||
Bring the glorious chaos of the 90s back to your modern Linux machine.
|
||||
|
||||
**NoisyPC** is a small Linux utility that plays retro computer sounds—like hard drive clicks, modem screeches, and fan whines—based on real system activity. It's like installing a sound skin for your PC that turns disk I/O, CPU load, and more into an ambient nostalgia trip.
|
||||
|
||||

|
||||
|
||||
> Remember when opening a file _sounded like_ opening a file? Yeah, I do too.
|
||||
|
||||
---
|
||||
|
||||
## 🧰 Features
|
||||
|
||||
- 💽 Plays hard drive seek/spin sounds based on real disk access
|
||||
- 📡 Optional modem screech on network activity (coming soon)
|
||||
- 🧠 Customizable sound themes (HDD, modem, CPU, etc.)
|
||||
- 🔧 Lightweight Python script that runs quietly in the background
|
||||
- ☠️ Zero actual impact on performance or I/O—it’s all fake noise, for fun
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Installation
|
||||
|
||||
### 1. Install Dependencies
|
||||
|
||||
You'll need Python 3 and `ffplay` from the `ffmpeg` package:
|
||||
|
||||
```bash
|
||||
# Arch Linux
|
||||
sudo pacman -S ffmpeg
|
||||
|
||||
# Debian/Ubuntu
|
||||
sudo apt install ffmpeg
|
||||
|
||||
# Fedora
|
||||
sudo dnf install ffmpeg
|
||||
```
|
||||
|
||||
### 2. Clone the Repo
|
||||
|
||||
```bash
|
||||
git clone https://github.com/rozodru/noisypc.git
|
||||
cd noisypc
|
||||
```
|
||||
|
||||
### 3. Add Some Sounds
|
||||
|
||||
Create the sound directory and drop in some `.wav` or `.mp3` files:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.config/noisypc/sounds/hdd
|
||||
cp ./sounds/hdd1.wav ~/.config/noisypc/sounds/hdd/
|
||||
```
|
||||
|
||||
You can find retro PC sound effects from:
|
||||
|
||||
- [https://freesound.org](https://freesound.org)
|
||||
- [https://archive.org/details/RetroComputerSounds](https://archive.org/details/RetroComputerSounds)
|
||||
|
||||
### 4. Run It
|
||||
|
||||
```bash
|
||||
python3 noisypc.py
|
||||
```
|
||||
|
||||
Or make it executable:
|
||||
|
||||
```bash
|
||||
chmod +x noisypc.py
|
||||
./noisypc.py
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📁 Directory Structure
|
||||
|
||||
```
|
||||
~/.config/noisypc/
|
||||
└── sounds/
|
||||
└── hdd/
|
||||
├── hdd1.wav
|
||||
├── hdd2.wav
|
||||
└── ...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ Configuration (Coming Soon)
|
||||
|
||||
In the next release: config file support for:
|
||||
|
||||
- Disk device selection
|
||||
- Volume and cooldown
|
||||
- Sound themes
|
||||
- Toggling features
|
||||
|
||||
---
|
||||
|
||||
## 🧠 Why?
|
||||
|
||||
Because silent computers are boring.
|
||||
Because SSDs are too fast.
|
||||
Because we _miss_ the sound of our machine _doing something_.
|
||||
|
||||
---
|
||||
|
||||
## 💡 Roadmap
|
||||
|
||||
- [x] Disk I/O-triggered HDD sounds
|
||||
- [ ] Network activity-triggered modem sounds
|
||||
- [ ] CPU load-triggered fan or coil whine
|
||||
- [ ] Config file support (TOML/YAML)
|
||||
- [ ] GUI/TUI toggle or system tray icon
|
||||
- [ ] Theme packs: IBM, Gateway, Packard Bell
|
||||
|
||||
---
|
||||
|
||||
## 👤 Author
|
||||
|
||||
**andrew@andmc.ca**
|
||||
Retro computing enthusiast, Linux tinkerer, chaos enjoyer.
|
||||
|
||||
---
|
||||
|
||||
## 🧡 Contributing
|
||||
|
||||
PRs welcome! Especially if you:
|
||||
|
||||
- Want to add new sound trigger types
|
||||
- Have a great archive of retro sounds
|
||||
- Can build out systemd or autostart support
|
||||
|
||||
---
|
||||
|
||||
## 📜 License
|
||||
|
||||
MIT License.
|
||||
Make noise, not spyware.
|
|
@ -0,0 +1,61 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import time
|
||||
import os
|
||||
import random
|
||||
import subprocess
|
||||
|
||||
DISK_DEVICE = "nvme0n1" # or sdb, nvme0n1, etc.
|
||||
SOUND_DIR = os.path.expanduser("~/.config/noisypc/sounds/hdd")
|
||||
SOUND_COOLDOWN = 1.5 # seconds between sounds to avoid rapid-fire
|
||||
CHECK_INTERVAL = 0.5 # how often to check disk stats
|
||||
|
||||
|
||||
def get_disk_stats(device):
|
||||
with open("/proc/diskstats", "r") as f:
|
||||
for line in f:
|
||||
if device in line:
|
||||
parts = line.split()
|
||||
# Read sectors: field 5, Write sectors: field 9
|
||||
read_sectors = int(parts[5])
|
||||
write_sectors = int(parts[9])
|
||||
return read_sectors, write_sectors
|
||||
return 0, 0
|
||||
|
||||
|
||||
def play_random_sound():
|
||||
if not os.path.isdir(SOUND_DIR):
|
||||
return
|
||||
sounds = [f for f in os.listdir(SOUND_DIR) if f.endswith((".wav", ".mp3"))]
|
||||
if not sounds:
|
||||
return
|
||||
sound_file = os.path.join(SOUND_DIR, random.choice(sounds))
|
||||
subprocess.Popen(
|
||||
["ffplay", "-nodisp", "-autoexit", "-loglevel", "quiet", sound_file]
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
print("NoisyPC is running... Ctrl+C to quit.")
|
||||
last_read, last_write = get_disk_stats(DISK_DEVICE)
|
||||
last_played = 0
|
||||
|
||||
while True:
|
||||
time.sleep(CHECK_INTERVAL)
|
||||
current_read, current_write = get_disk_stats(DISK_DEVICE)
|
||||
delta_read = current_read - last_read
|
||||
delta_write = current_write - last_write
|
||||
last_read, last_write = current_read, current_write
|
||||
|
||||
if (delta_read > 10 or delta_write > 10) and (
|
||||
time.time() - last_played > SOUND_COOLDOWN
|
||||
):
|
||||
play_random_sound()
|
||||
last_played = time.time()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
print("\nExiting NoisyPC.")
|
Loading…
Reference in New Issue