Linux Hotplug development
 help / color / mirror / Atom feed
* Re: manually generate event, possible ?
From: Martin Pitt @ 2010-11-02 13:20 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <201011020649.oA26n1vk004765@dcnode-02.unlimitedmail.net>

Hello,

J. Bakshi [2010-11-02 16:13 +0530]:
> udevadm trigger --verbose  --sysname-match=/sys/class/input/input11  action­d

Try --sysname-match=input11. Also, it's "--action", not "action".
Also, you really don't want "add", use "change" (which is the default
now).

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

^ permalink raw reply

* Re: manually generate event, possible ?
From: Martin Pitt @ 2010-11-02 13:21 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <201011020649.oA26n1vk004765@dcnode-02.unlimitedmail.net>

J. Bakshi [2010-11-02 16:52 +0530]:
> udevadm trigger --verbose  /dev/sdc

trigger doesn't take non-option arguments. Use --sysname-match=sdc.

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

^ permalink raw reply

* Re: can we print the attr{} also ?
From: Martin Pitt @ 2010-11-02 13:25 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <201011021218.oA2CIaXR000974@dcnode-01.unlimitedmail.net>

Hello,

J. Bakshi [2010-11-02 17:49 +0530]:
> Can I send these information through notify-send ? I have already
> tried with [  notify-send %d-%k-$attr{ID_VENDOR} ] and the
> $attr{ID_VENDOR} is blank.  

ID_VENDOR is an udev propery, not a sysfs attribute. Try
$env{ID_VENDOR} instead.

> I have also tried with "udevadm  info -a -p  /sys/block/sdc" and foound
> 
> `````````````````
>  ATTRS{vendor}="JetFlash"
>  ATTRS{model}="Transcend 8GB
> ```````````````````````
> 
> using these as $attr{vendor} also has no effect. 

Presumably the vendor attribute is not on the parent node that you
matched with KERNELS, SUBSYSTEMS, DRIVERS, or ATTRS test? (see man
udev).

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

^ permalink raw reply

* Re: manually generate event, possible ?
From: J. Bakshi @ 2010-11-02 15:47 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <201011020649.oA26n1vk004765@dcnode-02.unlimitedmail.net>

On Tue, 2 Nov 2010 09:21:43 -0400
Martin Pitt <martin.pitt@ubuntu.com> wrote:

> J. Bakshi [2010-11-02 16:52 +0530]:
> > udevadm trigger --verbose  /dev/sdc
> 
> trigger doesn't take non-option arguments. Use --sysname-match=sdc.
> 
> Martin

Hello Martin,

Thank for your kind suggestion. This time I get some success at-least. I have get the following

`````````````````````
udevadm trigger --verbose --action=remove --sysname-match=sdc
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host9/target9:0:0/9:0:0:0/block/sdc
`````````````````````````

But the udev-rules are not called. I have send-notify in both add and remove event. Though If I unplug it physically, the rules are fired successfully. --action=change has no effect too.

^ permalink raw reply

* Re: can we print the attr{} also ?
From: J. Bakshi @ 2010-11-02 15:51 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <201011021218.oA2CIaXR000974@dcnode-01.unlimitedmail.net>

On Tue, 2 Nov 2010 09:25:33 -0400
Martin Pitt <martin.pitt@ubuntu.com> wrote:

> Hello,
> 
> J. Bakshi [2010-11-02 17:49 +0530]:
> > Can I send these information through notify-send ? I have already
> > tried with [  notify-send %d-%k-$attr{ID_VENDOR} ] and the
> > $attr{ID_VENDOR} is blank.  
> 
> ID_VENDOR is an udev propery, not a sysfs attribute. Try
> $env{ID_VENDOR} instead.
> 

You are the hero. Now it is working !!
Many many thanks

^ permalink raw reply

* Re: problem executing command substitution from udev rules
From: Dan Nicholson @ 2010-11-03 13:17 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <201011020634.oA26Y57h004184@dcnode-01.unlimitedmail.net>

