Skip to content

Instantly share code, notes, and snippets.

@OKsign
Created April 23, 2019 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OKsign/193dbe392a889d87c10036e5a2e5b202 to your computer and use it in GitHub Desktop.
Save OKsign/193dbe392a889d87c10036e5a2e5b202 to your computer and use it in GitHub Desktop.
# Xdotool, Python installed
# user input
searchProcess = "xdotool search --onlyvisible --class 'Process Name'"
minimizeWindow = "xdotool windowminimize $(xdotool search --onlyvisible --class 'Process Name')"
# end of user input
import time
import os
checkVisible = os.system(searchProcess)
if checkVisible is 0:
time.sleep(0.7)
os.system(minimizeWindow)
os.system("notify-send 'Linux Mint - Python Script 1' 'Done!'")
else:
while (checkVisible is not 0):
time.sleep(1)
checkVisible = os.system(searchProcess)
time.sleep(0.7)
os.system(minimizeWindow)
os.system("notify-send 'Linux Mint - Python Script 1' 'Done!'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment