Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assist building and "installing" as non-root. #522

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,18 @@ man:
scdoc < "$$f" | gzip > "$$target"; \
done
install:
@if [ -e $(DESTDIR)$(PREFIX)/lib/systemd/ ]; then \
# First check if DESTDIR already has the systemd
# directory. Then if it exists under the system's base
# PREFIX (e.g. /usr/local), and finally check the
# standard systemd location in /usr.

@if [ -e $(DESTDIR)$(PREFIX)/lib/systemd/ -o \
-e ${PREFIX}/lib/systemd/ -o \
-e /usr/lib/systemd ]; \
then \
install -Dm644 keyd.service $(DESTDIR)$(PREFIX)/lib/systemd/system/keyd.service; \
else \
echo "NOTE: systemd not found, you will need to manually add keyd to your system's init process."; \
@echo "$$(tput bold)$$(tput setaf 1)warning: systemd not found, you will need to manually add keyd to your system's init process.$$(tput sgr0)"; \
fi

@if [ "$(VKBD)" = "usb-gadget" ]; then \
Expand All @@ -66,7 +74,11 @@ install:
mkdir -p $(DESTDIR)$(PREFIX)/share/doc/keyd/
mkdir -p $(DESTDIR)$(PREFIX)/share/doc/keyd/examples/

ifeq ($(shell id -u), 0)
-groupadd keyd
else
@echo "$$(tput bold)$$(tput setaf 1)warning: Use 'groupadd keyd' or your distribution's equivalent as root to add the access group.$$(tput sgr0)"
endif
install -m755 bin/* $(DESTDIR)$(PREFIX)/bin/
install -m644 docs/*.md $(DESTDIR)$(PREFIX)/share/doc/keyd/
install -m644 examples/* $(DESTDIR)$(PREFIX)/share/doc/keyd/examples/
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using kernel level input primitives (evdev, uinput).

The config format has undergone several iterations since the first
release. For those migrating their configs from v1 it is best
to reread the man page.
to reread the man page.

See also: [changelog](docs/CHANGELOG.md).

Expand Down Expand Up @@ -77,7 +77,9 @@ between releases. Releases are [tagged](https://github.com/rvaiya/keyd/tags), an
git clone https://github.com/rvaiya/keyd
cd keyd
make && sudo make install
sudo systemctl enable keyd && sudo systemctl start keyd
sudo systemctl daemon-reload && sudo systemctl enable keyd && sudo systemctl start keyd

**Note:** This can be built without root as a user and installed into `/usr/local` by an administrator. The caveat is that the admin should add the system-level `keyd` group in whateverx manner appropriate.

# Quickstart

Expand Down Expand Up @@ -142,7 +144,7 @@ E.G

`keyd-application-mapper`

You will probably want to put `keyd-application-mapper -d` somewhere in your
You will probably want to put `keyd-application-mapper -d` somewhere in your
display server initialization logic (e.g ~/.xinitrc) unless you are running Gnome.

See the man page for more details.
Expand Down Expand Up @@ -173,7 +175,7 @@ members, no personal responsibility is taken for them.
[ids]

*

[main]

leftshift = oneshot(shift)
Expand Down