2

What's the difference between xdotool getwindowfocus windowclose and the command executed by Alt+F4?

Firefox complains when being closed by the former method but doesn't complain when using Alt+F4, so there must be a difference but I can't seem to understand it.

DK Bose
  • 42,548
  • 23
  • 127
  • 221
dsSTORM
  • 1,860
  • See https://unix.stackexchange.com/questions/85205/is-there-a-way-to-simulate-a-close-event-on-various-windows-using-the-terminal – Kristopher Ives Feb 15 '19 at 10:15
  • The answers there are a bit too complex and seem address something different unfortunately. – dsSTORM Feb 15 '19 at 10:42
  • The answers explain if you want you can simply send ALT+F4 to the program using xdotool instead. – Kristopher Ives Feb 15 '19 at 10:51
  • hmm, "xdotool key alt+f4 --window getwindowfocus" would be the command yes? But it doesn't work with a keyboard shortcut for some reason. I've now seen that "xdotool getwindowfocus windowkill" works as alt+f4 though, so I'll probably stick to that. – dsSTORM Feb 15 '19 at 11:02
  • Not true, the correct command is apparently "wmctrl -c :ACTIVE:" – dsSTORM Feb 15 '19 at 12:00

0 Answers0