1
0
slstatus/README.md

74 lines
3.2 KiB
Markdown
Raw Normal View History

2016-09-09 21:12:13 +02:00
![slstatus](slstatus.png)
2016-03-08 18:17:50 +01:00
2016-09-18 17:51:25 +02:00
**slstatus** is a suckless and lightweight status monitor for window managers that use WM_NAME as statusbar (e.g. DWM) or any other status bars if they support reading/piping from slstatus. It is written in pure C without any extern programs being executed and only reads from files most of the time. slstatus is meant to be a better alternative to Bash scripts (inefficient) and Conky (bloated and written in C++).
2016-09-18 17:51:25 +02:00
If you write a bash script that shows system information in WM_NAME (or any other status bar), it executes a huge amount of external commands (top, free etc.) every few seconds. This results in high system resource usage. slstatus solves this problem by only using C libraries and/or reading from files in sysfs/procfs most of the time.
2016-06-30 18:29:11 +02:00
2016-09-18 17:51:25 +02:00
Looking at the LOC (lines of code) of the [Conky project](https://github.com/brndnmtthws/conky), it is very interesting: *28346 lines C++, 219 lines Python and 110 lines Lua*. slstatus currently has about **800 lines of clean documented C code** and even includes additional possibilities as it can be customized and extended very easily. Configuring it by customizing the config.h (C header) file is very secure and fast as no config files are parsed at runtime.
2016-06-30 18:29:11 +02:00
The following information is included:
2016-09-13 22:03:36 +02:00
- Battery percentage/state
2016-08-23 13:11:55 +02:00
- CPU usage (in percent)
- Custom shell commands
- Date and time
- Disk[s] status (free storage, percentage, total storage and used storage)
- Available entropy
2016-09-18 17:51:25 +02:00
- Username/GID/UID
2016-08-23 13:11:55 +02:00
- Hostname
- IP addresses
2016-11-03 17:49:09 +01:00
- Kernel version
2016-09-18 17:51:25 +02:00
- Load averages
2016-08-23 13:11:55 +02:00
- Memory status (free memory, percentage, total memory and used memory)
2016-10-15 12:49:33 +02:00
- Swap status (free swap, percentage, total swap and used swap)
2016-08-23 13:11:55 +02:00
- Temperature
- Uptime
- Volume percentage (OSS/ALSA)
2016-09-18 17:51:25 +02:00
- WiFi signal percentage and ESSID
2016-06-14 19:19:25 +02:00
2016-09-18 17:51:25 +02:00
Multiple entries per function (e.g. multiple batteries) are supported and everything can be reordered and customized via a C header file (similar to other suckless programs).
2016-03-08 18:17:50 +01:00
## Usage
2016-03-08 18:17:50 +01:00
### Installation
2016-09-18 17:51:25 +02:00
Be sure you satisfy the dependencies: X11 and optionally ALSA (for volume percentage, I will *not* support PulseAudio).
Also you should have basic development tools like a C compiler and GNU make installed.
Then copy config.def.h to config.h and customize it to your needs.
(Re)Compile (and install) it (after modifications):
2016-08-23 13:11:55 +02:00
$ make clean all
# make install
2016-03-09 11:26:19 +01:00
### Starting
2016-03-10 07:51:04 +01:00
2016-09-18 17:51:25 +02:00
If you use DWM or any other window manager that uses WM_NAME, write the following code to ~/.xinitrc (or any other initialization script) to start slstatus automatically:
2016-03-10 07:51:04 +01:00
2016-09-18 17:51:25 +02:00
slstatus -d
If you use any other status bar or window manager you will have to figure it out yourself. Something like this could fit your requirements:
slstatus -o | other_status_bar &
### Specific function quirks
- Volume percentage
If there is no `/dev/mixer` on your system and you use ALSA, it means you have to load the OSS compatibility module by issuing:
```
# modprobe snd-pcm-oss
```
## Contributing
2016-09-18 17:51:25 +02:00
Hunt FIXME's in the code or do WTF you want! If it is useful, I will merge.
2016-09-18 17:51:25 +02:00
People who contributed are listed in [CONTRIBUTORS.md](CONTRIBUTORS.md). Please add yourself to this list afterwards.
2016-03-09 11:26:19 +01:00
2016-09-18 17:51:25 +02:00
For detailed information about coding style and restrictions see [CONTRIBUTING.md](CONTRIBUTING.md).
2016-03-10 18:01:39 +01:00
## License
2016-03-10 15:12:09 +01:00
2016-03-20 14:20:22 +01:00
See [LICENSE](LICENSE).