added config.def.h handling and fixed typo
authorAaron Marcher <info@nulltime.net>
Fri, 4 Mar 2016 17:36:47 +0000 (18:36 +0100)
committerAaron Marcher (drkhsh) <info@nulltime.net>
Fri, 4 Mar 2016 17:36:47 +0000 (18:36 +0100)
.gitignore
Makefile
README.md
config.def.h [new file with mode: 0644]
config.h [deleted file]
slstatus.c

index 0622c05a76b98f60bee3778f52c79429edcfb619..484c6c0d33d80155de01c465eaa9dee2a506865b 100644 (file)
@@ -1,2 +1,3 @@
 slstatus
 slstatus.o
+config.h
index f31d1c7dfc945e8120d13dbdce54bbb68bc56b2d..e1bb37069fd62dc10ecabd6296d8a8dadb52c005 100644 (file)
--- 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 $@
index 8bd2a91c6651d2a9e0a116b2329193c94e2ef5ec..ce55737a0d2f227e43f18e4f2afec899c766d44b 100644 (file)
--- 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 (file)
index 0000000..b92a20d
--- /dev/null
@@ -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 (file)
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()
index 77f900d678f645c6e2861f758cf75f2ca33346cc..962744aa76859dac9f4edca855a3766c0f8311a3 100644 (file)
@@ -13,7 +13,7 @@
 
 char *smprintf(char *fmt, ...);
 
-void *setstatus(char *str);
+void setstatus(char *str);
 
 char *wifi_signal();
 char *battery();