Metadata-Version: 2.4
Name: blstatus
Version: 0.4
Summary: A status monitor for DWM or other window managers that use WM_NAME
Author-email: Brenton Leighton <12228142+brenton-leighton@users.noreply.github.com>
Maintainer-email: Brenton Leighton <12228142+brenton-leighton@users.noreply.github.com>
License: MIT License
        
        Copyright (c) 2022 Brenton Leighton
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/brenton-leighton/blstatus
Keywords: dwm
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: apscheduler
Requires-Dist: asyncio-glib
Requires-Dist: pulsectl-asyncio
Requires-Dist: pydbus
Requires-Dist: xlib
Dynamic: license-file

# blstatus

A status monitor for [DWM](https://dwm.suckless.org/) (or any window manager that uses WM_NAME to fill a status bar).
Compared to [slstatus](https://tools.suckless.org/slstatus/), blstatus is capable of displaying more information, and it also updates network, audio volume, and battery information asynchronously, rather than using polling.

![Example status_bar](https://github.com/brenton-leighton/blstatus/assets/12228142/0365ec84-96be-4532-a193-5c8ddba88a34)

## Installation

blstatus has the following dependencies:

- python3-dev
- libcairo2-dev
- libgirepository2.0-dev

And the following dependencies available on PyPI:

- apscheduler
- asyncio-glib
- pulsectl-asyncio
- pydbus
- xlib

The package can be installed using [pipx](https://pipx.pypa.io/stable/installation/), e.g.:

```bash
sudo apt install pipx python3-dev libcairo2-dev libgirepository1.0-dev
pipx install blstatus
```

## Configuration

blstatus can be configured with a file located at `~/.config/blstatus/config.ini`, e.g.

```ini
[general]
# Text to use between components
# Needs to be quoted if spaces (or a quote character) are used
spacer = ' | '

# Enable if using statuscmd (https://dwm.suckless.org/patches/statuscmd/)
enable_signal_text = false

[date_time]
# Format string for the date command
# Must be quoted and % must be doubled
format = '+"%%Y-%%m-%%d %%A %%-I:%%M %%P"'

[memory]
# Interval in seconds between updating memory status
interval = 2.0

# Enable using nvidia-smi to get GPU memory usage
enable_gpu = false

[volume]
# Dictionary to map a PulseAudio sink/source name to an abbreviation
# If the end of a PulseAudio device name matches a key the value will be used
# If a PulseAudio device name doesn't match anything in the dictionary, source_sink_unknown_abbreviation is used
# Must be a single line
source_sink_abbreviations = { 'analog-stereo': 'A', 'hdmi-stereo': 'H', 'a2dp_sink': 'B', 'handsfree_head_unit': 'B' }

# Abbreviation to use if a sink/source name isn't known
source_sink_unknown_abbreviation = 'U'
```

To determine the key part of `source_sink_abbreviations`, PulseAudio sink/source names can be printed with:

```python
import pulsectl

pulse = pulsectl.Pulse()
print([sink.name for sink in pulse.sink_list()])
print([source.name for source in pulse.source_list()])
```

## Starting with systemd

A systemd service file is included in this repository which can be enabled and started like so:

```bash
# Copy the service file
cp blstatus.service ~/.local/share/systemd/user/

# Enable the service
systemctl --user enable blstatus

# Start the service
systemctl --user start blstatus
```
