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 have Ctrl+Super+N set to launch gksu nautilus. This set me thinking: can I have a prompt that comes up that asks me for a path to open? Ideally, I'd be able to hit a key combo, type /usr/share/applications, and have Nautilus open up without having to use the GUI to get there.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Use zenity to create a text box dialog from the terminal, which you can use to specify a path.

Install zenity from a terminal if it's not already installed:

$ sudo apt-get install zenity

Now you can create interesting dialog boxes from the terminal:

$ zenity --entry --text='Enter nautilus path:'

enter image description here

Now that you can graphically enter a path, how do you hand this off to nautilus? How about some bash magic!

$ nautilus $(zenity --entry --text='Enter nautilus path:')

You've successfully provided your path to nautilus as an argument. Now just bind this command to the shortcut of your choice!

share|improve this answer
    
Awesome! Thanks! –  WindowsEscapist Dec 18 '12 at 3:41
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.