From: Aaron Marcher Date: Fri, 4 Mar 2016 17:36:47 +0000 (+0100) Subject: added config.def.h handling and fixed typo X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=864f2246b5dfeb023137d8f5ebb599e4eb6aedda;p=suckless%2Fslstatus.git added config.def.h handling and fixed typo --- diff --git a/.gitignore b/.gitignore index 0622c05..484c6c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ slstatus slstatus.o +config.h diff --git a/Makefile b/Makefile index f31d1c7..e1bb370 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,11 @@ options: @echo CC $< @${CC} -c ${CFLAGS} $< -${OBJ}: config.mk +${OBJ}: config.h config.mk + +config.h: + @echo creating $@ from config.def.h + @cp config.def.h $@ ${NAME}: ${OBJ} @echo CC -o $@ diff --git a/README.md b/README.md index 8bd2a91..ce55737 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,17 @@ # slstatus A suckless status monitor for DWM written in pure C without any system() calls. + +# information + +- wifi percentage +- battery percentage +- cpu usage in percent +- cpu temperature +- ram usage in percent +- alsa volume level in percent +- date +- time + +# configuration + +Just edit config.h and recompile! diff --git a/config.def.h b/config.def.h new file mode 100644 index 0000000..b92a20d --- /dev/null +++ b/config.def.h @@ -0,0 +1,22 @@ +/* See LICENSE file for copyright and license details. */ + +/* alsa sound */ +static const char soundcard[] = "default"; +static const char channel[] = "Master"; + +/* cpu temperature */ +static const char tempfile[] = "/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input"; + +/* wifi */ +static const char wificard[] = "wlp3s0"; + +/* battery */ +static const char batterynowfile[] = "/sys/class/power_supply/BAT0/energy_now"; +static const char batteryfullfile[] = "/sys/class/power_supply/BAT0/energy_full_design"; + +/* time */ +static const char timeformat[] = "%y-%m-%d %H:%M:%S"; + +/* statusbar */ +#define FORMATSTRING "wifi %4s | bat %4s | cpu %4s %3s | ram %3s | vol %4s | %3s" +#define ARGUMENTS wifi_signal(), battery(), cpu_usage(), cpu_temperature(), ram_usage(), volume(), datetime() diff --git a/config.h b/config.h deleted file mode 100644 index b92a20d..0000000 --- a/config.h +++ /dev/null @@ -1,22 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* alsa sound */ -static const char soundcard[] = "default"; -static const char channel[] = "Master"; - -/* cpu temperature */ -static const char tempfile[] = "/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input"; - -/* wifi */ -static const char wificard[] = "wlp3s0"; - -/* battery */ -static const char batterynowfile[] = "/sys/class/power_supply/BAT0/energy_now"; -static const char batteryfullfile[] = "/sys/class/power_supply/BAT0/energy_full_design"; - -/* time */ -static const char timeformat[] = "%y-%m-%d %H:%M:%S"; - -/* statusbar */ -#define FORMATSTRING "wifi %4s | bat %4s | cpu %4s %3s | ram %3s | vol %4s | %3s" -#define ARGUMENTS wifi_signal(), battery(), cpu_usage(), cpu_temperature(), ram_usage(), volume(), datetime() diff --git a/slstatus.c b/slstatus.c index 77f900d..962744a 100644 --- a/slstatus.c +++ b/slstatus.c @@ -13,7 +13,7 @@ char *smprintf(char *fmt, ...); -void *setstatus(char *str); +void setstatus(char *str); char *wifi_signal(); char *battery();