slstatus: update to 2.0 (#4787)
This commit is contained in:
parent
be6a436c3f
commit
9a75da64fd
3 changed files with 18 additions and 19 deletions
|
@ -1,7 +1,3 @@
|
||||||
To use slstatus, put the following code in your ~/.xinitrc (or similar):
|
To use slstatus, put the following code in your ~/.xinitrc (or similar):
|
||||||
|
|
||||||
while true; do
|
slstatus &
|
||||||
slstatus
|
|
||||||
done &
|
|
||||||
|
|
||||||
The loop is needed so that the program runs after suspend to ram.
|
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
/* See LICENSE file for copyright and license details. */
|
/* See LICENSE file for copyright and license details. */
|
||||||
|
|
||||||
/* alsa sound */
|
/* alsa sound */
|
||||||
static const char channel[] = "Master";
|
#define ALSA_CHANNEL "Master"
|
||||||
|
|
||||||
/* battery */
|
/* battery */
|
||||||
static const char batterypath[] = "/sys/class/power_supply/";
|
#define BATTERY_PATH "/sys/class/power_supply/"
|
||||||
static const char batterynow[] = "energy_now";
|
#define BATTERY_NOW "energy_now"
|
||||||
static const char batteryfull[] = "energy_full_design";
|
#define BATTERY_FULL "energy_full_design"
|
||||||
|
|
||||||
/* bar update interval in seconds (smallest value = 1) */
|
/* how often to update the statusbar (min value == 1) */
|
||||||
static unsigned int update_interval = 1;
|
#define UPDATE_INTERVAL 1
|
||||||
|
|
||||||
|
/* text to show if no value can be retrieved */
|
||||||
|
#define UNKNOWN_STR "n/a"
|
||||||
|
|
||||||
/* statusbar
|
/* statusbar
|
||||||
- battery_perc (battery percentage) [argument: battery name]
|
- battery_perc (battery percentage) [argument: battery name]
|
||||||
|
@ -23,6 +26,7 @@ static unsigned int update_interval = 1;
|
||||||
- gid (gid of current user) [argument: NULL]
|
- gid (gid of current user) [argument: NULL]
|
||||||
- hostname [argument: NULL]
|
- hostname [argument: NULL]
|
||||||
- ip (ip address) [argument: interface]
|
- ip (ip address) [argument: interface]
|
||||||
|
- load_avg (load average) [argument: NULL]
|
||||||
- ram_free (ram usage in percent) [argument: NULL]
|
- ram_free (ram usage in percent) [argument: NULL]
|
||||||
- ram_perc (ram usage in percent) [argument: NULL]
|
- ram_perc (ram usage in percent) [argument: NULL]
|
||||||
- ram_total (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]
|
- run_command (run custom shell command) [argument: command]
|
||||||
- temp (temperature in degrees) [argument: temperature file]
|
- temp (temperature in degrees) [argument: temperature file]
|
||||||
- uid (uid of current user) [argument: NULL]
|
- uid (uid of current user) [argument: NULL]
|
||||||
|
- uptime (uptime) [argument: NULL]
|
||||||
- username (username of current user) [argument: NULL]
|
- username (username of current user) [argument: NULL]
|
||||||
- vol_perc (alsa volume and mute status in percent) [argument: soundcard]
|
- vol_perc (alsa volume and mute status in percent) [argument: soundcard]
|
||||||
- wifi_perc (wifi signal in percent) [argument: wifi card interface name]
|
- wifi_perc (wifi signal in percent) [argument: wifi card interface name]
|
||||||
- wifi_essid (wifi essid) [argument: wifi card interface name] */
|
- wifi_essid (wifi essid) [argument: wifi card interface name] */
|
||||||
static const struct arg args[] = {
|
static const struct arg args[] = {
|
||||||
/* function format argument */
|
/* function format argument */
|
||||||
{ cpu_perc, "cpu %4s | ", NULL },
|
{ cpu_perc, "[ CPU %4s ]", NULL },
|
||||||
{ ram_perc, "ram %3s | ", NULL },
|
{ ram_perc, "[ Mem %3s ]", NULL },
|
||||||
{ vol_perc, "vol %4s | ", "default" },
|
{ datetime, "[ %s ]", "%F %T" },
|
||||||
{ disk_perc, "ssd %3s | ", "/" },
|
|
||||||
{ datetime, "%s", "%y-%m-%d %H:%M:%S" },
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Template file for 'slstatus'
|
# Template file for 'slstatus'
|
||||||
pkgname=slstatus
|
pkgname=slstatus
|
||||||
version=1.1
|
version=2.0
|
||||||
revision=1
|
revision=1
|
||||||
build_style=gnu-makefile
|
build_style=gnu-makefile
|
||||||
short_desc="Suckless status monitor for dwm"
|
short_desc="Suckless status monitor for dwm"
|
||||||
|
@ -9,7 +9,7 @@ license="ISC"
|
||||||
homepage="https://git.nulltime.net/slstatus"
|
homepage="https://git.nulltime.net/slstatus"
|
||||||
distfiles="${homepage}/snapshot/${pkgname}-${version}.tar.gz"
|
distfiles="${homepage}/snapshot/${pkgname}-${version}.tar.gz"
|
||||||
makedepends="alsa-lib-devel libX11-devel"
|
makedepends="alsa-lib-devel libX11-devel"
|
||||||
checksum=77c42876571c7b1d850325e8d09a37ca9264031e4e6237195480d718a9a584f6
|
checksum=a7fd452940d4136376df3f9887e231fc183f4cbe8473c6c63a0687905406351f
|
||||||
|
|
||||||
pre_build() {
|
pre_build() {
|
||||||
cp ${FILESDIR}/config.h config.h
|
cp ${FILESDIR}/config.h config.h
|
||||||
|
|
Loading…
Reference in a new issue