slstatus: update to 2.0 (#4787)

This commit is contained in:
Dom H 2016-09-27 06:24:38 +01:00 committed by Juan RP
parent be6a436c3f
commit 9a75da64fd
3 changed files with 18 additions and 19 deletions

View file

@ -1,7 +1,3 @@
To use slstatus, put the following code in your ~/.xinitrc (or similar):
while true; do
slstatus
done &
The loop is needed so that the program runs after suspend to ram.
slstatus &

View file

@ -1,15 +1,18 @@
/* See LICENSE file for copyright and license details. */
/* alsa sound */
static const char channel[] = "Master";
#define ALSA_CHANNEL "Master"
/* battery */
static const char batterypath[] = "/sys/class/power_supply/";
static const char batterynow[] = "energy_now";
static const char batteryfull[] = "energy_full_design";
#define BATTERY_PATH "/sys/class/power_supply/"
#define BATTERY_NOW "energy_now"
#define BATTERY_FULL "energy_full_design"
/* bar update interval in seconds (smallest value = 1) */
static unsigned int update_interval = 1;
/* how often to update the statusbar (min value == 1) */
#define UPDATE_INTERVAL 1
/* text to show if no value can be retrieved */
#define UNKNOWN_STR "n/a"
/* statusbar
- battery_perc (battery percentage) [argument: battery name]
@ -23,6 +26,7 @@ static unsigned int update_interval = 1;
- gid (gid of current user) [argument: NULL]
- hostname [argument: NULL]
- ip (ip address) [argument: interface]
- load_avg (load average) [argument: NULL]
- ram_free (ram usage in percent) [argument: NULL]
- ram_perc (ram usage in percent) [argument: NULL]
- ram_total (ram usage in percent) [argument: NULL]
@ -30,15 +34,14 @@ static unsigned int update_interval = 1;
- run_command (run custom shell command) [argument: command]
- temp (temperature in degrees) [argument: temperature file]
- uid (uid of current user) [argument: NULL]
- uptime (uptime) [argument: NULL]
- username (username of current user) [argument: NULL]
- vol_perc (alsa volume and mute status in percent) [argument: soundcard]
- wifi_perc (wifi signal in percent) [argument: wifi card interface name]
- wifi_essid (wifi essid) [argument: wifi card interface name] */
static const struct arg args[] = {
/* function format argument */
{ cpu_perc, "cpu %4s | ", NULL },
{ ram_perc, "ram %3s | ", NULL },
{ vol_perc, "vol %4s | ", "default" },
{ disk_perc, "ssd %3s | ", "/" },
{ datetime, "%s", "%y-%m-%d %H:%M:%S" },
/* function format argument */
{ cpu_perc, "[ CPU %4s ]", NULL },
{ ram_perc, "[ Mem %3s ]", NULL },
{ datetime, "[ %s ]", "%F %T" },
};

View file

@ -1,6 +1,6 @@
# Template file for 'slstatus'
pkgname=slstatus
version=1.1
version=2.0
revision=1
build_style=gnu-makefile
short_desc="Suckless status monitor for dwm"
@ -9,7 +9,7 @@ license="ISC"
homepage="https://git.nulltime.net/slstatus"
distfiles="${homepage}/snapshot/${pkgname}-${version}.tar.gz"
makedepends="alsa-lib-devel libX11-devel"
checksum=77c42876571c7b1d850325e8d09a37ca9264031e4e6237195480d718a9a584f6
checksum=a7fd452940d4136376df3f9887e231fc183f4cbe8473c6c63a0687905406351f
pre_build() {
cp ${FILESDIR}/config.h config.h