Skip to content

Commit

Permalink
Merge pull request #10 from gnidorah/master
Browse files Browse the repository at this point in the history
Use makefile
  • Loading branch information
jergusg authored Mar 5, 2020
2 parents f56f20c + 48052ab commit a6931f0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CC = gcc
PREFIX = /usr/local
BINDIR = $(DESTDIR)$(PREFIX)/bin
UDEVDIR = $(DESTDIR)/etc/udev/rules.d

all: k380_conf

k380_conf:
$(CC) k380_conf.c -o k380_conf

reload:
udevadm control --reload

install: k380_conf
install -d $(BINDIR)
install k380_conf fn_on.sh $(BINDIR)
install -d $(UDEVDIR)
echo "ACTION==\"add\", KERNEL==\"hidraw[0-9]*\", RUN+=\"$(BINDIR)/fn_on.sh /dev/%k\"" > $(UDEVDIR)/80-k380.rules

clean:
rm k380_conf
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,28 @@ Make function keys default on Logitech k380 bluetooth keyboard.

## Instructions

1) First install `gcc`. On Ubuntu run:
1) First install `gcc` and `make`. On Ubuntu run:
```
sudo apt install gcc
sudo apt install gcc make
```
2) Download installation files https://github.com/jergusg/k380-function-keys-conf/releases/ (Source code).

This comment has been minimized.

Copy link
@toml01

toml01 Mar 15, 2020

You should create another release or change this line, since the release doesn't include the Makefile currently.
Thanks!


3) Connect your K380 keyboard via bluetooth to your computer.

4) Run `build.sh`

```
./build.sh
```
4) Run `make install`

5) To switch keyboard's upper keys to F-keys run:

```
sudo ./k380_conf -d /dev/hidrawX -f on
sudo k380_conf -d /dev/hidrawX -f on
```
Where X is number of your keyboard hidraw interface. Possibly `0, 1, 2, 3`.

### Switch keys to F-keys automatically

Follow instructions your received when you built `k380_conf`:
After install do the following:
```
sudo cp /your-build-path/80-k380.rules /etc/udev/rules.d/ && sudo udevadm control --reload
sudo make reload
```
Now, when you reconnect your keyboard it will be automatically switched to F-keys mode.

Expand Down
14 changes: 0 additions & 14 deletions build.sh

This file was deleted.

0 comments on commit a6931f0

Please sign in to comment.