systemd optional in postinst

pull/14/head
sezanzeb 4 years ago
parent 6326c59d03
commit 0f30f5ae78

@ -1,4 +1,6 @@
#!/bin/bash
systemctl enable key-mapper
systemctl stop key-mapper
systemctl start key-mapper
if [ -d "/run/systemd/system/" ]; then
systemctl enable key-mapper
systemctl stop key-mapper
systemctl start key-mapper
fi

@ -82,7 +82,7 @@ class SystemMapping:
if USER != 'root':
# write this stuff into the key-mapper config directory, because
# the systemd service needs to know the xmodmap list on boot.
# the systemd service won't know the user sessions xmodmap
path = get_config_path(XMODMAP_FILENAME)
touch(path)
with open(path, 'w') as file:

@ -91,7 +91,7 @@ an example autoload entry:
```
`preset name` refers to `~/.config/key-mapper/presets/device name/preset name.json`.
The device name can be found with `evtest`.
The device name can be found with `sudo key-mapper-control --list-devices`.
Anything that is relevant to presets can be overwritten in them as well.
Here is an example configuration for preset "a" for the "gamepad" device:
@ -130,7 +130,7 @@ running (or without sudo if your user has the appropriate permissions).
```bash
key-mapper-control --command autoload
key-mapper-control --list-devices
sudo key-mapper-control --list-devices
key-mapper-control --command stop --device "Razer Razer Naga Trinity"
key-mapper-control --command start --device "Razer Razer Naga Trinity" --preset "~/.config/key-mapper/presets/gamepad/a.json"
```

Loading…
Cancel
Save