Estou tentando carregar um novo layout de teclado quando conecto um teclado USB, mas minha regra do udev não está funcionando.
SUBSISTEMA == "entrada", ATTR {idVendor} == "062a", ATTR {idProduct} == "0201", GOTO = "usb_xmodmap_auto" LABEL = "usb_xmodmap_auto" AÇÃO == "adicionar", EXECUTAR + = "/ usr / bin / xmodmap ~ / .usbXmodmap" AÇÃO == "remover", EXECUTAR + = "/ usr / bin / xmodmap ~ / .pndXmodmap"
Eu recarreguei as regras usando:
> sudo udevadm control --reload-rules
e reiniciando o sistema, mas quando eu conecto o teclado usb, o xmodmap original ainda está carregado e, portanto, o layout do teclado está errado, mas se eu executar o comando no terminal
> / usr / bin / xmodmap ~ / .usbXmodmapou
> / usr / bin / xmodmap ~ / .pndXmodmap
eles funcionam muito bem.
espero que alguém possa ajudar.
Editar:
só para ajudar mais, executei alguns testes udevadm:
> udevadm test --action = add /devices/platform/ehci-omap.0/usb1/1-2/1-2.3/1-2.3:1.1/input/input10
saídas:
run_command: chamando: test udevadm_test: versão 151 Este programa é apenas para depuração, não executa nenhum programa, especificado por uma chave RUN. Pode mostrar resultados incorretos, porque alguns valores podem ser diferentes ou não estar disponíveis em uma simulação. [...] parse_file: lendo '/etc/udev/rules.d/usb-keyboard.rules' como arquivo de regras udev_rules_new: as regras usam tokens de 100572 bytes (8381 * 12 bytes), buffer de 21523 bytes udev_rules_new: índice temporário usado 35380 bytes (1769 * 20 bytes) udev_device_new_from_syspath: o dispositivo 0x3b4d8 possui devpath '/devices/platform/ehci-omap.0/usb1/1-2/1-2.3/1-2.3:1.1/input/input10' udev_rules_apply_to_event: EXECUTAR '/ sbin / modprobe -b $ env {MODALIAS}' /etc/udev/rules.d/80-drivers.rules:5 udev_rules_apply_to_event: soquete RUN ': @ / org / freedesktop / hal / udev_event' /etc/udev/rules.d/90-hal.rules:2 udev_rules_apply_to_event: EXECUTAR '/ sbin / modprobe $ env {MODALIAS}' /etc/udev/rules.d/local.rules:31 udev_rules_apply_to_event: RUN 'socket: / org / kernel / udev / monitor' /etc/udev/rules.d/run.rules:2 udev_rules_apply_to_event: EXECUTAR '/ usr / bin / xmodmap ~ / .usbXmodmap' /etc/udev/rules.d/usb-keyboard.rules:4 udevadm_test: UDEV_LOG = 6 udevadm_test: DEVPATH = / devices / platform / ehci-omap.0 / usb1 / 1-2 / 1-2.3 / 1-2.3: 1.1 / input / input10 udevadm_test: PRODUCT = 3 / 62a / 201/110 udevadm_test: NAME = "Teclado compatível com USB" udevadm_test: PHYS = "usb-ehci-omap.0-2.3 / input1" udevadm_test: UNIQ = "" udevadm_test: EV == 1f udevadm_test: KEY == 837fff 2c3027 bf004444 0 0 1fe3 c04 a27c000 267bfa d941dfed 9e0000 0 0 0 udevadm_test: REL == 143 udevadm_test: ABS == 1 0 udevadm_test: MSC == 10 udevadm_test: MODALIAS = entrada: b0003v062Ap0201e0110-e0,1,2,3,4, k71,72,73,74,77,80,82,83,85,86,87,88,89,8A, 8B, 8C, 8E, 8F, 90,96,98,9B, 9C, 9E, 9F, A1, A3, A4, A5, A6, A7, A8, A9, AB, AC, AD, AE, B1, B2, B5, CE, CF, D0, D1, D2, D5, D9, DB, E2, EA, EB, 100,101,105,106,107,108,109,10A, 10B, 10C, 162,166,16A, 16E, 178,179,17A, 17B, 17C, 17D, 17F, 180,181,182,185,18C, 18D, 192,193,195,1A0,1A1,1A2,1A3,1A4,1A5,1A6,1A7,1A8,1A9,1AA, 1AB, 1AC, 1AD, 1AE, 1B0,1B1,1B7, r0,1,6,8, a20, m4, lsfw udevadm_test: ACTION = add udevadm_test: SUBSYSTEM = entrada udevadm_test: run: '/ sbin / modprobe -b input: b0003v062Ap0201e0110-e0,1,2,3,4, k71,72,73,74,77,80,82,83,85,86,87,88,89 , 8A, 8B, 8C, 8E, 8F, 90,96,98,9B, 9C, 9E, 9F, A1, A3, A4, A5, A6, A7, A8, A9, AB, AC, AD, AE, B1 , B2, B5, CE, CF, D0, D1, D2, D5, D9, DB, E2, EA, EB, 100,101,105,106,107,108,109,10A, 10B, 10C, 162,166,16A, 16E, 178,179,17A, 17B, 17C, 17D , 17F, 180,181,182,185,18C, 18D, 192,193,195,1A0,1A1,1A2,1A3,1A4,1A5,1A6,1A7,1A8,1A9,1AA, 1AB, 1AC, 1AD, 1AE, 1B0,1B1,1B7, r0,1 , 6,8, a20, m4, lsfw » udevadm_test: run: 'socket: @ / org / freedesktop / hal / udev_event' udevadm_test: run: '/ sbin / modprobe input: b0003v062Ap0201e0110-e0,1,2,3,4, k71,72,73,74,77,80,82,83,85,86,87,88,8A , 8B, 8C, 8E, 8F, 90,96,98,9B, 9C, 9E, 9F, A1, A3, A4, A5, A6, A7, A8, A9, AB, AC, AD, AE, B1, B2 , B5, CE, CF, D0, D1, D2, D5, D9, DB, E2, EA, EB, 100.101.105.106.107.108.109,10A, 10B, 10C, 162.166,16A, 16E, 178.179,17A, 17B, 17C, 17D, 17F , 180,181,182,185,18C, 18D, 192,193,195,1A0,1A1,1A2,1A3,1A4,1A5,1A6,1A7,1A8,1A9,1AA, 1AB, 1AC, 1AD, 1AE, 1B0,1B1,1B7, r0,1,6 , 8, a20, m4, lsfw ' udevadm_test: run: 'socket: / org / kernel / udev / monitor' udevadm_test: execute: '/ usr / bin / xmodmap ~ / .usbXmodmap'
e
> udevadm test --action = remove /devices/platform/ehci-omap.0/usb1/1-2/1-2.3/1-2.3:1.1/input/input10
saídas:
run_command: chamando: test udevadm_test: versão 151 Este programa é apenas para depuração, não executa nenhum programa, especificado por uma chave RUN. Pode mostrar resultados incorretos, porque alguns valores podem ser diferentes ou não estar disponíveis em uma simulação. [...] parse_file: lendo '/etc/udev/rules.d/usb-keyboard.rules' como arquivo de regras udev_rules_new: as regras usam tokens de 100572 bytes (8381 * 12 bytes), buffer de 21523 bytes udev_rules_new: índice temporário usado 35380 bytes (1769 * 20 bytes) udev_device_new_from_syspath: o dispositivo 0x3b4d8 possui devpath '/devices/platform/ehci-omap.0/usb1/1-2/1-2.3/1-2.3:1.1/input/input10' udev_rules_apply_to_event: soquete RUN ': @ / org / freedesktop / hal / udev_event' /etc/udev/rules.d/90-hal.rules:2 udev_rules_apply_to_event: RUN 'socket: / org / kernel / udev / monitor' /etc/udev/rules.d/run.rules:2 udev_rules_apply_to_event: EXECUTAR '/ usr / bin / xmodmap ~ / .pndXmodmap' /etc/udev/rules.d/usb-keyboard.rules:5 udevadm_test: UDEV_LOG = 6 udevadm_test: DEVPATH = / devices / platform / ehci-omap.0 / usb1 / 1-2 / 1-2.3 / 1-2.3: 1.1 / input / input10 udevadm_test: PRODUCT = 3 / 62a / 201/110 udevadm_test: NAME = "Teclado compatível com USB" udevadm_test: PHYS = "usb-ehci-omap.0-2.3 / input1" udevadm_test: UNIQ = "" udevadm_test: EV == 1f udevadm_test: KEY == 837fff 2c3027 bf004444 0 0 1fe3 c04 a27c000 267bfa d941dfed 9e0000 0 0 0 udevadm_test: REL == 143 udevadm_test: ABS == 1 0 udevadm_test: MSC == 10 udevadm_test: MODALIAS = entrada: b0003v062Ap0201e0110-e0,1,2,3,4, k71,72,73,74,77,80,82,83,85,86,87,88,89,8A, 8B, 8C, 8E, 8F, 90,96,98,9B, 9C, 9E, 9F, A1, A3, A4, A5, A6, A7, A8, A9, AB, AC, AD, AE, B1, B2, B5, CE, CF, D0, D1, D2, D5, D9, DB, E2, EA, EB, 100,101,105,106,107,108,109,10A, 10B, 10C, 162,166,16A, 16E, 178,179,17A, 17B, 17C, 17D, 17F, 180,181,182,185,18C, 18D, 192,193,195,1A0,1A1,1A2,1A3,1A4,1A5,1A6,1A7,1A8,1A9,1AA, 1AB, 1AC, 1AD, 1AE, 1B0,1B1,1B7, r0,1,6,8, a20, m4, lsfw udevadm_test: ACTION = remover udevadm_test: SUBSYSTEM = entrada udevadm_test: run: 'socket: @ / org / freedesktop / hal / udev_event' udevadm_test: run: 'socket: / org / kernel / udev / monitor' udevadm_test: execute: '/ usr / bin / xmodmap ~ / .pndXmodmap'
o que parece mostrar que deve funcionar, mas não espera que isso ajude a obter uma resposta.