summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2011-12-18 20:57:14 +0000
committerColin Guthrie <colin@mageia.org>2011-12-18 20:57:14 +0000
commitda4293191914420d37335ab26949161781311318 (patch)
tree249a99b2e9bce31ee8532de81d7edecd4f40c746 /lib
parentcdd8b06159872ecebab28d0b66c3ff51293e57b6 (diff)
downloaddrakx-kbd-mouse-x11-da4293191914420d37335ab26949161781311318.tar
drakx-kbd-mouse-x11-da4293191914420d37335ab26949161781311318.tar.gz
drakx-kbd-mouse-x11-da4293191914420d37335ab26949161781311318.tar.bz2
drakx-kbd-mouse-x11-da4293191914420d37335ab26949161781311318.tar.xz
drakx-kbd-mouse-x11-da4293191914420d37335ab26949161781311318.zip
Convert mouse helper to use udevadm in order to work with udev 175+
Diffstat (limited to 'lib')
-rw-r--r--lib/mouse.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/mouse.pm b/lib/mouse.pm
index 307a5b3..11cb30f 100644
--- a/lib/mouse.pm
+++ b/lib/mouse.pm
@@ -193,8 +193,14 @@ sub write {
sub _input_entry_to_device_by_id {
my ($input) = @_;
- my $ID_SERIAL = chomp_(run_program::get_stdout('usb_id', $input->{sysfs_path}));
- $ID_SERIAL =~ s/[^\w#+\-.:=@_]/_/g; #- udev do a further cleanup, eg: "Wacom_Co.,Ltd._MTE-450" => "Wacom_Co._Ltd._MTE-450". cf ALLOWED_CHARS udev.h
+ my $ID_SERIAL = "";
+ for (split /^/, run_program::get_stdout('udevadm', 'info', '--query', 'env', '--path', $input->{sysfs_path})) {
+ if (/^ID_SERIAL=(.*)/) {
+ $ID_SERIAL = $1;
+ $ID_SERIAL =~ s/[^\w#+\-.:=@_]/_/g; #- udev do a further cleanup, eg: "Wacom_Co.,Ltd._MTE-450" => "Wacom_Co._Ltd._MTE-450". cf ALLOWED_CHARS udev.h
+ break;
+ }
+ }
my $sysfs_device = "input/by-id/usb-$ID_SERIAL-event-mouse"; #- from /etc/udev/rules.d/60-persistent-input.rules
if ($::isInstall || -e "/dev/$sysfs_device") {
$sysfs_device;