M backlight.c => backlight.c +0 -3
@@ 6,9 6,6 @@
#include "backlight.h"
-#define BLBRIGH "/sys/class/backlight/intel_backlight/brightness"
-#define BLMAX "/sys/class/backlight/intel_backlight/max_brightness"
-
int
backlight(char *buf) {
assert(buf != NULL);
M backlight.h => backlight.h +6 -0
@@ 2,6 2,12 @@
#ifndef CSTATUS_BACKLIGHT_H
#define CSTATUS_BACKLIGHT_H
+/* path of file containing screen brightness */
+#define BLBRIGH "/sys/class/backlight/intel_backlight/brightness"
+
+/* path of file containing max screen brightness */
+#define BLMAX "/sys/class/backlight/intel_backlight/max_brightness"
+
int backlight(char *buf);
#endif
M battery.c => battery.c +1 -2
@@ 3,8 3,7 @@
#include <stdio.h>
#include <string.h>
-#define BATCAP "/sys/class/power_supply/BAT1/capacity"
-#define BATSTAT "/sys/class/power_supply/BAT1/status"
+#include "battery.h"
int
battery(char *buf) {
M battery.h => battery.h +6 -0
@@ 2,6 2,12 @@
#ifndef CSTATUS_BATTERY_H
#define CSTATUS_BATTERY_H
+/* path of file containing battery charge percentage */
+#define BATCAP "/sys/class/power_supply/BAT1/capacity"
+
+/* path of file containing battery status */
+#define BATSTAT "/sys/class/power_supply/BAT1/status"
+
int battery(char *buf);
#endif
M volume.c => volume.c +0 -4
@@ 8,10 8,6 @@
#include "volume.h"
-#define SELEM_ID 0
-#define SELEM_NAME "Master"
-#define CHANNEL_ID SND_MIXER_SCHN_MONO
-
int
volume(char *buf) {
assert(buf != NULL);
M volume.h => volume.h +9 -0
@@ 2,6 2,15 @@
#ifndef CSTATUS_VOLUME_H
#define CSTATUS_VOLUME_H
+/* ALSA Simple Element Id */
+#define SELEM_ID 0
+
+/* ALSA Simple Element Name */
+#define SELEM_NAME "Master"
+
+/* ALSA Channel Id */
+#define CHANNEL_ID SND_MIXER_SCHN_MONO
+
int volume(char *buf);
#endif