paleofetch

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 883c58aa3beca8a1d54cdcdd6b66c5c5aac9500e
parent fd9f29ee659a30b4d8de913e7b7077cfad36ff22
Author: Sridaran Thoniyil <sri7thon@gmail.com>
Date:   Fri,  8 May 2020 20:50:54 -0400

Pass battery path directly to compiler

Diffstat:
MMakefile | 4++--
Mbattery_config.sh | 2+-
Mpaleofetch.c | 1-
3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -8,8 +8,8 @@ clean: rm -f paleofetch $(CACHE)/paleofetch paleofetch: paleofetch.c paleofetch.h config.h - ./battery_config.sh - $(CC) paleofetch.c -o paleofetch $(CFLAGS) + $(eval battery_path := $(shell ./battery_config.sh)) + $(CC) paleofetch.c -o paleofetch $(CFLAGS) -D $(battery_path) strip paleofetch install: paleofetch diff --git a/battery_config.sh b/battery_config.sh @@ -2,4 +2,4 @@ BATTERY_DIRECTORY=`ls -1 /sys/class/power_supply | grep -i "^bat" | head -n 1` -echo "#define BATTERY_DIRECTORY \"/sys/class/power_supply/$BATTERY_DIRECTORY\"" > battery_config.h +echo "BATTERY_DIRECTORY='\"/sys/class/power_supply/$BATTERY_DIRECTORY\"'" diff --git a/paleofetch.c b/paleofetch.c @@ -18,7 +18,6 @@ #include "paleofetch.h" #include "config.h" -#include "battery_config.h" #define BUF_SIZE 150 #define COUNT(x) (int)(sizeof x / sizeof *x)