Skip to content

Simple rust program to interact with pactl or wpctl switching outputs

License

Notifications You must be signed in to change notification settings

raaffaaeell/simpleaudioswitcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simpleaudioswitcher

Simple program to simplify the use of pactl or wpctl (wireplumber). Currently can be run in the terminal or wrapping in a script and calling a terminal with it's outputs.

Currently tested with:

pactl 15.0

wireplumber 0.4.8

Arguments

-c --cli

Which cli to use, supported values are: pac or wp

Usage

A sample script looks like:

#!/bin/bash
~/.scripts/simpleaudioswitcher -c wp

And then I have a gnome shortcut like:

foot -- $nameofmyscript

$nameofmyscript being the file wrapping the call to the executable.

Currently, it's very barebones, not much error handling or even proper project structure since I'm not well versed in rust.

Also, currently it only deals with outputs, no mic switches (can only be done with pactl, I dont know a way to do it with wireplumber)

Why Rust at all

Funny story, the first time I wrote this stuff was with kotlin (something I enjoy writing), but distributing might not be that straight forward with java stuff. Other thing that could bother people is resource usage, with kotlin I couldn't make it run with less than 5mbs of heap which sounds ridiculous (but whatever, memory is cheap), so I tried my hand at a Rust hack, and it's pretty lightweight and functional (resource wise).

About

Simple rust program to interact with pactl or wpctl switching outputs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages