You are not logged in.

#1 2010-08-29 22:16:32

awayand
Member
Registered: 2009-09-25
Posts: 398

[SOLVED] Truecrypt to open in thunar instead of nautilus

Hi,
I am using xfce4 and truecrypt. After mounting my truecrypt volume, and double-clicking on the mounted entry within truecrypt, I get the error "nautilus" not found. I don't want to install nautilus, but use thunar.

Anyone know where to change something, so that I can use thunar?

I am assuming there is a mechanism within xfce4 that allows you to define a default application for various actions/filetypes, which I would have to search for "nautilus" and then just change that, right?

Thanks!

Last edited by awayand (2011-05-06 08:18:17)

Offline

#2 2010-08-29 23:24:18

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Truecrypt to open in thunar instead of nautilus

Take a look at perl-file-mimeinfo - it's in extra


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2010-10-14 11:21:02

saedelaere
Member
Registered: 2009-04-24
Posts: 30

Re: [SOLVED] Truecrypt to open in thunar instead of nautilus

jasonwryan wrote:

Take a look at perl-file-mimeinfo - it's in extra

I have the same problem and installed the package. Still don't know how to solve this problem.

Offline

#4 2010-10-15 04:36:50

RakataPrime
Member
Registered: 2008-12-23
Posts: 1

Re: [SOLVED] Truecrypt to open in thunar instead of nautilus

I just created the file /usr/bin/nautilus, and put the following in it:

#!/bin/bash
exec thunar $@
exit 0

There's probably a better way, but this works well enough for me.

Offline

#5 2010-10-17 21:31:17

saedelaere
Member
Registered: 2009-04-24
Posts: 30

Re: [SOLVED] Truecrypt to open in thunar instead of nautilus

RakataPrime wrote:

I just created the file /usr/bin/nautilus, and put the following in it:

#!/bin/bash
exec thunar $@
exit 0

There's probably a better way, but this works well enough for me.

Good idea, thanks for sharing!

Offline

#6 2010-10-18 02:42:23

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: [SOLVED] Truecrypt to open in thunar instead of nautilus

Even easier:

$ cd /usr/bin/
$ ln -s thunar nautilus

Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#7 2011-03-14 22:21:30

655321
Member
From: Costa Rica
Registered: 2009-12-08
Posts: 412
Website

Re: [SOLVED] Truecrypt to open in thunar instead of nautilus

tried both solutions and none worked, I get this error:

Thunar: Unknown option --no-default-window  

Any help?  apparently Truecrypt runs nautilus with some kind of parameters thunar cant understand, how to solve this?

thanks in advance


Linux user #498977
With microsoft you get windows and gates, with linux you get the whole house!
My Blog about ArchLinux and other stuff

Offline

#8 2011-04-14 17:48:13

Furumaru
Member
Registered: 2011-04-14
Posts: 1

Re: [SOLVED] Truecrypt to open in thunar instead of nautilus

trucrypt calls nautilus by:

/usr/bin/nautilus --no-default-window --no-desktop /media/truecrypt1

Creating  /usr/bin/nautilus  containing

#!/bin/bash
exec thunar $3
exit 0

did the trick for me.

Offline

#9 2011-06-05 17:44:05

HalJordan
Member
Registered: 2010-11-17
Posts: 64

Re: [SOLVED] Truecrypt to open in thunar instead of nautilus

Worked for me. As long as truecrypt doesn't change their call to nautilus. $1 and $2 are nautilus specific options, then 3 is the actual directory.
Is there not a config file to truecrypt where we can choose our own filemanager? It's not like nautilus(ie ubuntu) is our only option.....

Offline

#10 2011-08-09 00:42:04

halfvulcan
Member
Registered: 2011-08-09
Posts: 1

Re: [SOLVED] Truecrypt to open in thunar instead of nautilus

Well, that script is elegant and all for what it is, but...
MINE'S BIGGER!   lol
And probably not very elegant. I certainly hope not.  Look at this mess!  But, what it does is deal with spaces in filenames, accomodating up to 10 words in a filename and/or flags.  So you'd stick this script wherever (not there !)  and create symlinks with the names of any file managers you can think of that you don't have. Use it for any type of app, just editing the "app=" line.