On Tue, Nov 2, 2010 at 4:50 AM, J. Bakshi <j.bakshi@unlimitedmail.org> wrote:
> On Tue, 2 Nov 2010 12:51:16 +0300
> Andrey Borzenkov <arvidjaar@gmail.com> wrote:
>
>> On Tue, Nov 2, 2010 at 9:34 AM, J. Bakshi <j.bakshi@unlimitedmail.org> wrote:
>> >  it works well.  But if I try to add command substitution ( with in back-qoutes ) to dynamically collect the user name , it stops working. The rule is like
>> >
>> > ```````````````
>> >  ACTION="add", SUBSYSTEM="input", ENV{ID_CLASS}="mouse", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority"  RUN+="/bin/su  `ps aux | grep startx | grep '/bin/sh' | awk '{print $1}'`  -c "DISPLAY=:0.0 notify-send "test"  "
>> >  ``````````````````````````
>> >
>>
>> I do not think udev is using shell to start external commands. You
>> will need to use something like
>>
>> RUN+="/bin/sh -c '...'"
>>
>> Quoting will quickly become unmanageable I am afraid :)
>
> Yes, I have tried with that but no success. I used
>
> RUN+="/bin/sh -c '/bin/su user1 -c 'DISPLAY=:0.0 notify-send test''"
>
> and no luck.

Why not just create a script that does what you want and have udev RUN
that? Otherwise, you'll need to work out escaping the multiple levels
of quotes with \.

--
Dan

^ permalink raw reply

* Re: problem executing command substitution from udev rules
From: J. Bakshi @ 2010-11-03 15:50 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <201011020634.oA26Y57h004184@dcnode-01.unlimitedmail.net>

On Wed, 3 Nov 2010 06:17:55 -0700
Dan Nicholson <dbn.lists@gmail.com> wrote:

> 
> Why not just create a script that does what you want and have udev RUN
> that? Otherwise, you'll need to work out escaping the multiple levels
> of quotes with \.
> 

Thank Dan, I have already made a script and call it from udev rule. Though I'll also give a try with "\"

^ permalink raw reply

* [PATCH 0/1] UDEV - Rename onboard network interfaces to lomN if the
From: Narendra_K @ 2010-11-03 16:52 UTC (permalink / raw)
  To: linux-hotplug; +Cc: netdev, Matt_Domsch, Jordan_Hargrave, Charles_Rose

Hello,

This patch adds support to udev's dynamic rule generation mechanism to
rename onboard network interfaces to lom1, lom2 etc if the user so
desires. (Please refer to this for more information -
http://marc.info/?l=linux-netdev&m\x128646170613973&w=3).

From: Narendra K <narendra_k@dell.com>
Subject: [PATCH] UDEV - Rename onboard network interfaces to lomN if the user so desires

This patch adds support to udev's dynamic rule generation mechanism to
rename onboard network interfaces to lom1, lom2 etc if the user so
desires. (Please refer to this for more information -
http://marc.info/?l=linux-netdev&m\x128646170613973&w=3).

It introduces a commad line parameter 'udevlom', which when passed
would rename onboard network interfaces to lomN. It would also generate
corresponding rules to make the names persistent across reboots.

With this patch, interface with firmware index=1 will be renamed to lom1,
index=2 will be rename to lom2 etc.(lom - Lan-On-Motherboard)

This patch is against Fedora 14 udev (version:161 release:4.fc14).
It requires the upstream commit 911e1c9b05a8e3559a7aa89083930700a0b9e7ee
for the firmware index to be available in sysfs.

With the patch applied, the network interfaces look like this on a
Dell PowerEdge R710 with four BCM5709 onboard NICs with firmware
indexes and four add-in interfaces.

[root@fedora-14-r710 ~]# ls /sys/class/net/
eth4  eth5  eth6  eth7  eth8  lo  lom1  lom2  lom3  lom4

/etc/udev/rules.d/70-persistent-net.rules would look like this -
[snippet attched]

SUBSYSTEM="net", ACTION="add", DRIVERS="?*", ATTR{address}="00:24:e8:2e:df:01", ATTR{dev_id}="0x0", ATTR{type}="1", ATTRS{index}="2", KERNEL="eth*", NAME="lom2"

SUBSYSTEM="net", ACTION="add", DRIVERS="?*", ATTR{address}="00:15:17:15:9b:eb", ATTR{dev_id}="0x0", ATTR{type}="1", KERNEL="eth*", NAME="eth4"

SUBSYSTEM="net", ACTION="add", DRIVERS="?*", ATTR{address}="00:24:e8:2e:df:05", ATTR{dev_id}="0x0", ATTR{type}="1", ATTRS{index}="4", KERNEL="eth*", NAME="lom4"

SUBSYSTEM="net", ACTION="add", DRIVERS="?*", ATTR{address}="00:24:e8:2e:df:03", ATTR{dev_id}="0x0", ATTR{type}="1", ATTRS{index}="3", KERNEL="eth*", NAME="lom3"

SUBSYSTEM="net", ACTION="add", DRIVERS="?*", ATTR{address}="00:24:e8:2e:de:ff", ATTR{dev_id}="0x0", ATTR{type}="1", ATTRS{index}="1", KERNEL="eth*", NAME="lom1"

Signed-off-by: Narendra K <narendra_k@dell.com>
---
 .../75-persistent-net-generator.rules              |    4 ++++
 extras/rule_generator/write_net_rules              |   15 ++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/extras/rule_generator/75-persistent-net-generator.rules b/extras/rule_generator/75-persistent-net-generator.rules
index 8119d0e..e138bd3 100644
--- a/extras/rule_generator/75-persistent-net-generator.rules
+++ b/extras/rule_generator/75-persistent-net-generator.rules
@@ -7,6 +7,7 @@
 #   MATCHID               bus_id used for the match
 #   MATCHDRV              driver name used for the match
 #   MATCHIFTYPE           interface type match
+#   MATCHINDEX            firmware index used for the match
 #   COMMENT               comment to add to the generated rule
 #   INTERFACE_NAME        requested name supplied by external tool
 #   INTERFACE_NEW         new interface name returned by rule writer
@@ -29,6 +30,9 @@ ENV{MATCHADDR}="$attr{address}"
 # match interface type
 ENV{MATCHIFTYPE}="$attr{type}"
 
+#read firmware index
+ATTRS{index}="?*", ENV{MATCHINDEX}="$attr{index}"
+
 # ignore KVM virtual interfaces
 ENV{MATCHADDR}="54:52:00:*", GOTO="persistent_net_generator_end"
 
diff --git a/extras/rule_generator/write_net_rules b/extras/rule_generator/write_net_rules
index 4379792..40aaa4b 100644
--- a/extras/rule_generator/write_net_rules
+++ b/extras/rule_generator/write_net_rules
@@ -11,6 +11,7 @@
 #   MATCHDEVID            dev_id used for the match
 #   MATCHDRV              driver name used for the match
 #   MATCHIFTYPE           interface type match
+#   MATCHINDEX            firmware index used for the match
 #   COMMENT               comment to add to the generated rule
 #   INTERFACE_NAME        requested name supplied by external tool
 #   INTERFACE_NEW         new interface name returned by rule writer
@@ -72,7 +73,11 @@ write_rule() {
 
 	echo ""
 	[ "$comment" ] && echo "# $comment"
-	echo "SUBSYSTEM=\"net\", ACTION=\"add\"$match, NAME=\"$name\""
+	if [ "$MATCHINDEX" -a "$UDEVLOM" ]; then
+        	echo "SUBSYSTEM=\"net\", ACTION=\"add\"$match, NAME=\"lom$MATCHINDEX\""
+	else
+		echo "SUBSYSTEM=\"net\", ACTION=\"add\"$match, NAME=\"$name\""
+	fi
 	} >> $RULES_FILE
 }
 
@@ -108,6 +113,10 @@ if [ "$MATCHIFTYPE" ]; then
 	match="$match, ATTR{type}=\"$MATCHIFTYPE\""
 fi
 
+if [ "$MATCHINDEX" -a "$UDEVLOM" ]; then
+	match="$match, ATTRS{index}=\"$MATCHINDEX\""
+fi
+
 if [ -z "$match" ]; then
 	echo "missing valid match" >&2
 	unlock_rules_file
@@ -134,6 +143,10 @@ else
 	fi
 fi
 
+if [ "$MATCHINDEX" -a "$UDEVLOM" ]; then
+	echo "INTERFACE_NEW=lom$MATCHINDEX"
+fi
+
 write_rule "$match" "$INTERFACE" "$COMMENT"
 
 unlock_rules_file
-- 
1.7.3.1

With regards,
Narendra K

^ permalink raw reply related

* [PATCH 1/1] UDEV - Add 'udevlom' command line param to start_udev
From: Narendra_K @ 2010-11-03 16:58 UTC (permalink / raw)
  To: linux-hotplug; +Cc: netdev, Matt_Domsch, Jordan_Hargrave, Charles_Rose

Hello,

This patch allows users to specify if they want the onboard network
interfaces to be renamed to lomN by implementing a command line param
'udevlom'.

From: Narendra K <narendra_k@dell.com>
Subject: [PATCH] UDEV - Add 'udevlom' command line param to start_udev

This patch implements 'udevlom' command line parameter, which
when passed, results in onboard network interfaces getting
renamed to lomN.

Signed-off-by: Narendra K <narendra_k@dell.com>
---
 start_udev |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/start_udev b/start_udev
index 49fc286..57d60c9 100755
--- a/start_udev
+++ b/start_udev
@@ -32,6 +32,7 @@ export TZ=/etc/localtime
 . /etc/init.d/functions
 
 prog=udev
+cmdline=`cat /proc/cmdline`
 
 touch_recursive() {
 	( cd $1;
@@ -60,6 +61,10 @@ fi
 
 ret=$[$ret + $?]
 
+if strstr "$cmdline" udevlom; then
+	/sbin/udevadm control --env=UDEVLOM="y"
+fi
+
 /sbin/udevadm trigger --type=subsystems --action≠d
 /sbin/udevadm trigger --typefivices --action≠d
 /sbin/udevadm settle
-- 
1.7.3.1

With regards,
Narendra K
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: manually generate event, possible ?
From: J. Bakshi @ 2010-11-03 17:47 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <201011020649.oA26n1vk004765@dcnode-02.unlimitedmail.net>

On Tue, 2 Nov 2010 21:05:14 +0530
"J. Bakshi" <j.bakshi@unlimitedmail.org> wrote:

> On Tue, 2 Nov 2010 09:21:43 -0400
> Martin Pitt <martin.pitt@ubuntu.com> wrote:
> 
> > J. Bakshi [2010-11-02 16:52 +0530]:
> > > udevadm trigger --verbose  /dev/sdc
> > 
> > trigger doesn't take non-option arguments. Use --sysname-match=sdc.
> > 
> > Martin
> 
> Hello Martin,
> 
> Thank for your kind suggestion. This time I get some success at-least. I have get the following
> 
> `````````````````````
> udevadm trigger --verbose --action=remove --sysname-match=sdc
> /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host9/target9:0:0/9:0:0:0/block/sdc
> `````````````````````````
> 
> But the udev-rules are not called. I have send-notify in both add and remove event. Though If I unplug it physically, the rules are fired successfully. --action=change has no effect too.


Any other alternative please ??
Thanks

^ permalink raw reply

* Re: [PATCH 1/1] UDEV - Add 'udevlom' command line param to
From: Greg KH @ 2010-11-03 18:05 UTC (permalink / raw)
  To: Narendra_K
  Cc: linux-hotplug, netdev, Matt_Domsch, Jordan_Hargrave, Charles_Rose
In-Reply-To: <20101103165505.GA3281@fedora-14-r710.oslab.blr.amer.dell.com>

On Wed, Nov 03, 2010 at 10:25:25PM +0530, Narendra_K@Dell.com wrote:
> Hello,
> 
> This patch allows users to specify if they want the onboard network
> interfaces to be renamed to lomN by implementing a command line param
> 'udevlom'.

Ick ick ick.

Why not do this in some other configuration file?  Don't rely on udev
being started with a different option, that is only ripe for abuse by
everyone else who wants their pet-project to get into the udev
environment.

Please, surely there's a different way to do this.

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH 1/1] UDEV - Add 'udevlom' command line param to
From: Marco d'Itri @ 2010-11-03 18:32 UTC (permalink / raw)
  To: Greg KH
  Cc: Narendra_K, linux-hotplug, netdev, Matt_Domsch, Jordan_Hargrave,
	Charles_Rose
In-Reply-To: <20101103180500.GA7441@kroah.com>

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

On Nov 03, Greg KH <greg@kroah.com> wrote:

> Why not do this in some other configuration file?  Don't rely on udev
> being started with a different option, that is only ripe for abuse by
> everyone else who wants their pet-project to get into the udev
> environment.
Agreed. What about instructing users/installers to add something like
this in /etc/udev/rules.d/00-something.rules?

KERNEL=="eth*", ENV{UDEVLOM}="1"

(Maybe with a more descriptive name than "UDEVLOM".)

-- 
ciao,
Marco

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply

* udev rules behaves opposite when executing startx
From: J. Bakshi @ 2010-11-04  4:49 UTC (permalink / raw)
  To: linux-hotplug


Hello list,

Here is my udev rules which disable touchpad when I plug my usb external mouse, and enable it again, when removing the mouse 

```````````````````
ACTION="add", SUBSYSTEM="input", ENV{ID_CLASS}="mouse", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority"  RUN+="/usr/bin/synclient TouchpadOff=1", RUN+="/bin/su user1 -c 'DISPLAY=:0.0 notify-send %k ' "

