combine remove safely HDD with close app command by one click on android tv

Is there a way to do this? dear kodi guru. so I can click the close button on main page and eject my harddrive safely and close the app by one click.
I also have a problem unfortunately: In file manager page. i can’t open the context menu of my external harddrive. so i can’t remove safely the harddrive this way. sad. but why tho?