Skip to content

Commit

Permalink
Added default config in /usr/share
Browse files Browse the repository at this point in the history
  • Loading branch information
threadexio committed Jul 12, 2021
1 parent af74705 commit f44a5de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ TARGET := kbd-backlight

GROUP := kbd-backlight
CFG_DIR := /etc/kbd-backlight
DEFAULT_CFG_DIR := /usr/share/kbd-backlight
SRV_PATH := /usr/lib/systemd/system

SRC_DIR := src
Expand Down Expand Up @@ -50,20 +51,26 @@ install: all
setcap cap_dac_override+eip $(DESTDIR)/usr/local/bin/kbd-backlight

install -Dm0644 files/backlight.conf $(DESTDIR)$(CFG_DIR)/backlight.conf
install -Dm0644 files/backlight.conf $(DESTDIR)$(DEFAULT_CFG_DIR)/backlight.conf.default
install -Dm0644 files/backlight.service $(DESTDIR)$(SRV_PATH)/kbd-backlight.service
groupadd $(GROUP)

-systemctl daemon-reload
-systemctl enable kbd-backlight
-systemctl start kbd-backlight
groupadd -r $(GROUP)

.PHONY: uninstall
uninstall:
-rm $(DESTDIR)/usr/local/bin/$(TARGET)
-systemctl stop kbd-backlight
-systemctl disable kbd-backlight

-rm $(DESTDIR)/usr/local/bin/$(TARGET)
-rm $(DESTDIR)$(SRV_PATH)/kbd-backlight.service

-rm -rf $(DESTDIR)$(CFG_DIR)
-rm -rf $(DESTDIR)$(DEFAULT_CFG_DIR)

-systemctl daemon-reload
-rm -drf $(DESTDIR)$(CFG_DIR)
-groupdel $(GROUP)

.PHONY: test
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ Usage: kbd-backlight [profile name] {config file}

Each user, who is in the `kbd-backlight` group, can now have their own personal config file with their own custom profiles. This config file must be manually created by the user with this command:
```bash
$ cp /etc/kbd-backlight/backlight.conf ~/.config/kbd-backlight.conf
$ cp /usr/share/kbd-backlight/backlight.conf.default ~/.config/kbd-backlight.conf
```
The executable will automagically detect whether the user has their own config and load that instead of the system-wide one

0 comments on commit f44a5de

Please sign in to comment.