ACTION="remove", SUBSYSTEM="input", ENV{ID_CLASS}="mouse"  RUN+="/usr/bin/synclient TouchpadOff=0", RUN+="/bin/su user1 -c 'DISPLAY=:0.0 notify-send %k ' "
``````````````````````````````

The rules is running well within X. But only when I start my WM with startx , then the rules behaves opposite. With no mouse attached , the touchpad is still inactive. Though by pluging/unpluging the mouse, the rules start working normally. I don't understand why startx makes the rules behave so. Could anyone give me any clue please ? 

Thanks

^ permalink raw reply

* Re: [PATCH 1/1] UDEV - Add 'udevlom' command line param to start_udev
From: Sujit K M @ 2010-11-04  8:49 UTC (permalink / raw)
  To: Greg KH, Narendra_K, linux-hotplug, netdev, Matt_Domsch,
	Jordan_Hargrave, Charles_Rose
In-Reply-To: <20101103183247.GA28139@bongo.bofh.it>

> (Maybe with a more descriptive name than "UDEVLOM".)

What is different from the already used Name?

>
> --
> ciao,
> Marco
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAkzRqs8ACgkQFGfw2OHuP7EYEACZAeDc/phuXkT89y+bGtsYROYN
> Pw0An1Lti6pAyXjt/pjIj8L9h7V5hXTC
> =Keaz
> -----END PGP SIGNATURE-----
>
>



-- 
-- Sujit K M

