aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/README.md
blob: 6ec5ce926a688ce7c88cc4f5aa4243440c1359aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# wmsl contrib scripts

This directory contains useful system monitoring scripts for use with wmsl.

## Available Scripts

- **wmsl-battery** - Battery status and percentage
- **wmsl-cpu** - CPU usage percentage
- **wmsl-memory** - Memory usage (used/total)
- **wmsl-disk** - Disk usage for root filesystem
- **wmsl-time** - Current date and time
- **wmsl-ip** - IP address of primary network interface
- **wmsl-volume** - Audio volume level (requires alsa-utils)
- **wmsl-load** - System load average
- **wmsl-temp** - CPU temperature
- **wmsl-wifi** - WiFi SSID and signal strength (requires iw)

## Installation

Copy the scripts you want to use to a directory in your PATH, such as `~/.local/bin`:

```sh
cp contrib/wmsl-* ~/.local/bin/
chmod +x ~/.local/bin/wmsl-*
```

## Configuration Example

Create or edit `~/.config/wmsl/wmslrc`:

```
delim= |
prefix=
suffix=

block=wmsl-ip
block-id=3
block-sleep=60

block=wmsl-memory
block-id=4
block-sleep=5

block=wmsl-cpu
block-id=5
block-sleep=2

block=wmsl-battery
block-id=2
block-sleep=10

block=wmsl-time
block-id=1
block-sleep=1
```

## Triggering Updates

Use `sigwmsl` to manually trigger updates for specific blocks:

```sh
sigwmsl 2  # Update battery
sigwmsl 1  # Update time
```

This is useful for responding to events like volume changes or battery alerts.

## Creating Custom Scripts

Scripts should:
- Output a single line of text
- Be executable (`chmod +x`)
- Exit quickly (preferably under 100ms)
- Handle errors gracefully

Example custom script:

```sh
#!/bin/sh
printf "Hello %s" "$USER"
```