From 942f7c0a040dd154a8c3b9075baadcec81884748 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Mon, 20 Aug 2018 23:24:39 -0400 Subject: Use scheme.h in fbatt and fbclock --- bin/Makefile | 2 ++ bin/fbatt.c | 12 +++++++----- bin/fbclock.c | 6 ++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/bin/Makefile b/bin/Makefile index 5ccf614a..6e92483d 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -21,6 +21,8 @@ tags: *.c scheme.h: scheme ./scheme -c > scheme.h +fbatt.o fbclock.o: scheme.h + atch: dtch ln -f dtch atch diff --git a/bin/fbatt.c b/bin/fbatt.c index 599f23fd..0f60e1da 100644 --- a/bin/fbatt.c +++ b/bin/fbatt.c @@ -27,17 +27,19 @@ #include #include +#include "scheme.h" + static const char *CLASS = "/sys/class/power_supply"; static const uint32_t RIGHT = 5 * 8 + 1; // fbclock width. static const uint32_t WIDTH = 8; static const uint32_t HEIGHT = 16; -static const uint32_t BG = 0x161510; -static const uint32_t BORDER = 0x7A7155; -static const uint32_t GRAY = 0x4C4635; -static const uint32_t YELLOW = 0xA37720; -static const uint32_t RED = 0xA32810; +static const uint32_t BG = SCHEME.darkBlack; +static const uint32_t BORDER = SCHEME.darkWhite; +static const uint32_t GRAY = SCHEME.lightBlack; +static const uint32_t YELLOW = SCHEME.darkYellow; +static const uint32_t RED = SCHEME.darkRed; int main() { int error; diff --git a/bin/fbclock.c b/bin/fbclock.c index 6b284aac..20c7b6c6 100644 --- a/bin/fbclock.c +++ b/bin/fbclock.c @@ -28,6 +28,8 @@ #include #include +#include "scheme.h" + static const uint32_t PSF2_MAGIC = 0x864AB572; struct Psf2Header { uint32_t magic; @@ -40,8 +42,8 @@ struct Psf2Header { uint32_t glyphWidth; }; -static const uint32_t BG = 0x161510; -static const uint32_t FG = 0x7A7155; +static const uint32_t BG = SCHEME.darkBlack; +static const uint32_t FG = SCHEME.darkWhite; int main() { size_t len; -- cgit 1.4.1