blog(http://kmsujit.blogspot.com/)

^ permalink raw reply

* Re: udev rules behaves opposite when executing startx
From: J. Bakshi @ 2010-11-04  8:57 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <201011040436.oA44amxS002870@dcnode-01.unlimitedmail.net>

On Thu, 4 Nov 2010 10:07:41 +0530
"J. Bakshi" <j.bakshi@unlimitedmail.org> wrote:

> 
> Hello list,
> 
> Here is my udev rules which disable touchpad when I plug my usb external mouse, and enable it again, when removing the mouse 
> 
> ```````````````````
> ACTION="add", SUBSYSTEM="input", ENV{ID_CLASS}="mouse", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority"  RUN+="/usr/bin/synclient TouchpadOff=1", RUN+="/bin/su user1 -c 'DISPLAY=:0.0 notify-send %k ' "
> 
> ACTION="remove", SUBSYSTEM="input", ENV{ID_CLASS}="mouse"  RUN+="/usr/bin/synclient TouchpadOff=0", RUN+="/bin/su user1 -c 'DISPLAY=:0.0 notify-send %k ' "
> ``````````````````````````````
> 
> The rules is running well within X. But only when I start my WM with startx , then the rules behaves opposite. With no mouse attached , the touchpad is still inactive. Though by pluging/unpluging the mouse, the rules start working normally. I don't understand why startx makes the rules behave so. Could anyone give me any clue please ? 
> 
> Thanks
> --

I wonder, if there is any alternative to disable/enable the touchpad, irrespective of DISPLAY ( i.e. ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority" ). Hence the rules will work well whenever it detects the mouse, in X and in console.


^ permalink raw reply

* Touchpad toggle mess
From: Bastien Nocera @ 2010-11-05  0:00 UTC (permalink / raw)
  To: linux-input, linux-hotplug, xorg
  Cc: Peter Hutterer, Matthew Garrett, Martin Pitt

[-- Attachment #1: Type: text/plain, Size: 3118 bytes --]

Heya,

In GNOME 2.32, we added support for touchpad toggle buttons, by
capturing the XF86TouchpadToggle button in gnome-settings-daemon,
showing a nice popup, and disabling the touchpad in software.

That works great for a number of laptops, but completely breaks a number
of others where the hardware handles the request, but still sends a key
event (usually separate ones for on and off). In those cases, we'd need
2 more key types, in the kernel, and in X.org.

The patches in https://bugs.freedesktop.org/show_bug.cgi?id=31300
implement this for the kernel, and for X.org.

Then we have the problem that udev's keymaps seem to use different
function keys depending on the hardware [1], when X.org (because of the
limitations of XKB) standardised on F22 for "XF86TouchpadToggle".

So we'll need to standardise on the keys used. I selected F21 for
XF86TouchpadToggle, F22 for XF86TouchpadOn and F23 for XF86TouchpadOff.
See the patch in:
https://bugs.freedesktop.org/show_bug.cgi?id=31333

The remaining fixes would need to be in udev's keymaps, to set hardware
handled keys to F22 and F23, and software ones to F21. Patch is attached
for that.

Questions, comments?

[1]: F21, F22, or F23 then?
$ grep -ri touchpad extras/keymap/keymaps/
extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint:0x90017 f22 # Fn+F8  touchpadtoggle
extras/keymap/keymaps/zepto-znote:0xA5 f22                # Fn+F6 Disable Touchpad
extras/keymap/keymaps/zepto-znote:0xA6 f22                # Fn+F6 Enable Touchpad
extras/keymap/keymaps/hewlett-packard-pavilion:0xD8 f22 # touchpad off
extras/keymap/keymaps/hewlett-packard-pavilion:0xD9 f23 # touchpad on
extras/keymap/keymaps/dell:0x9E f22 #touchpad toggle
extras/keymap/keymaps/dell:0xD9 f22 # touchpad toggle
extras/keymap/keymaps/samsung-other:0xF7 f22 # Fn+F10 Touchpad on
extras/keymap/keymaps/samsung-other:0xF9 f22 # Fn+F10 Touchpad off
extras/keymap/keymaps/hewlett-packard-tx2:0xD8 f22 # Toggle touchpad button on tx2 (OFF)
extras/keymap/keymaps/hewlett-packard-tx2:0xD9 f22 # Toggle touchpad button on tx2 (ON)
extras/keymap/keymaps/everex-xt5000:0x65 f22 # Fn+F5 Touchpad toggle
extras/keymap/keymaps/samsung-sx20s:0x77 f21 # FIXME: Touchpad on
extras/keymap/keymaps/samsung-sx20s:0x79 f21 # FIXME: Touchpad off
extras/keymap/keymaps/onkyo:0xF7 f22 # Fn+Y (touchpad toggle)
extras/keymap/keymaps/toshiba-satellite_a110:0x9E f21 # FIXME: Touchpad on
extras/keymap/keymaps/toshiba-satellite_a110:0x9F f21 # FIXME: Touchpad off
extras/keymap/keymaps/toshiba-satellite_m30x:0x9e prog1 #touchpad_enable
extras/keymap/keymaps/toshiba-satellite_m30x:0x9f prog2 #touchpad_disable
extras/keymap/keymaps/acer:0xF1 f22 # Fn+F7 Touchpad toggle (off-to-on)
extras/keymap/keymaps/acer:0xF2 f22 # Fn+F7 Touchpad toggle (on-to-off)
extras/keymap/keymaps/micro-star:0xE4 f22 # Fn-F3   Touchpad disable
extras/keymap/keymaps/module-lenovo:0x7 f22 # Fn+F8 touchpadtoggle
extras/keymap/keymaps/lg-x110:0xE4 f22 # Fn-F5   Touchpad disable
extras/keymap/keymaps/hewlett-packard-2510p_2530p:0xD8 f22 # touchpad off
extras/keymap/keymaps/hewlett-packard-2510p_2530p:0xD9 f23 # touchpad on


[-- Attachment #2: 0001-extras-keymap-Fix-touchpad-toggle-buttons-used.patch --]
[-- Type: text/x-patch, Size: 8502 bytes --]

From 52118a82743e4ca65d5be01c304685d265b5f7a7 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 4 Nov 2010 23:58:56 +0000
Subject: [PATCH] extras/keymap: Fix touchpad toggle buttons used

See:
https://bugs.freedesktop.org/show_bug.cgi?id=31333
---
 extras/keymap/keymaps/acer                         |    2 +-
 extras/keymap/keymaps/dell                         |    4 ++--
 extras/keymap/keymaps/everex-xt5000                |    2 +-
 extras/keymap/keymaps/hewlett-packard-2510p_2530p  |    4 ++--
 extras/keymap/keymaps/hewlett-packard-pavilion     |    4 ++--
 extras/keymap/keymaps/hewlett-packard-tx2          |    2 +-
 .../lenovo-thinkpad-usb-keyboard-trackpoint        |    2 +-
 extras/keymap/keymaps/lg-x110                      |    4 ++--
 extras/keymap/keymaps/micro-star                   |    2 +-
 extras/keymap/keymaps/module-lenovo                |    2 +-
 extras/keymap/keymaps/onkyo                        |    2 +-
 extras/keymap/keymaps/samsung-other                |    2 +-
 extras/keymap/keymaps/samsung-sx20s                |    4 ++--
 extras/keymap/keymaps/toshiba-satellite_a110       |    4 ++--
 extras/keymap/keymaps/toshiba-satellite_m30x       |    4 ++--
 extras/keymap/keymaps/zepto-znote                  |    2 +-
 16 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/extras/keymap/keymaps/acer b/extras/keymap/keymaps/acer
index 6abe39c..4e7c297 100644
--- a/extras/keymap/keymaps/acer
+++ b/extras/keymap/keymaps/acer
@@ -14,7 +14,7 @@
 0xEE brightnessup # Fn+Right
 0xEF brightnessdown # Fn+Left
 0xF1 f22 # Fn+F7 Touchpad toggle (off-to-on)
-0xF2 f22 # Fn+F7 Touchpad toggle (on-to-off)
+0xF2 f23 # Fn+F7 Touchpad toggle (on-to-off)
 0xF3 prog2 # "P2" programmable button
 0xF4 prog1 # "P1" programmable button
 0xF5 presentation
diff --git a/extras/keymap/keymaps/dell b/extras/keymap/keymaps/dell
index 1a2e433..fbbb903 100644
--- a/extras/keymap/keymaps/dell
+++ b/extras/keymap/keymaps/dell
@@ -21,9 +21,9 @@
 0x99 nextsong # Front panel next song
 0x9A setup # Tablet tools button
 0x9B switchvideomode # Display Toggle button
-0x9E f22 #touchpad toggle
+0x9E f21 #touchpad toggle
 0xA2 playpause # Front panel play/pause
 0xA4 stopcd # Front panel stop
 0xED media # MediaDirect button
 0xD8 screenlock # FIXME: Tablet lock button
-0xD9 f22 # touchpad toggle
+0xD9 f21 # touchpad toggle
diff --git a/extras/keymap/keymaps/everex-xt5000 b/extras/keymap/keymaps/everex-xt5000
index 53bdd7a..4823a83 100644
--- a/extras/keymap/keymaps/everex-xt5000
+++ b/extras/keymap/keymaps/everex-xt5000
@@ -1,5 +1,5 @@
 0x5C media
-0x65 f22 # Fn+F5 Touchpad toggle
+0x65 f21 # Fn+F5 Touchpad toggle
 0x67 prog3 # Fan Speed Control button
 0x6F brightnessup
 0x7F brightnessdown
diff --git a/extras/keymap/keymaps/hewlett-packard-2510p_2530p b/extras/keymap/keymaps/hewlett-packard-2510p_2530p
index 2bc70c2..41ad2e9 100644
--- a/extras/keymap/keymaps/hewlett-packard-2510p_2530p
+++ b/extras/keymap/keymaps/hewlett-packard-2510p_2530p
@@ -1,2 +1,2 @@
-0xD8 f22 # touchpad off
-0xD9 f23 # touchpad on
+0xD8 f23 # touchpad off
+0xD9 f22 # touchpad on
diff --git a/extras/keymap/keymaps/hewlett-packard-pavilion b/extras/keymap/keymaps/hewlett-packard-pavilion
index a55d2b7..3d3cefc 100644
--- a/extras/keymap/keymaps/hewlett-packard-pavilion
+++ b/extras/keymap/keymaps/hewlett-packard-pavilion
@@ -1,3 +1,3 @@
 0x88 media # FIXME: quick play
-0xD8 f22 # touchpad off
-0xD9 f23 # touchpad on
+0xD8 f23 # touchpad off
+0xD9 f22 # touchpad on
diff --git a/extras/keymap/keymaps/hewlett-packard-tx2 b/extras/keymap/keymaps/hewlett-packard-tx2
index 206c004..36a690f 100644
--- a/extras/keymap/keymaps/hewlett-packard-tx2
+++ b/extras/keymap/keymaps/hewlett-packard-tx2
@@ -1,3 +1,3 @@
 0xC2 media
-0xD8 f22 # Toggle touchpad button on tx2 (OFF)
+0xD8 f23 # Toggle touchpad button on tx2 (OFF)
 0xD9 f22 # Toggle touchpad button on tx2 (ON)
diff --git a/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint b/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint
index 7612f79..bc91470 100644
--- a/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint
+++ b/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint
@@ -2,7 +2,7 @@
 0x90013 battery # Fn+F3
 0x90014 wlan # Fn+F5
 0x90016 switchvideomode # Fn+F7
-0x90017 f22 # Fn+F8  touchpadtoggle
+0x90017 f21 # Fn+F8  touchpadtoggle
 0x90019 suspend # Fn+F12
 0x9001A brightnessup # Fn+Home
 0x9001B brightnessdown # Fn+End
diff --git a/extras/keymap/keymaps/lg-x110 b/extras/keymap/keymaps/lg-x110
index a61cf3d..ba08cba 100644
--- a/extras/keymap/keymaps/lg-x110
+++ b/extras/keymap/keymaps/lg-x110
@@ -6,7 +6,7 @@
 0xB3 suspend # Fn-F12
 0xDF sleep # Fn-F4
 # 0xE2 bluetooth # satellite dish2
-0xE4 f22 # Fn-F5   Touchpad disable
+0xE4 f21 # Fn-F5   Touchpad disable
 0xF6 wlan # Fn-F6
 0xF7 reserved # brightnessdown # Fn-Down
-0xF8 reserved # brightnessup # Fn-Up
\ No newline at end of file
+0xF8 reserved # brightnessup # Fn-Up
diff --git a/extras/keymap/keymaps/micro-star b/extras/keymap/keymaps/micro-star
index 0de5ae6..4a43869 100644
--- a/extras/keymap/keymaps/micro-star
+++ b/extras/keymap/keymaps/micro-star
@@ -4,7 +4,7 @@
 0xB2 www # e button
 0xDF sleep # Fn-F12
 0xE2 bluetooth # satellite dish2
-0xE4 f22 # Fn-F3   Touchpad disable
+0xE4 f21 # Fn-F3   Touchpad disable
 0xEC email # envelope button
 0xEE camera # Fn-F6 camera disable
 0xF6 wlan # satellite dish1
diff --git a/extras/keymap/keymaps/module-lenovo b/extras/keymap/keymaps/module-lenovo
index 7c597bd..9cb74b2 100644
--- a/extras/keymap/keymaps/module-lenovo
+++ b/extras/keymap/keymaps/module-lenovo
@@ -3,7 +3,7 @@
 0x3 sleep # Fn+F4
 0x4 wlan # Fn+F5
 0x6 switchvideomode # Fn+F7
-0x7 f22 # Fn+F8 touchpadtoggle
+0x7 f21 # Fn+F8 touchpadtoggle
 0x8 f24 # Fn+F9 undock
 0xB suspend # Fn+F12
 0xF brightnessup # Fn+Home
diff --git a/extras/keymap/keymaps/onkyo b/extras/keymap/keymaps/onkyo
index 7dd80a1..ee864ad 100644
--- a/extras/keymap/keymaps/onkyo
+++ b/extras/keymap/keymaps/onkyo
@@ -8,7 +8,7 @@
 0xF0 media # Fn+R
 0xF5 switchvideomode # Fn+E
 0xF6 camera # Fn+T
-0xF7 f22 # Fn+Y (touchpad toggle)
+0xF7 f21 # Fn+Y (touchpad toggle)
 0xF8 brightnessup # Fn+S
 0xF9 brightnessdown # Fn+A
 0xFB wlan # Fn+J
diff --git a/extras/keymap/keymaps/samsung-other b/extras/keymap/keymaps/samsung-other
index 6a0928c..3ac0c2f 100644
--- a/extras/keymap/keymaps/samsung-other
+++ b/extras/keymap/keymaps/samsung-other
@@ -11,4 +11,4 @@
 0xB3 prog3 # Fn+F8 switch power mode (battery/dynamic/performance)
 0xB4 wlan # Fn+F9 (X60P)
 0xF7 f22 # Fn+F10 Touchpad on
-0xF9 f22 # Fn+F10 Touchpad off
+0xF9 f23 # Fn+F10 Touchpad off
diff --git a/extras/keymap/keymaps/samsung-sx20s b/extras/keymap/keymaps/samsung-sx20s
index daf7d3e..9d954ee 100644
--- a/extras/keymap/keymaps/samsung-sx20s
+++ b/extras/keymap/keymaps/samsung-sx20s
@@ -1,4 +1,4 @@
 0x74 mute
 0x75 mute
-0x77 f21 # FIXME: Touchpad on
-0x79 f21 # FIXME: Touchpad off
+0x77 f22 # Touchpad on
+0x79 f23 # Touchpad off
diff --git a/extras/keymap/keymaps/toshiba-satellite_a110 b/extras/keymap/keymaps/toshiba-satellite_a110
index 0f2aaec..1429409 100644
--- a/extras/keymap/keymaps/toshiba-satellite_a110
+++ b/extras/keymap/keymaps/toshiba-satellite_a110
@@ -1,8 +1,8 @@
 0x92 stop
 0x93 www
 0x94 media
-0x9E f21 # FIXME: Touchpad on
-0x9F f21 # FIXME: Touchpad off
+0x9E f22 # Touchpad on
+0x9F f23 # Touchpad off
 0xB9 nextsong
 0xD9 brightnessup
 0xEE screenlock
diff --git a/extras/keymap/keymaps/toshiba-satellite_m30x b/extras/keymap/keymaps/toshiba-satellite_m30x
index cf6d912..9280ae0 100644
--- a/extras/keymap/keymaps/toshiba-satellite_m30x
+++ b/extras/keymap/keymaps/toshiba-satellite_m30x
@@ -2,6 +2,6 @@
 0xd9 brightnessup
 0xee screenlock
 0x93 media
-0x9e prog1 #touchpad_enable
-0x9f prog2 #touchpad_disable
+0x9e f22 #touchpad_enable
+0x9f f23 #touchpad_disable
 
diff --git a/extras/keymap/keymaps/zepto-znote b/extras/keymap/keymaps/zepto-znote
index e076516..cf72fda 100644
--- a/extras/keymap/keymaps/zepto-znote
+++ b/extras/keymap/keymaps/zepto-znote
@@ -1,7 +1,7 @@
 0x93 switchvideomode    # Fn+F3 Toggle Video Output
 0x95 brightnessdown     # Fn+F4 Brightness Down
 0x91 brightnessup       # Fn+F5 Brightness Up
-0xA5 f22                # Fn+F6 Disable Touchpad
+0xA5 f23                # Fn+F6 Disable Touchpad
 0xA6 f22                # Fn+F6 Enable Touchpad
 0xA7 bluetooth          # Fn+F10 Enable Bluetooth
 0XA9 bluetooth          # Fn+F10 Disable Bluetooth
-- 
1.7.3.2


^ permalink raw reply related

* Re: Touchpad toggle mess
From: Dmitry Torokhov @ 2010-11-05  2:20 UTC (permalink / raw)
  To: Bastien Nocera
  Cc: linux-input, linux-hotplug, xorg, Peter Hutterer, Matthew Garrett,
	Martin Pitt
In-Reply-To: <1288915209.5418.72.camel@novo.hadess.net>

Hi Bastien,

On Fri, Nov 05, 2010 at 12:00:09AM +0000, Bastien Nocera wrote:
> Heya,
> 
> In GNOME 2.32, we added support for touchpad toggle buttons, by
> capturing the XF86TouchpadToggle button in gnome-settings-daemon,
> showing a nice popup, and disabling the touchpad in software.
> 
> That works great for a number of laptops, but completely breaks a number
> of others where the hardware handles the request, but still sends a key
> event (usually separate ones for on and off). In those cases, we'd need
> 2 more key types, in the kernel, and in X.org.

Rfkill story all over I guess ;(

> 
> The patches in https://bugs.freedesktop.org/show_bug.cgi?id1300
> implement this for the kernel, and for X.org.
> 
> Then we have the problem that udev's keymaps seem to use different
> function keys depending on the hardware [1], when X.org (because of the
> limitations of XKB) standardised on F22 for "XF86TouchpadToggle".
> 
> So we'll need to standardise on the keys used. I selected F21 for
> XF86TouchpadToggle, F22 for XF86TouchpadOn and F23 for XF86TouchpadOff.
> See the patch in:
> https://bugs.freedesktop.org/show_bug.cgi?id1333
> 
> The remaining fixes would need to be in udev's keymaps, to set hardware
> handled keys to F22 and F23, and software ones to F21. Patch is attached
> for that.
> 
> Questions, comments?

I still believe we need dedicated keycodes in kernel for that and make
sure that in-kernel maps use proper keycodes so that programs that do
not have the same limitations that X has could differentiate between
touchpad events and real F2* events. X can still continue to use f21, 22
and 23 (at least while it can't handle higher keycodes), and common
setups may rely on udev's facilities to remap the keys.

Thanks.

-- 
Dmitry

^ permalink raw reply

* Re: [PATCH 1/1] UDEV - Add 'udevlom' command line param to start_udev
From: Matt Domsch @ 2010-11-05  2:58 UTC (permalink / raw)
  To: Greg KH
  Cc: K, Narendra, linux-hotplug@vger.kernel.org,
	netdev@vger.kernel.org, Hargrave, Jordan, Rose, Charles
In-Reply-To: <20101103180500.GA7441@kroah.com>

On Wed, Nov 03, 2010 at 11:05:00AM -0700, Greg KH wrote:
> On Wed, Nov 03, 2010 at 10:25:25PM +0530, Narendra_K@Dell.com wrote:
> > Hello,
> > 
> > This patch allows users to specify if they want the onboard network
> > interfaces to be renamed to lomN by implementing a command line param
> > 'udevlom'.
> 
> Ick ick ick.
> 
> Why not do this in some other configuration file?  Don't rely on udev
> being started with a different option, that is only ripe for abuse by
> everyone else who wants their pet-project to get into the udev
> environment.
> 
> Please, surely there's a different way to do this.

At Linux Plumbers Conference today, this problem space was discussed
once again, and I believe concensus on approach was reached.  Here
goes:

* If a 70-persistent-net.rules file sets a name, honor that.  This
  preserves existing installs.

* If BIOS provides indexes for onboard devices, honor that.
** Rename onboard NICs "lom[1-N]" as BIOS reports (# matches chassis labels)
** No rename for all others "ethX" (no change for NICs in PCI slots/USB/others)

* If neither are true, do not rename at all.

* Implementation will be:
** Udev rules to be included in upstream udev will read the index
   value from sysfs (provided by SMBIOS 2.6 info on kernels >= 2.6.36,
   PCI DSM info at some future point) if present, and rename LOMs
   based on that index value.  Distros will use these rules by default
   (Ubuntu and Fedora maintainers on board with the concept; I have
   not spoken with other distros yet.)
** Legacy distros with older udev rules will invoke biosdevname on
   kernels < 2.6.36 to get the same information, if present, and will
   rename LOMs based on index value.

** Installers will use the above udev rules by default.  If there is
   outcry during the distros beta testing periods, a way to disable
   these renames may be implemented.

* NetworkManager to display BIOS-provided labels as informational text


As such, biosdevname will be packaged and included in Debian and
Ubuntu (thanks to Colin Watson) to facilitate use in the udev rules.
Colin also suggested that any string used in Fedora kickstart files to
enable/disable this feature will also be used to enable/disable this
feature in the Debian & Ubuntu installers.  Given today's discussion
that the feature be enabled by default, this flag, if needed at all,
will be to disable the feature.

Does this seem sane to everyone?  Next step is to integrate
biosdevname into udev rules in a sane manner.

Thanks,
Matt

-- 
Matt Domsch
Technology Strategist, Dell Office of the CTO

^ permalink raw reply

* Re: udev rules behaves opposite when executing startx
From: J. Bakshi @ 2010-11-05  4:45 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <201011040436.oA44amxS002870@dcnode-01.unlimitedmail.net>


   Any clue please ??


On Thu, 4 Nov 2010 14:15:01 +0530
"J. Bakshi" <j.bakshi@unlimitedmail.org> wrote:

> On Thu, 4 Nov 2010 10:07:41 +0530
> "J. Bakshi" <j.bakshi@unlimitedmail.org> wrote:
> 
> > 
> > Hello list,
> > 
> > Here is my udev rules which disable touchpad when I plug my usb external mouse, and enable it again, when removing the mouse 
> > 
> > ```````````````````
> > ACTION="add", SUBSYSTEM="input", ENV{ID_CLASS}="mouse", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority"  RUN+="/usr/bin/synclient TouchpadOff=1", RUN+="/bin/su user1 -c 'DISPLAY=:0.0 notify-send %k ' "
> > 
> > ACTION="remove", SUBSYSTEM="input", ENV{ID_CLASS}="mouse"  RUN+="/usr/bin/synclient TouchpadOff=0", RUN+="/bin/su user1 -c 'DISPLAY=:0.0 notify-send %k ' "
> > ``````````````````````````````
> > 
> > The rules is running well within X. But only when I start my WM with startx , then the rules behaves opposite. With no mouse attached , the touchpad is still inactive. Though by pluging/unpluging the mouse, the rules start working normally. I don't understand why startx makes the rules behave so. Could anyone give me any clue please ? 
> > 
> > Thanks
> > --
> 
> I wonder, if there is any alternative to disable/enable the touchpad, irrespective of DISPLAY ( i.e. ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority" ). Hence the rules will work well whenever it detects the mouse, in X and in console.
> 
>



^ permalink raw reply

* Re: Fix touchpad toggle on HP laptops breaking the keyboard
From: Martin Pitt @ 2010-11-06 13:17 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <1288633460.2771.24.camel@novo.hadess.net>

Hello Bastien,

Bastien Nocera [2010-11-01 17:44 +0000]:
> Subject: [PATCH] keymap: Add force release for HP touchpad off

Thanks! Committed with adding the new file to Makefile.am.

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

^ permalink raw reply

* Re: udev rules behaves opposite when executing startx
From: Dan Nicholson @ 2010-11-06 14:11 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <201011040436.oA44amxS002870@dcnode-01.unlimitedmail.net>

On Thu, Nov 4, 2010 at 9:33 PM, J. Bakshi <j.bakshi@unlimitedmail.org> wrote:
>
>   Any clue please ??
>
>
> On Thu, 4 Nov 2010 14:15:01 +0530
> "J. Bakshi" <j.bakshi@unlimitedmail.org> wrote:
>
>> On Thu, 4 Nov 2010 10:07:41 +0530
>> "J. Bakshi" <j.bakshi@unlimitedmail.org> wrote:
>>
>> >
>> > Hello list,
>> >
>> > Here is my udev rules which disable touchpad when I plug my usb external mouse, and enable it again, when removing the mouse
>> >
>> > ```````````````````
>> > ACTION="add", SUBSYSTEM="input", ENV{ID_CLASS}="mouse", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority"  RUN+="/usr/bin/synclient TouchpadOff=1", RUN+="/bin/su user1 -c 'DISPLAY=:0.0 notify-send %k ' "
>> >
>> > ACTION="remove", SUBSYSTEM="input", ENV{ID_CLASS}="mouse"  RUN+="/usr/bin/synclient TouchpadOff=0", RUN+="/bin/su user1 -c 'DISPLAY=:0.0 notify-send %k ' "
>> > ``````````````````````````````
>> >
>> > The rules is running well within X. But only when I start my WM with startx , then the rules behaves opposite. With no mouse attached , the touchpad is still inactive. Though by pluging/unpluging the mouse, the rules start working normally. I don't understand why startx makes the rules behave so. Could anyone give me any clue please ?
>> >
>> > Thanks
>> > --
>>
>> I wonder, if there is any alternative to disable/enable the touchpad, irrespective of DISPLAY ( i.e. ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority" ). Hence the rules will work well whenever it detects the mouse, in X and in console.

I think the issue is that your display manager probably isn't using
~/.Xauthority and you're DISPLAY may not be :0.

I think the only "correct" way to implement this is to have a process
running in your session that listens to udev events and runs
synclient/notify-send when it finds the ones it wants. Otherwise, the
hacky way to do it is to figure out all the current X sessions, where
the xauth files are and run the commands in each session. You'd
probably want a script for that.

--
Dan

^ permalink raw reply

* [ solved] Re: udev rules behaves opposite when executing startx
From: J. Bakshi @ 2010-11-06 14:23 UTC (permalink / raw)
  To: linux-hotplug

On Fri, 5 Nov 2010 10:03:41 +0530
"J. Bakshi" <j.bakshi@unlimitedmail.org> wrote:

> 
>    Any clue please ??
> 
> 
> On Thu, 4 Nov 2010 14:15:01 +0530
> "J. Bakshi" <j.bakshi@unlimitedmail.org> wrote:
> 
> > On Thu, 4 Nov 2010 10:07:41 +0530
> > "J. Bakshi" <j.bakshi@unlimitedmail.org> wrote:
> > 
> > > 
> > > Hello list,
> > > 
> > > Here is my udev rules which disable touchpad when I plug my usb external mouse, and enable it again, when removing the mouse 
> > > 
> > > ```````````````````
> > > ACTION="add", SUBSYSTEM="input", ENV{ID_CLASS}="mouse", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority"  RUN+="/usr/bin/synclient TouchpadOff=1", RUN+="/bin/su user1 -c 'DISPLAY=:0.0 notify-send %k ' "
> > > 
> > > ACTION="remove", SUBSYSTEM="input", ENV{ID_CLASS}="mouse"  RUN+="/usr/bin/synclient TouchpadOff=0", RUN+="/bin/su user1 -c 'DISPLAY=:0.0 notify-send %k ' "
> > > ``````````````````````````````
> > > 
> > > The rules is running well within X. But only when I start my WM with startx , then the rules behaves opposite. With no mouse attached , the touchpad is still inactive. Though by pluging/unpluging the mouse, the rules start working normally. I don't understand why startx makes the rules behave so. Could anyone give me any clue please ? 
> > > 
> > > Thanks
> > > --
> > 
> > I wonder, if there is any alternative to disable/enable the touchpad, irrespective of DISPLAY ( i.e. ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority" ). Hence the rules will work well whenever it detects the mouse, in X and in console.
> > 
> >
> 

Solved :-)  the hitch is some where else. For those facing the same; actually touchpad driver is loaded twice. 

``````````````````
(**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall"
(**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad catchall"
``````````````````````

Adding  [  MatchDevicePath "/dev/input/event*" ]  at /usr/share/X11/xorg.conf.d/50-synaptics.conf has solved this. This option ensures the driver loading only once.

Thanks


^ permalink raw reply

* Re: Touchpad toggle mess
From: Martin Pitt @ 2010-11-06 15:30 UTC (permalink / raw)
  To: Bastien Nocera
  Cc: linux-input, linux-hotplug, xorg, Peter Hutterer, Matthew Garrett
In-Reply-To: <1288915209.5418.72.camel@novo.hadess.net>

[-- Attachment #1: Type: text/plain, Size: 1539 bytes --]

Hello Bastien,

Bastien Nocera [2010-11-05  0:00 +0000]:
> The patches in https://bugs.freedesktop.org/show_bug.cgi?id=31300
> implement this for the kernel, and for X.org.
> 
> Then we have the problem that udev's keymaps seem to use different
> function keys depending on the hardware [1], when X.org (because of the
> limitations of XKB) standardised on F22 for "XF86TouchpadToggle".

Thanks for bringing this up, indeed there's some cleanup in order
here.

> So we'll need to standardise on the keys used. I selected F21 for
> XF86TouchpadToggle, F22 for XF86TouchpadOn and F23 for XF86TouchpadOff.
> See the patch in:
> https://bugs.freedesktop.org/show_bug.cgi?id=31333
> 
> The remaining fixes would need to be in udev's keymaps, to set hardware
> handled keys to F22 and F23, and software ones to F21. Patch is attached
> for that.

Indeed the maps which don't currently use f22 should be fixed,
regardless of what happens in X/kernel/userspace. My main concern is
that F22 has acted as touchpad toggle key for years (many of those
were imported from hal-info originally), so if we change everything to
f21 now without updating userspace (things like gnome-settings-daemon)
in lockstep, then we break existing functionality. 

It would look slightly weird, but perhaps it might be better to keep
using F22 for toggling, and F1->on, F23->off?

Thanks,

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: Touchpad toggle mess
From: Bastien Nocera @ 2010-11-06 15:56 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-hotplug, xorg, Peter Hutterer, Matthew Garrett,
	Martin Pitt
In-Reply-To: <20101105022004.GA26173@core.coreip.homeip.net>

On Thu, 2010-11-04 at 19:20 -0700, Dmitry Torokhov wrote:
> Hi Bastien,
> 
> On Fri, Nov 05, 2010 at 12:00:09AM +0000, Bastien Nocera wrote:
> > Heya,
> > 
> > In GNOME 2.32, we added support for touchpad toggle buttons, by
> > capturing the XF86TouchpadToggle button in gnome-settings-daemon,
> > showing a nice popup, and disabling the touchpad in software.
> > 
> > That works great for a number of laptops, but completely breaks a number
> > of others where the hardware handles the request, but still sends a key
> > event (usually separate ones for on and off). In those cases, we'd need
> > 2 more key types, in the kernel, and in X.org.
> 
> Rfkill story all over I guess ;(

Yes, though a fair bit simpler :)

> > The patches in https://bugs.freedesktop.org/show_bug.cgi?id1300
> > implement this for the kernel, and for X.org.
> > 
> > Then we have the problem that udev's keymaps seem to use different
> > function keys depending on the hardware [1], when X.org (because of the
> > limitations of XKB) standardised on F22 for "XF86TouchpadToggle".
> > 
> > So we'll need to standardise on the keys used. I selected F21 for
> > XF86TouchpadToggle, F22 for XF86TouchpadOn and F23 for XF86TouchpadOff.
> > See the patch in:
> > https://bugs.freedesktop.org/show_bug.cgi?id1333
> > 
> > The remaining fixes would need to be in udev's keymaps, to set hardware
> > handled keys to F22 and F23, and software ones to F21. Patch is attached
> > for that.
> > 
> > Questions, comments?
> 
> I still believe we need dedicated keycodes in kernel for that and make
> sure that in-kernel maps use proper keycodes so that programs that do
> not have the same limitations that X has could differentiate between
> touchpad events and real F2* events. X can still continue to use f21, 22
> and 23 (at least while it can't handle higher keycodes), and common
> setups may rely on udev's facilities to remap the keys.

I actually looked through the kernel, and couldn't find any drivers that
used F2X for touchpad toggling. All those keys are mapped in udev.

But I agree that we need to add those keys in the kernel, which is why I
cooked up:
https://bugs.freedesktop.org/attachment.cgi?id9965

Do you want me to send the patch separately?

Cheers


^ permalink raw reply

* Re: Touchpad toggle mess
From: Bastien Nocera @ 2010-11-06 15:58 UTC (permalink / raw)
  To: Martin Pitt
  Cc: linux-input, linux-hotplug, xorg, Peter Hutterer, Matthew Garrett
In-Reply-To: <20101106153031.GA2215@piware.de>

On Sat, 2010-11-06 at 11:30 -0400, Martin Pitt wrote:
> Hello Bastien,
> 
> Bastien Nocera [2010-11-05  0:00 +0000]:
> > The patches in https://bugs.freedesktop.org/show_bug.cgi?id1300
> > implement this for the kernel, and for X.org.
> > 
> > Then we have the problem that udev's keymaps seem to use different
> > function keys depending on the hardware [1], when X.org (because of the
> > limitations of XKB) standardised on F22 for "XF86TouchpadToggle".
> 
> Thanks for bringing this up, indeed there's some cleanup in order
> here.
> 
> > So we'll need to standardise on the keys used. I selected F21 for
> > XF86TouchpadToggle, F22 for XF86TouchpadOn and F23 for XF86TouchpadOff.
> > See the patch in:
> > https://bugs.freedesktop.org/show_bug.cgi?id1333
> > 
> > The remaining fixes would need to be in udev's keymaps, to set hardware
> > handled keys to F22 and F23, and software ones to F21. Patch is attached
> > for that.
> 
> Indeed the maps which don't currently use f22 should be fixed,
> regardless of what happens in X/kernel/userspace. My main concern is
> that F22 has acted as touchpad toggle key for years

No, for about a year:
http://cgit.freedesktop.org/xkeyboard-config/commit/?id\x1d05eda8dfc706d6450cab5883120e0d5e1100c0

>  (many of those
> were imported from hal-info originally), so if we change everything to
> f21 now without updating userspace (things like gnome-settings-daemon)
> in lockstep, then we break existing functionality. 

You don't need to update gnome-settings-daemon. gnome-settings-daemon
doesn't see F21, F22 or F23, it'll see XF86TouchpadOn, etc.

> It would look slightly weird, but perhaps it might be better to keep
> using F22 for toggling, and F1->on, F23->off?

That sounds like a bit of a mess having those 2 keys not next to each.
F22 for toggling, F23 for on, F24 for off would do me fine, if that's
really required.

FWIW, the keys mapped in udev are the only ones that mapped F22. There's
nothing in the kernel using F22 for touchpad toggles of any kind.

Cheers


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox