Find the answer to your Linux question:
Results 1 to 2 of 2
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 ...
  1. #1
    Just Joined! kwanbis's Avatar
    Join Date
    Jan 2005
    Posts
    15

    Nautilus Scripts Not Working (Fedora 12)

    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?

  2. #2
    Just Joined! kwanbis's Avatar
    Join Date
    Jan 2005
    Posts
    15
    Ok, i finally got my script to work. Almost.

    Code:
    #!/bin/sh
    for arg
    do
    	pathName=`echo $NAUTILUS_SCRIPT_CURRENT_URI | sed -e 's|file:///|/|' -e 's|//|/|' -e 's|%20| |'`
    	fileName="$arg"
    	fullName=$pathName/$fileName
    	fileNoExt=${fileName%.*}
    	fullFolder=$pathName/$fileNoExt
    	# zenity --info --title="Executing..." --text="/usr/local/share/PeaZip/res/7z/7z x -o$fullFolder $fullName" --width=200 --height=200
    	/usr/local/share/PeaZip/res/7z/7z x -o"$fullFolder" "$fullName"
    	zenity --info --title="DONE Executing" --text="/usr/local/share/PeaZip/res/7z/7z x -o$fullFolder $fullName" --width=200 --height=200
    done
    Now, the problem is that 7z, executes hidden! I don't see it, i thought it would open a terminal like screen. But nothing.

    What can it be? Can it be related to me not being able to see "echo XXX" messages also?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...