# [PARTLY SOLVED] udev strange behavior

## Perfect Gentleman

rule 

```
KERNELS=="1-5", SUBSYSTEM=="usb", ATTRS{idVendor}=="041e", ATTRS{idProduct}=="3f04", RUN+="/usr/bin/sudo -u my_user /usr/bin/xfce4-volumed-pulse"
```

 doesn't work, but

rule

```
KERNELS=="1-5", SUBSYSTEM=="usb", ATTRS{idVendor}=="041e", ATTRS{idProduct}=="3f04", RUN+="/usr/bin/sudo -u my_user /usr/bin/touch /tmp/log"
```

 works

WTF?

Working rule:

```
SUBSYSTEM=="usb", ATTRS{idVendor}=="041e", ATTRS{idProduct}=="3f04", RUN+="/usr/bin/sudo -u my_user DISPLAY=:0.0 /usr/bin/xfce4-volumed-pulse &2"
```

Partly solved: xfce4-volumed-pulse and pulseaudio start, but no soundLast edited by Perfect Gentleman on Mon Nov 09, 2015 9:24 am; edited 2 times in total

----------

## khayyam

PG ... I imagine because the latter is cli while the former is X11 ... and so requires knowledge of what DISPLAY its to use:

```
% echo $DISPLAY

:0
```

HTH & best ... khay

----------

## Perfect Gentleman

i corrected it to

```
KERNELS=="1-5", SUBSYSTEM=="usb", ATTRS{idVendor}=="041e", ATTRS{idProduct}=="3f04", RUN+="/usr/bin/sudo -u my_user /usr/bin/xfce4-volumed-pulse --display=:0 &>/dev/null"
```

 , it didn't help.

```
KERNELS=="1-5", SUBSYSTEM=="usb", ATTRS{idVendor}=="041e", ATTRS{idProduct}=="3f04", RUN+="DISPLAY=:0 /usr/bin/sudo -u my_user /usr/bin/xfce4-volumed-pulse &>/dev/null"
```

 didn't work too.Last edited by Perfect Gentleman on Mon Nov 09, 2015 7:02 am; edited 1 time in total

----------

## khayyam

PG ... honestly I don't know why you'd need to run this on connecting a device, surely a volume mixer is started as a component of the XFCE DE? Anyhow, you say it doesn't help ... what is suposed to happen?

best ... khay

----------