#!/bin/bash
app=pcmanfm
if [ -n "$@" ] ; then
"$app"
fi
for firstword in "$@" ; do
    if [ -e "$firstword" ] ; then 
        "$app $firstword"
        exit
    else
        if [ "$firstword" = "$1" ] ; then
            followingwords="$2 $3 $4 $5 $6 $7 $8 $9 $10"
        fi
        if [ "$firstword" = "$2" ] ; then
            followingwords="$3 $4 $5 $6 $7 $8 $9 $10"
        fi
        if [ "$firstword" = "$3" ] ; then
            followingwords="$4 $5 $6 $7 $8 $9 $10"
        fi
        if [ "$firstword" = "$4" ] ; then
            followingwords="$5 $6 $7 $8 $9 $10"
        fi
        if [ "$firstword" = "$5" ] ; then
            followingwords="$6 $7 $8 $9 $10"
        fi    
        if [ "$firstword" = "$6" ] ; then
            followingwords="$7 $8 $9 $10"
        fi
        if [ "$firstword" = "$7" ] ; then
            followingwords="$8 $9 $10"
        fi
        if [ "$firstword" = "$8" ] ; then
            followingwords="$9 $10"
        fi
        if [ "$firstword" = "$9" ] ; then
            followingwords="$10"
        fi
        if [ -e "$word" ] ; then 
            "$app $word"
            exit
        fi
        possiblefolder="$firstword"
        if [ -e "$firstword" ] ; then
            "$app $firstword"
            exit
        else
            for followingword in "followingwords" ; do
                possiblefolder="$possiblefolder $followingword"
                if [ -e "$possiblefolder" ] ; then
                    "$app $possiblefolder"
                    exit
                fi
            done
        fi
    fi
done

exit

Last edited by halfvulcan (2011-08-09 03:55:03)

Offline

#11 2011-08-15 10:50:39

insecticider
Banned
Registered: 2011-06-16
Posts: 29

Re: [SOLVED] Truecrypt to open in thunar instead of nautilus

Hi!

I had the same problem but yes, halfvulcan, your script is very unelegant. So I wrote my own:

#!/bin/bash

# set your filemanager here
filemgr=thunar

# set your webbrowser here, usually x-www-browser should be perfect
webbrowser=x-www-browser

### DO NOT CHANGE ANYTHING BELOW HERE unless you know what you're doing ###

oldparams=$@

function error {
	zenity --error --text="$@" || kdialog --error "$@" || echo ERROR: "$@"
}

while [ "${1:0:1}" = "-" ] || [ ! -e $1 ]
do
	if [[ $1 =~ .*://.* ]] || [[ $1 =~ www\..*\..* ]]
	then # could be an url
		url=$1
	fi
	shift
done

if [ ! $1 = "" ]
then
	if [ -d $1 ]
	then
		toopen=$1
	else
		toopen=`dirname $1`
	fi
	$filemgr $toopen || error "There was an error opening \"$toopen\" with \"$filemgr\". Please check that you have a file manager installed and set its correct name in this script."
else
	if [[ $url = "" ]]
	then
		error "Could not open $filemgr or $webbrowser because no valid file, directory or url was found in \"$oldparams\""
	else
		$webbrowser $url || error "There was an error opening \"$url\" with \"$webbrowser\". Please check that you have a webbrowser installed and set its correct name in this script."
	fi
fi

This is very elegant and it also checks the arguments for web addresses and handles them with a webbrowser, so that this script can fully replace the konqueror-command which was earlier (KDE3) feeded with filenames or urls. If there is a filename given, then the containing folder is opened. If an error occurs, you get a nice error dialog telling you exactly what went wrong (supports zenity and kdialog but the kdialog-part was not tested since I don't have that installed). All in all I call this the magical do-what-this-program-means-script and its magicallyness is supported by the fact that it is exactly 42 lines long. Because of the =~ operator, you need bash at least in the 3.0 version.

Maybe I'll upload this script later to my website http://enormator.110mb.com and update it there with

I have this script at /usr/bin/x-file-manager and have links to it from /usr/bin/nautilus and from /usr/bin/konqueror and from /usr/bin/dolphin (KDE4s file manager)

Offline

Board footer

Powered by FluxBB