tech:notes_systemd_udev
Ceci est une ancienne révision du document !
Table des matières
Notes Systemd udev
Source https://askubuntu.com/questions/25071/how-to-run-a-script-when-a-specific-flash-drive-is-mounted
Voir :
Exemples :
lsusb
0a81:0101
- /etc/udev/rules.d/100-mount-videos.rules
ACTION=="add", ATTRS{idVendor}=="0a81", ATTRS{idProduct}=="0101", RUN+="/home/your_username/bin/mount_videos.sh"
Exemple :
lsusb |grep -i touch Bus 001 Device 009: ID 04e7:00c0 Elo TouchSystems
- etc/udev/rules.d/100-touchscreen-calibr.rules
ACTION=="add", ATTRS{idVendor}=="04e7", ATTRS{idProduct}=="00c0", RUN+="/bin/bash -c 'echo /usr/local/bin/touchscreencfg.sh |at now'"
Je ruse en uilisant at car l'appel directe au script ne fonctionne pas ( le xinput list ne fionctione pas)
- /usr/local/bin/touchscreencfg.sh
#! /bin/bash export DISPLAY=:0 NAME=$(xinput list --name-only |grep -i touch | grep -iv ' pen') ID=$(xinput list --id-only "$NAME") SCREEN=$(xrandr 2>&1 |grep ' connected primary' |awk '{print $1}') /usr/bin/xinput --map-to-output $ID $SCREEN ( sleep 5 ; /usr/bin/xinput --map-to-output $ID $SCREEN ) &
Pb
Pb 1
Pb xinput --list avec udev
Voir :
Solution
Utiliser at
tech/notes_systemd_udev.1761111060.txt.gz · Dernière modification : de Jean-Baptiste
