View previous topic :: View next topic |
Author |
Message |
Geralt Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 14 Jun 2008 Posts: 150
|
Posted: Mon Jun 21, 2010 4:31 pm Post subject: Something like udev for regular users? |
|
|
Hi,
I want to run some scripts under my regular user when I attach/detach some devices (currently they're all usb soundcards and I want to switch the default soundcard). For a system-wide policy udev and its rules would be the perfect tool, however I'm wondering if I can accomplish something like that on a per-user basis. Do you know if it's possible to run udev (or something like udev) as a non-root user to do that?
I don't think it's a permission problem because I'm allowed to run "udevadm monitor --environment" as a non-root user.
Thanks,
Geralt. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
irbanur n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 28 Aug 2003 Posts: 9
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
VoidMage Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/16259984764821973534cdc.gif)
Joined: 14 Oct 2006 Posts: 6196
|
Posted: Mon Jun 21, 2010 7:03 pm Post subject: |
|
|
Pulseaudio handles that by combination of udev ACL rules and consolekit. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Geralt Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 14 Jun 2008 Posts: 150
|
Posted: Mon Jun 21, 2010 9:01 pm Post subject: |
|
|
VoidMage wrote: | Pulseaudio handles that by combination of udev ACL rules and consolekit. |
Sounds promising, can you elaborate? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
VoidMage Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/16259984764821973534cdc.gif)
Joined: 14 Oct 2006 Posts: 6196
|
Posted: Mon Jun 21, 2010 10:34 pm Post subject: |
|
|
It's 70-acl.rules on udev side and consolekit part is usually handled
by a part of your desktop environment (if not, it may require a bit of tinkering).
As for pulseaudio, preferred (by upstream) mode of working is user daemon,
but actual configuration may require more work - the topic is broad
and there's an well established group of pulseaudio haters (personally, I'm indifferent). |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Geralt Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 14 Jun 2008 Posts: 150
|
Posted: Tue Jun 22, 2010 4:58 pm Post subject: |
|
|
Now I'm unsure if you misunderstand my problem. It's not that I can't access my soundcards, that works just fine. What I want is to automatically switch the default soundcard in pulseaudio (as you said it runs as a user daemon) when I attach/detach one of my usb soundcards. This is currently not possible within pulseaudio itself, therefore I was looking for a way to do it myself. And I was thinking that something like udev (that listens for changes in my hardware configuration) would be suited to the job, that would listen for my soundcards and when one is (un-)plugged execute a shellscript (like udev can do), i.e. I don't want to manage the device nodes, all I want to do is to monitor the devices and execute a shell script.
Thanks,
Geralt. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|