From 9a75da64fd8b72a87e1024ed171e331df9813d35 Mon Sep 17 00:00:00 2001 From: Dom H Date: Tue, 27 Sep 2016 06:24:38 +0100 Subject: [PATCH] slstatus: update to 2.0 (#4787) --- srcpkgs/slstatus/INSTALL.msg | 6 +----- srcpkgs/slstatus/files/config.h | 27 +++++++++++++++------------ srcpkgs/slstatus/template | 4 ++-- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/srcpkgs/slstatus/INSTALL.msg b/srcpkgs/slstatus/INSTALL.msg index 4b3a4c7a824..c7b806aded9 100644 --- a/srcpkgs/slstatus/INSTALL.msg +++ b/srcpkgs/slstatus/INSTALL.msg @@ -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 & diff --git a/srcpkgs/slstatus/files/config.h b/srcpkgs/slstatus/files/config.h index e5fadae56f3..b10586912e5 100644 --- a/srcpkgs/slstatus/files/config.h +++ b/srcpkgs/slstatus/files/config.h @@ -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" }, }; diff --git a/srcpkgs/slstatus/template b/srcpkgs/slstatus/template index e3508dc46d8..1447296d8c0 100644 --- a/srcpkgs/slstatus/template +++ b/srcpkgs/slstatus/template @@ -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