4

I often run scripts to transform a CSV file which I then preview in LibreOffice. I often open the CSV with xdg-open file.csv. However, if I run that command when the file is already open, LibreOffice simply focuses that window - it doesn't reload the file from disk.

Is there a way, from the command line, that I can specify a window to close in the GUI? I can't just kill the process, since LibreOffice shares a single pid for all its windows. I'm running the latest version of Cinnamon on Mint 17.1.

4

You could use xkill, xdotool or wmctl.

type xkill on the terminal and then click on the window you want to close.

  • I suggest you explain how to achieve the goal with these tools. – guntbert May 14 '15 at 18:46
  • type xkill on the terminal and then click on the window you want to close. – VaTo May 14 '15 at 21:04
  • You should put this explanation into your answer. – guntbert May 14 '15 at 21:06
  • Based on this, I found xdotool meets my needs: `xdotool search "$FILENAME" windowactivate --sync key --window 0 --clearmodifiers alt+F4. – Jon G - Megaphone Tech May 14 '15 at 22:57
  • xkill will kill the process (not just close the program). – Shule Feb 14 '18 at 9:51

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.