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.

Before upgrading to 12.04 (from 10.04) I used this little launcher script:

 #!/bin/bash  
 gksudo nautilus /var/www/DFDII & sleep 5; gksudo gedit /var/www/DFDII/iindex.php

This script opened both nautilus and gedit with just one PW entry, now it asks for PW twice ?

Also, annoyingly, now gedit also open "untitled document 1" (close > save changes ? NOOOOO!...

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Two main options:

  1. Demand that the whole script be run as root. Lots of scripts just exit out and suggest the user prepend the command with gksu.

  2. Run things like this:

    #!/bin/bash
    gksu -- bash -c 'whoami; whoami; whoami # all these return root'
    
share|improve this answer
    
Thank you Oli - this works: gksu -- bash -c 'nautilus & sleep 5; gedit' But only if I add the "sleep 5" - without it, gedit doesn't start until I close nautilus - why ? –  Thomas Sep 3 '12 at 21:14
    
@Thomas because nautilus is running in the foreground. It's not running as that user so takes over the terminal. The & puts it in the background. nautilus & gedit should work. –  Oli Sep 3 '12 at 21:35
    
Right you are :) Thanks again. Any idea why gedit (also) opens "untitled document 1" (or why it thinks it's been altered when I try to close it) ? –  Thomas Sep 3 '12 at 21:58
    
Sorry - it's a known bug but that's all I can say to help. I tried playing around with its options but nothing seems to work around the tab issue. bugs.launchpad.net/ubuntu/+source/gedit/+bug/890041 –  Oli Sep 3 '12 at 22:33
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.