Originally Posted by yooy
in worst case scenario you can write a script that looks for windows titles (wmctrl) and automaticaly close window that pop out with usb storage connected. Probably there is better way to do it.
English is clearly not the OP's native language and their question is not entirely clear, but it sounds like they're truing to disable the use of USB storage devices. I don't see how closing a window automatically is going to achieve that, or achieve anything at all other than closing a window.
To disable use of USB storage devices you could disable USB in the BIOS, but that's probably not practical because the keyboard and mouse are probably USB.
This looks like it might be useful,
and there is lots of other discussion on the subject to be found via Google