qol fixes: Update Makefile and add systemd unit

This removes the makefile packaging target, since it wasn't really all that
useful for distribution of the program. Additionally, this sets up an install
target to install g13d to the users' local directory.

This is kinda a hack -- really we should be installing g13d to $PREFIX/bin,
dropping a g13d unit somewhere, and then setting up appropriate permissions,
etc. It works for me, though.
This commit is contained in:
June Tate-Gans 2021-04-24 23:50:48 -05:00
parent 815e0001cb
commit 9bf08d1d6d
2 changed files with 20 additions and 10 deletions

View File

@ -21,14 +21,14 @@ g13_lcd.o: g13.h helper.hpp g13_lcd.cc
g13_stick.o: g13.h helper.hpp g13_stick.cc
g++ $(FLAGS) -c g13_stick.cc
g13_keys.o: g13.h helper.hpp g13_keys.cc
g++ $(FLAGS) -c g13_keys.cc
helper.o: helper.hpp helper.cpp
g++ $(FLAGS) -c helper.cpp
g13d: g13_main.o g13.o g13_log.o g13_fonts.o g13_lcd.o g13_stick.o g13_keys.o helper.o
g++ -o g13d -std=c++0x \
g13_main.o g13.o g13_log.o g13_fonts.o g13_lcd.o g13_stick.o g13_keys.o helper.o \
@ -39,11 +39,14 @@ g13d: g13_main.o g13.o g13_log.o g13_fonts.o g13_lcd.o g13_stick.o g13_keys.o he
pbm2lpbm: pbm2lpbm.c
g++ -o pbm2lpbm pbm2lpbm.c
package:
rm -Rf g13-userspace
mkdir g13-userspace
cp g13.cc g13.h logo.h Makefile pbm2lpbm.c g13-userspace
tar cjf g13-userspace.tbz2 g13-userspace
rm -Rf g13-userspace
clean:
rm -f g13 pbm2lpbm
rm -f g13 pbm2lpbm
install:
install -d ${HOME}/.local/bin
install -m700 -d ${HOME}/.local/var/g13d
install -d ${HOME}/.config/systemd/user
cat g13d.service |sed "s,@HOME@,${HOME},g" > ${HOME}/.config/systemd/user/g13d.service
install -m755 g13d ${HOME}/.local/bin/g13d
.PHONY: all clean install

7
g13d.service Normal file
View File

@ -0,0 +1,7 @@
[Unit]
Description=Logitech g13 daemon
[Service]
Type=simple
ExecStart=@HOME@/.local/bin/g13d --pipe_in @HOME@/.local/var/g13d/in --pipe_out @HOME@/.local/var/g13d/out
Restart=on-failure