Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I wanted to make a program (with quickly) that edits some root files.

My question: How can i ask for root permission (after a button is clicked) to execute a command (just like the software center does)?
I want it to be universal. For both gnome and kde

share|improve this question
add comment

1 Answer 1

Such a popup would come up if you execute

Gnome:

system("gksudo <command>");

KDE:

system("kdesudo <command>");
share|improve this answer
    
gksudo update-alternatives --remove-all java throws me an error. btw, i need something that also works with kde –  mid_kid Oct 21 '12 at 18:34
2  
This is valuable information and should be added to your original question. –  cauon Oct 21 '12 at 18:52
1  
here you go @cauon ;) It's up to mid_kid to create a variable for the gksudo/kdesudo difference. –  Rinzwind Oct 22 '12 at 10:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.