Compare commits

..

2 Commits

Author SHA1 Message Date
5db72c0b43 fix comment bug
comments not at the beginning of the line are no longer ignored
2020-07-28 13:33:12 +02:00
514407015e install, uninstall and version
modified makefile to be abled to install and uninstall, also installing puts
the correct version in the man page.
All credits go to suckless :^)
2020-07-28 13:30:20 +02:00
3 changed files with 21 additions and 4 deletions

2
hkd.1
View File

@ -1,4 +1,4 @@
.TH HKD 1 "JULY 2020" "Alessandro Mauri"
.TH HKD\-VERSION 1 "JULY 2020" "Alessandro Mauri"
.SH NAME
hkd \- simple HotKey Daemon

4
hkd.c
View File

@ -634,6 +634,10 @@ void parse_config_file (void)
free(line);
continue;
}
for (size_t i = 1; i < linelen; i++) {
if (line[i] == '#')
line[i] = '\0';
}
// TODO: multiline commands, ending with "\\n"
// TODO: better error checks in order to remove unnecessary

View File

@ -1,12 +1,25 @@
CC = gcc
CFLAGS = -Wall -Werror -pedantic --std=c99 -O2
VERSION = 0.1
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
hkd: hkd.o
hkd: hkd.c
debug:
gcc $(CFLAGS) -g hkd.c -o hkd_debug
hkd.o: hkd.c
install: hkd
mkdir -p ${DESTDIR}${PREFIX}/bin
cp -f hkd ${DESTDIR}${PREFIX}/bin
chmod 755 ${DESTDIR}${PREFIX}/bin/hkd
mkdir -p ${DESTDIR}${MANPREFIX}/man1
sed "s/VERSION/${VERSION}/g" < hkd.1 > ${DESTDIR}${MANPREFIX}/man1/hkd.1
chmod 644 ${DESTDIR}${MANPREFIX}/man1/hkd.1
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/hkd\
${DESTDIR}${MANPREFIX}/man1/hkd.1
clean:
rm *.o hkd hkd_debug 2> /dev/null
rm -f *.o hkd hkd_debug