ThinkPad mute-mic light daemon
Project description
tpmmld
tpmmld
is the ThinkPad Mute-Mic Light Daemon. If you have a certain
ThinkPad where you have a mute-mic indicator led on the F4
button, this
daemon will control it, based on the current PulseAudio mute state of all
input sources (So all input sources mute, all input sources unmute).
When the daemon runs, it monitors for mute state changes on any input source. If any input source is muted, all input sources are muted by the daemon, likewise with unmuting, if any input source is unmuted, all input sources are unmuted.
Note: to enable/disable the led, the sudo
and tee
commands are used.
I'm sure there's a better way, but I didn't want this program to run with
elevated privileges itself. You have to configure sudo
in such a way that
you can run echo 1 | sudo tee /sys/class/leds/platform\:\:micmute/brightness
non-interactively (i.e., without a password prompt).
Install
Ideally:
pip install tpmmld
However, If it's not available there for whatever reason, you can also get it going yourself, directly from the git repository:
git clone https://github.com/rubin55/tpmmld
cd tpmmld
python -m venv .venv
pip instal -r requirements.txt
bin/tpmmld.sh -s # shows available input source devices, with index number
bin/tpmmld.sh # run tpmmld in foreground
bin/tpmmld.sh -d # run tpmmld in background
Usage
$ bin/tpmmld.sh -h
usage: tpmmld [-h] [-a] [-d] [-i INDEX] [-s] [-l {WARNING,ERROR,INFO,DEBUG}] [-v]
options:
-h, --help show this help message and exit
-d, --daemonize run in background (daemonized mode). If not specified, the process will run in the
foreground output to stdin
-s, --sources show list of sources, with index numbers
-l {WARNING,ERROR,INFO,DEBUG}, --loglevel {WARNING,ERROR,INFO,DEBUG}
specify the loglevel to use, defaults to 'INFO'
-v, --version show program's version number and exit
Build
Since this is a python package, you don't really need to build, but if you would like to build the pip packages, you can do that as follows:
python -m build
You will then find the pip package binaries in dist/
. You can install
them using pip
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tpmmld-1.1.3.tar.gz
.
File metadata
- Download URL: tpmmld-1.1.3.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00a3f857d31eeff90a4e579e4a65b71d75e84a7d18b5addaf17fb714ea90af81 |
|
MD5 | 40502e97a0ff81b3563f86ec66a0204a |
|
BLAKE2b-256 | eb401f24c8a5a1f3b4901f8bed253ae6145e332bddb55c09905bc98c87a4ecc5 |
File details
Details for the file tpmmld-1.1.3-py3-none-any.whl
.
File metadata
- Download URL: tpmmld-1.1.3-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3fd5f77d1051f347a2af131ca97ab0222dc7c1ad4960fd25fee16a3aa84675b |
|
MD5 | 7fdc3dc097e873c6e3ae7f55946fb4ef |
|
BLAKE2b-256 | ae721546087adc0a32d6d4d10f3f68973d3df8d36eb9108c183036c455aadcbe |