I don't log in automatically to X but I need to start an app (tpb) as root.
If I put it in rc.local it fails b/c my system doesn't boot into X
If I put it into .xinitrc it fails b/c I don't have root privs as a normal user
Any idea how I can do this?
Start it in .xinitrc with sudo.
when you put it in /etc/rc.local, make sure you put a "&> /dev/null &" after it. this not only forks it, but also pipes its output to /dev/null so that you dont get it on vc/0 (ctrl-alt-f1).
Access the special buttons on a ThinkPad-Laptop using xosd
Neither option worked.. trying sudo prompts for a password on console 1 but then wouldn't let me type it and the dev/null thing did not give me any output while in X. Any other ideas?
I don't want to give myself non-password access to su to do this..
You can set up sudo so it won't ask you for a password. You'll need to edit the sudoers file with:
I didn't want to enable sudo without a password but I guess I was more interested in having tpb work so I went ahead and did it (with visudo of course). Interestingly that still doesn't work.. I can get to X (gnome) just fine but tpb doesn't seem to be running. Here is my .xinitrc file
#disable system beep xset b off & #conky & beagled & sudo tpb & exec gnome-session #exec enlightenment
Try to start it manually (with sudo) while you're in gnome to see if it's not a problem with sudo.
I can't think about anything else... Maybe try another app instead. I use keytouch (in AUR). I'm not sure if it has osd but maybe it would be good enough for your use.
If I type
sudo tpb &
as a normal user in a gnome terminal it works.. What's the story with keytouch?
Can Gnome autostart apps when it starts? If so you could try to configure it to run 'sudo tpb'.
I assume that tpb is an app to configure the extra multimedia buttons on a Thinkpad laptop. I was just suggesting that if tpb
doesn't work, you could try to use another app like keytouch. If it doesn't support your keyboard out of the box, you can create a custom keyboard file. I did so for my laptop and now my volume buttons and multimedia keys work. If you don't like keytouch, there are other apps to do that like lineak.
It is a thinkpad so you assumed right.. and starting it in the gnome-session with sudo tpb worked! Not sure why it worked one place and not the other but as long as it's solved..
Thanks very much for your help!