Is there a way to close the Gnome Files Window automatically when unplugging a USB-drive?
I am working on an embedded project upploading new software via STLINK. The STLINK has a neat feature of simulating a usb-drive for uploading new firmware. Each time the firmware is uploaded the device disconnects and reconnects, which makes Gnome spawn a new Files Window. I would like to have one window closed and one window started, but as my code is not flawless I end up with hundreds of windows after a while. All that I have to close using one by one using the mouse pointer.
[Edit] It was not exactly solved but good enough by following sudodus recommendation below to prevent opening of new windows. Disable auto-opening nautilus window after auto-mount. This works very well since the USB-icon still shows up in the left side Dock.