I am using Linux Mint 19. Default terminal is gnome-terminal

I created a custom shortcut In Keyboard -> Shortcut with the command gnome-terminal -e /home/ismail/Documents/Translate/screen_ts_short.sh. And assigned the shortcut key Win+Q

The script looks like -

xdotool getactivewindow windowminimize

My expectation is when I press Win+Q the bash script will run while the gnome-terminal is minimized.

But what happening is the current selected window gets minimized, and the terminal is wide open.

What can I do?

Update 1

From the answer, I took suggestion and added sleep .1 at the top

So, the script looks like

sleep .1
xdotool getactivewindow windowminimize

It is working now. Please let me know if you find a better solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.