diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | COPYING | 3 | ||||
-rw-r--r-- | Makefile | 19 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | config.def.mk | 40 |
5 files changed, 33 insertions, 33 deletions
@@ -1,4 +1,6 @@ *.o *.swp +*~ /dwmclock /config.mk +/compile_commands.json @@ -0,0 +1,3 @@ +This software is released into the public domain. +It is provided "as is", without warranties or conditions of any kind. +Anyone is free to use, modify, redistribute and do anything with this software. @@ -1,8 +1,19 @@ -include config.mk +CC? = cc +MAIN = dwmclock +SRC = dwmclock.c +OBJ = $(SRC:.c=.o) +CFLAGS := -std=c99 -Wall -Wextra -pedantic -Os $(shell pkg-config --cflags x11) $(CFLAGS) +LDFLAGS := $(shell pkg-config --libs x11) $(LDFLAGS) + +# install in /usr/local/bin +DESTDIR ?= / +PREFIX ?= /usr/local -MAIN=dwmclock -SRC=dwmclock.c -OBJ=$(SRC:.c=.o) +# install in ~/.local/bin +#DESTDIR ?= ~ +#PREFIX ?= /.local + +include config.mk all: $(SRC) $(MAIN) @@ -6,7 +6,7 @@ Show the time and current battery charge in the X root window name Requirements ------------ -- Xlib headers +- libX11 Installation diff --git a/config.def.mk b/config.def.mk index 0d5d03d..a9dfe19 100644 --- a/config.def.mk +++ b/config.def.mk @@ -1,43 +1,27 @@ # dwmclock settings # enable battery charge display -CFLAGS+=-DBATTERY +CFLAGS += -DBATTERY # set this to the correct path for your current system -CFLAGS+=-DENERGY_FULL=\"/sys/class/power_supply/BAT0/energy_full\" -CFLAGS+=-DENERGY_NOW=\"/sys/class/power_supply/BAT0/energy_now\" -CFLAGS+=-DSTATUS=\"/sys/class/power_supply/ADP1/online\" +CFLAGS += -DENERGY_FULL=\"/sys/class/power_supply/BAT0/energy_full\" +CFLAGS += -DENERGY_NOW=\"/sys/class/power_supply/BAT0/energy_now\" +CFLAGS += -DSTATUS=\"/sys/class/power_supply/BAT0/status\" # the string to match when the battery is charging; comment out to disable charging detection -CFLAGS+=-DCHARGING=\"1\\n\" +CFLAGS += -DCHARGING=\"Charging\\n\" # possible alternative on some systems -#CFLAGS+=-DENERGY_FULL=\"/sys/class/power_supply/BAT0/charge_full\" -#CFLAGS+=-DENERGY_NOW=\"/sys/class/power_supply/BAT0/charge_now\" -#CFLAGS+=-DSTATUS=\"/sys/class/power_supply/BAT0/status\" -#CFLAGS+=-DCHARGING=\"Charging\\n\" +#CFLAGS += -DENERGY_FULL=\"/sys/class/power_supply/BAT0/charge_full\" +#CFLAGS += -DENERGY_NOW=\"/sys/class/power_supply/BAT0/charge_now\" +#CFLAGS += -DSTATUS=\"/sys/class/power_supply/ADP1/online\" +#CFLAGS += -DCHARGING=\"1\\n\" # every how many seconds to refresh the battery charge display -CFLAGS+=-DBAT_REFRESH_SECONDS=10 +CFLAGS += -DBAT_REFRESH_SECONDS=10 # this is here for legacy reasons, ignore it -CFLAGS+=-DMUL=1 +CFLAGS += -DMUL=1 # sleep to the start of the next second instead of for 1s -CFLAGS+=-DEXACT_SLEEP - - -# make settings - -# default compiler -CC?=gcc - -# compiler flags -CFLAGS+=-std=c99 -Wall -Wextra -pedantic -Os $(shell pkg-config --cflags x11) -LDFLAGS+=$(shell pkg-config --libs x11) - -# default paths -DESTDIR?=/ -PREFIX?=/usr/local -#DESTDIR?=~ -#PREFIX?=/.local +CFLAGS += -DEXACT_SLEEP |