Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 4648  / 1 Year ago, sun, april 23, 2023, 7:25:48

I like to have my devices mounted in Nautilus/Nemo by default when I log in, so I can have symlinks to certain directories.



And I don't mean a custom mount or a mount with 10 lines of cryptSetup and luksOpen commands that would require me to hardcode a LUKS password. Not only because, but also because it is not compatible with the devices list in Nautilus/Nemo.



enter image description here



To do this, I can have an autostart script (Startup Applications) using gvfs-mount -d like so, very easy to maintain and it will automatically get LUKS-passwords from the keyring if necessary:



#!/usr/bin/env bash

# Redsandro 2013-03-01
# Mount (LUKS) drives and such

doMount() {
# Devices change every now and then. UUID does not.
DEV=`ls -l --color=never /dev/disk/by-uuid/ | grep $UUID | cut -d> -f2 | cut -d/ -f3`
gvfs-mount -d /dev/$DEV
}

# LUKS-1TB
# /dev/sdb1
UUID='9dd6df52-c901-4b70-8151-27086ba7db16'
doMount

# Projects 1TB
# /dev/sdd1
UUID='6b01a30e-af6e-48b4-810a-f9824558f041'
doMount

# MyBook 1
# /dev/sdc2
UUID='b36a4a52-a73d-43b5-a96a-d92074b8ef3f'
doMount

# MyBook 2
# /dev/sdc3
UUID='c771609f-018e-45a4-b4f3-5eebc8e67c83'
doMount


However, this will open a window for every device. How can I prevent those windows from opening?


More From » bash

 Answers
2

The answer is here (in another question) for Nautilus:




  • In GUI

    Install and/or run dconf-editor. Browse to org -> gnome -> desktop - media-handling.

    Uncheck automount-open.


  • In Terminal



    gsettings set org.gnome.desktop.media-handling automount-open false




There should be a similar option for Nemo since it is a fork of Nautilus.



Note that this will prevent Nautilus to open windows for any new mounted device (including USB keys).



There is no simple mean I'm aware of to selectively open windows for some devices and not for others (eg. there are means, but not simple; they require scripting and technical knowledge).


[#32365] Monday, April 24, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brasiplacar

Total Points: 314
Total Questions: 124
Total Answers: 97

Location: Dominican Republic
Member since Wed, Mar 17, 2021
3 Years ago
brasiplacar questions
Sat, Sep 4, 21, 13:11, 3 Years ago
Tue, Jan 10, 23, 06:22, 1 Year ago
Wed, Oct 13, 21, 15:19, 3 Years ago
Wed, May 4, 22, 00:06, 2 Years ago
Thu, Jan 5, 23, 15:40, 1 Year ago
;