diff --git a/README.md b/README.md new file mode 100644 index 0000000..5eec3fd --- /dev/null +++ b/README.md @@ -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. + +![Retro PC](https://upload.wikimedia.org/wikipedia/commons/3/32/IBM_PS2_Model_25.jpg) + +> 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. diff --git a/hdd1.wav b/hdd1.wav new file mode 100644 index 0000000..0a1952c Binary files /dev/null and b/hdd1.wav differ diff --git a/hdd2.wav b/hdd2.wav new file mode 100644 index 0000000..729956f Binary files /dev/null and b/hdd2.wav differ diff --git a/hdd3.wav b/hdd3.wav new file mode 100644 index 0000000..870dbd6 Binary files /dev/null and b/hdd3.wav differ diff --git a/hdd4.wav b/hdd4.wav new file mode 100644 index 0000000..3b1ba51 Binary files /dev/null and b/hdd4.wav differ diff --git a/noisypc.py b/noisypc.py new file mode 100755 index 0000000..3472750 --- /dev/null +++ b/noisypc.py @@ -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.")