Created
March 1, 2019 08:49
-
-
Save OKsign/fc760f10d385aedd41781104963ba4dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
activeApp = window.get_active_class() | |
def kill_thonny(): | |
time.sleep(0.2) | |
os.system("xdotool key Alt_L+F4") | |
time.sleep(0.7) | |
os.system("xdotool key Alt_L+n") | |
if 'thonny' in activeApp: | |
kill_thonny() | |
time.sleep(1) | |
else: | |
os.system("x=$(xdotool getwindowpid $(xdotool getwindowfocus));sleep 0.50;kill $x") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment