systemd optional in postinst

This commit is contained in:
sezanzeb 2020-12-25 15:00:57 +01:00
parent 6326c59d03
commit 0f30f5ae78
3 changed files with 8 additions and 6 deletions

View File

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

View File

@ -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:

View 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"
```