Where am I?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Where am I?
# 1  
Old 02-09-2009
Where am I?

Hi!

Is there any command to tell me where did I click? I know it's a litle confuse but it's like this.
if I execute this script by clicking with the right button of my mouse, it gaves me the dir or file where I clicked


#!/bin/sh
zenity --info --title="Echo:" --text "`echo "?????"`"

this would be useful to use in a program that I've in mind

thanks
# 2  
Old 02-09-2009
this zenity script is just a "do-nothing" little script...

--info gives the little lightbulb....
--title sets the window title
--text gives you a text label....

You mean, you want it to give you the directory that you click?

Sure, try something like this:

Code:

dir=$(

  zenity --list --title="Choose the directory you wish to view" \
       --column="Directory" \
admin \
bin \
data \
deploy \
lost+found \
pdc \
scratch \
web \
webnet \
  )



print dir=$dir

# 3  
Old 02-09-2009
Quote:
Originally Posted by quirkasaurus
this zenity script is just a "do-nothing" little script...

--info gives the little lightbulb....
--title sets the window title
--text gives you a text label....

You mean, you want it to give you the directory that you click?

Sure, try something like this:

Code:

dir=$(

  zenity --list --title="Choose the directory you wish to view" \
       --column="Directory" \
admin \
bin \
data \
deploy \
lost+found \
pdc \
scratch \
web \
webnet \
  )



print dir=$dir

Man, the idea is to not need to enter the directory. Is to write a script that tells me in which directory I am or in which file did I click
# 4  
Old 02-09-2009
Quote:
Originally Posted by ruben.rodrigues
Man, the idea is to not need to enter the directory. Is to write a script that tells me in which directory I am or in which file did I click

Oh. Try this, man.


Code:
#!/bin/sh
 
file=`zenity --list --title="Choose the FILE you wish to view" --column="File" *`
 
zenity --info --title="file, directory..." --text "directory: $PWD\nfile: $file"

Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question