Return subprocess.check_output(cmd).decode("utf-8").strip() Install both xdotool and wmctrl sudo apt-get install wmctrl xdotoolĬopy the script below into an empty file, save it as stop_active.py #!/usr/bin/env python3 To use it in a script to close all windows of an application: The safest way to close an application's window gracefully, and make sure you will not lose data, is using wmctrl (not installed by default): wmctrl -ic How to safely close all windows of a gui application with a shortcut key
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |