Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Something like udev for regular users?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Geralt
Apprentice
Apprentice


Joined: 14 Jun 2008
Posts: 150

PostPosted: Mon Jun 21, 2010 4:31 pm    Post subject: Something like udev for regular users? Reply with quote

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
View user's profile Send private message
irbanur
n00b
n00b


Joined: 28 Aug 2003
Posts: 9

PostPosted: Mon Jun 21, 2010 5:27 pm    Post subject: Reply with quote

You could map the soundcards to the group "audio" and then add your user(s) to that group:

http://reactivated.net/writing_udev_rules.html#ownership
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Mon Jun 21, 2010 7:03 pm    Post subject: Reply with quote

Pulseaudio handles that by combination of udev ACL rules and consolekit.
Back to top
View user's profile Send private message
Geralt
Apprentice
Apprentice


Joined: 14 Jun 2008
Posts: 150

PostPosted: Mon Jun 21, 2010 9:01 pm    Post subject: Reply with quote

VoidMage wrote:
Pulseaudio handles that by combination of udev ACL rules and consolekit.

Sounds promising, can you elaborate?
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Mon Jun 21, 2010 10:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
Geralt
Apprentice
Apprentice


Joined: 14 Jun 2008
Posts: 150

PostPosted: Tue Jun 22, 2010 4:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum