[Thunar-dev] Fuse, scripts and thunar

mmassonnet at gmail.com mmassonnet at gmail.com
Wed Aug 29 16:11:34 CEST 2007


Hi Erlend,

On Wed, Aug 29, 2007 at 02:08:58PM +0100, Erlend Davidson wrote:
> Is thunar to have support for Fuse filesystems?  They are becoming more 
> popular and more useful.  I personally use the following script to 
> handle my windows shares:
> 
> #! /bin/bash
> 
> MOUNTED=`mount | grep -c /mnt/samba`
> if [ $MOUNTED -ne 0 ]; then
>     echo "Samba shares already mounted on /mnt/samba"
> else
>     fusesmb -o allow_other /mnt/samba
> fi

Nice, maybe I will write a script for my sshfs custom actions, so I
don't have two actions to mount and unmount.

> I was thinking it could be useful to have these scripts integrated in 
> thunar as an icon the sidepane above the shortcuts (where Desktop, Trash 
> and Filesystem are).  You could have an icon which when clicked runs a 
> custom script before navigating to a directory.  In the above example it 
> would run my script and then navigate to /mnt/samba, though you probably 
> want the /mnt/samba to be a variable, and you probably want these 
> mount-points to be somewhere else.
> 
> Thunar could come with scriptable-icons but users could also make their 
> own (e.g. for things like trackerfs, sshfs as well as fusesmb).
> 
> Any thoughts on this?

Just my 2 cents,

I did the next: 1) I created a personal mount directory (/mnt/mike), 2)
I created a directory for each machines I want to mount, 3) I created
two custom actions, 4) and I have set a list of file patterns for both
actions to match the name of the machines.

The mount action in Thunar custom action dialog is as simple as: 

	sshfs %n: /mnt/mike/%n

and the unmount action:

	fusermount -u %f

If you try to mount twice it throws an error (permission denied), so
there's no real deal to script that, neither for unmount.

That done, I can create /mnt/mike/remotemachine.tld for a remote machine
over Internet, as I can create /mnt/mike/localmachine.  Now when the
machine to connect to is not on the default port, the simple way is to
specify it in ~/.ssh/config.

Now about Thunar, I'll be happy and pleased to see some "fuse"
integration in it, like listing the mounted volumes and being able to
unmount them.  But the custom actions is probably the niftiest tool for
any application :p

> Thanks,
> 
> Erlend


Cheers,
Mike



More information about the Thunar-dev mailing list