Prevent nautilus showing partition mounted in bash script

Posted by bcbc on Ask Ubuntu See other posts from Ask Ubuntu or by bcbc
Published on 2012-04-13T02:33:56Z Indexed on 2012/04/13 5:42 UTC
Read the original article Hit count: 336

Filed under:
|

In my bash script I mount partitions, check them, copy files to them, and unmount. When the script mounts the partition, Nautilus pops up with a Window showing the partition and stealing focus. This is something I want to avoid.

Note: I know I can change the behaviour of this in System settings, Details, Removable media, Never prompt or start programs on media insertion, but I don't want to change the behaviour e.g. if a USB stick is plugged in, I just want to prevent it in my bash script.

Actually this auto display doesn't seem consistent. If I do the exact same command from the terminal, Nautilus doesn't show, and I know there are other mounts in my script that don't show. So what could be causing this? Here's an example of the code:

mkdir -p $target/home
mount $target/home $homedev

Thanks in advance

© Ask Ubuntu or respective owner

Related posts about nautilus

Related posts about bash