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

Add Initial setup instructions to README.md #311

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,61 @@ This project requires a C++14 compiler, `cmake`, `libevdev`, `libudev`, and `lib

**openSUSE:** `sudo zypper install cmake libevdev-devel systemd-devel libconfig-devel gcc-c++ libconfig++-devel libudev-devel`

## Initial setup

A critical item is to determine the name your device reports to the computer
which will placed in the [name field](https://github.com/pixlone/logiops/wiki/configuration#name)
of the configuration file.

[Build](#building) `logid` and from the repository root run it (use `Ctrl+C` to stop `logid`).
You should see something like the following:
```
$ sudo ./build/logid
[ERROR] I/O Error while reading /etc/logid.cfg: FileIOException
[INFO] Device MX Anywhere 3 not configured, using default config.
[INFO] Device found: MX Anywhere 3 on /dev/hidraw3:255
^C
```

Next, create a configuration file that contains the name, `MX Anywhere 3`, of the
device determined from executing `logid` above. A starting point is [logid.example.cfg](./logid.example.cfg),
located in the root of the repo. And copy it to `/etc/logid.cfg`, the default configuration location:
```
sudo cp ./logid.example.cfg /etc/logid.cfg
```

Now edit `/etc/logid.cfg` referring to the
[Configuration section of the wiki](https://github.com/pixlone/logiops/wiki/configuration)
for details. At a minimum change the name field to match above.
Such `name: "MX Anywhere 3"`, here is the diff:
```
$ diff -u1 logid.example.cfg /etc/logid.cfg
--- logid.example.cfg 2022-04-26 10:41:59.650418368 -0700
+++ /etc/logid.cfg 2022-04-26 10:47:49.033924388 -0700
@@ -4,3 +4,3 @@
# https://github.com/PixlOne/logiops/wiki/Configuration#name
- name: "Wireless Mouse MX Master";
+ name: "MX Anywhere 3";
smartshift:
```

Next verify that your configuration is used. Run `logid` again
and this time you should **not have** `[ERROR] I/O Error while reading /etc/logid.cfg: FileIOException`.
And instead should it look something like:
```
$ sudo ./build/logid
[INFO] Device found: MX Anywhere 3 on /dev/hidraw3:255
[WARN] /dev/hidraw3:255: SmartShift feature not found, cannot use ToggleSmartShift action.
[WARN] MX Anywhere 3: CID 0xc3 does not exist.
^C
```

The two `[WARN]` lines indicate tweaks maybe needed to your
[configuration file](https://github.com/pixlone/logiops/wiki/configuration).


Now [install](#install) `logid` and use `systemctl` so it runs as a daemon.

## Building

To build this project, run:
Expand All @@ -38,6 +93,8 @@ cmake ..
make
```

## Install

To install, run `sudo make install` after building. You can set the daemon to start at boot by running `sudo systemctl enable logid` or `sudo systemctl enable --now logid` if you want to enable and start the daemon.

## Donate
Expand Down
4 changes: 3 additions & 1 deletion logid.example.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
devices: (
{
# This must match the name of your device, see:
# https://github.com/PixlOne/logiops/wiki/Configuration#name
name: "Wireless Mouse MX Master";
smartshift:
{
Expand Down Expand Up @@ -73,4 +75,4 @@ devices: (
}
);
}
);
);