summarylogtreecommitdiffstats
path: root/sd-unl0kr
blob: e6be296cfe9923f0635903a002613db6771c0517 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/bash

build() {
    add_checked_modules '/input/touchscreen/'

    add_systemd_unit 'unl0kr-agent.service'
    add_systemd_unit 'unl0kr-agent.path'

    add_symlink '/usr/lib/systemd/system/sysinit.target.wants/unl0kr-agent.path' '/usr/lib/systemd/system/unl0kr-agent.path'

    printf '%s\n' \
        '[Unit]' \
        'Conflicts=systemd-ask-password-console.path' \
        'After=systemd-ask-password-console.path' \
    | add_systemd_drop_in 'unl0kr-agent.path' 'mkinitcpio'

    add_binary '/usr/bin/unl0kr'
    add_file '/etc/unl0kr.conf'

    add_file '/usr/lib/udev/hwdb.bin'
    add_binary '/usr/lib/udev/libinput-device-group'
    add_binary '/usr/lib/udev/libinput-fuzz-extract'
    add_binary '/usr/lib/udev/libinput-fuzz-to-zero'
    map add_udev_rule \
        '60-evdev.rules' \
        '60-input-id.rules' \
        '65-libwacom.rules' \
        '70-mouse.rules' \
        '70-touchpad.rules' \
        '80-libinput-device-groups.rules' \
        '90-libinput-fuzz-override.rules'

    add_full_dir '/usr/share/libinput'
    add_full_dir '/usr/share/X11/xkb'
}

help() {
    cat <<HELPEOF
This hook installs a systemd password agent [1] based on unl0kr. This allows to enter passwords for encrypted volumes or tokens with an on-screen keyboard.

[1] https://systemd.io/PASSWORD_AGENTS
HELPEOF
}