A simple GTK-based Python tool to select and set audio output devices on GhostBSD.
- Detects available sound output devices (
/dev/sndstat). - Allows selecting a device from a GTK dropdown menu.
- Sets the default output device via
sysctl.
- GhostBSD (or FreeBSD-based system)
- Python 3.11+
- GTK3 and PyGObject (system packages)
Install required packages:
sudo pkg install python py311-pygobject gtk3 gobject-introspection glib pkgconf
Installation (via Makefile)
Clone the repository:
git clone https://github.com/mateo-rfz/soundctl
cd soundctlInstall dependencies, build, and optionally install the binary:
To install system and Python dependencies, build the executable, and install to /usr/local/bin:
sudo make install
To only build the standalone executable (without installing):
make build
To install the binary separately after building:
make install-bin
To uninstall the binary from /usr/local/bin:
make uninstall
Usage
You can either run the script directly or use the installed binary:
Run the Python script:
python3 soundctl.py
Or, if installed via Makefile:
soundctl
Select your preferred output device from the GTK dropdown.
The script will automatically update the default sound unit.
Clean build artifacts and virtual environment:
make clean
Build standalone executable (optional):
make build
Install the binary to /usr/local/bin (optional):
make install
License
BSD-2-Clause license