1

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.

cagru
  • 11

1 Answers1

0

I may suggest to work on this project on a tty. It is simply a terminal without GNOME DE. Open it through

Ctrl + Alt + F1/F2

A tty can be opened alongside a GNOME desktop just like a "workspace", so you can shift between the GNOME desktop and tty easily. To go back to the GNOME desktop, press

Ctrl + Alt + F7