Skip to content

Instantly share code, notes, and snippets.

@sl5net
Created November 9, 2020 18:29
Show Gist options
  • Save sl5net/a6576f9dec0fd254b8a96c4b3a9cf1ba to your computer and use it in GitHub Desktop.
Save sl5net/a6576f9dec0fd254b8a96c4b3a9cf1ba to your computer and use it in GitHub Desktop.
some helper working with autokey
doPopupNotify_howItWorks = True # subprocess.Popen(['notify-send', "will be showed right top"]) # will be showed right top
def popupNotify(text):
subprocess.Popen(['notify-send', text]) # will be showed right top
def popupNotify_howItWorks(text):
global doPopupNotify_howItWorks
if doPopupNotify_howItWorks:
subprocess.Popen(['notify-send', text]) # will be showed right top
time.sleep(.2)
def beeps(duration=.1, freq=2000, loops=1):
# duration = .8 # second
# freq = 1500 # Hz
for x in range(loops):
os.system('play --no-show-progress --null --channels 1 synth %s sine %f' % (duration, freq))
popupNotify_howItWorks("#/‾‾‾ release_key('<shift>")
keyboard.release_key('<shift>') # sometimes i got hanging shift key
popupNotify_howItWorks("#\___ release_key('<shift>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment