Register
It is currently Fri Jul 25, 2014 5:23 am

Nautilus Scripts Not Working (Fedora 12)


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Mon Jan 04, 2010 11:52 am   

Joined: Sat Jan 02, 2010 7:38 pm
Posts: 1
I'm trying to write some nautilus scripts.

I have a file (script) called fileType, on the scripts folder, that shows when i right click over a file, on the context menu, but it does nothing.

Code:
#!/bin/sh
for arg
do
filetype=$(file "$arg")
  gdialog --title "File-Type Determinator" --msgbox "File $filetype" 200 200
done


Now, i tried gdialog on terminal, and i get a command not found.

So, i changed gdialog --title "File-Type Determinator" --msgbox "File $filetype" 200 200 to echo "File $filetype" but i see nothing.

To test, i added at the end of the script the command "peazip", and peazip starts, so the script is running, but the echo/gdialog lines are not working, any ideas?


Top
 Profile  
 PostPosted: Tue Jan 19, 2010 1:32 pm   
User avatar

Joined: Sat Jun 13, 2009 8:53 pm
Posts: 73
Location: Texas!
I would specify bash as the shell. I don't think that syntax for the loop will work -- try starting the for loop like this:
Code:
#!/bin/bash
for arg in "$@"
do
  filetype=$(file "$arg")
  gdialog --title "File-Type Determinator" --msgbox "File $filetype" 200 200
done


Or, if you are only expecting one file as an argument, simply:
Code:
#!/bin/bash
filetype=$(file "$1")
gdialog --title "File-Type Determinator" --msgbox "File $filetype" 200 200


If you run which gdialog it should respond with a filename, otherwise you don't have it.


Top
 Profile  
 PostPosted: Fri Jan 22, 2010 10:35 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 662
Location: Des Moines, Iowa
zenity is a rewrite of gdialog, the GNOME port of dialog which allows you to display dialog boxes from the commandline.

If it was me, I'd just install "dialog", but if you want the "gnomish" part of it, then just install zenity.
From the information given, I'd agree, gdialog isn't installed, or at least it's not in your path.


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP