Created
December 3, 2018 07:25
-
-
Save OKsign/dce931fd9ed1894aa886083ee0d32c70 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
# Don't use 'control + s' as hotkey. | |
# Save document '.xbindkeysrc' then relaunch xbindkeys. | |
import time | |
activeWindow = window.get_active_title() | |
time.sleep(0.2) | |
if '*.xbindkeysrc' in activeWindow: | |
keyboard.send_keys("<ctrl>+s") | |
os.system("gnome-terminal") | |
time.sleep(1.90) | |
keyboard.send_keys("killall xbindkeys") | |
time.sleep(0.5) | |
keyboard.send_keys("<enter>") | |
time.sleep(1.5) | |
keyboard.send_keys("xbindkeys") | |
time.sleep(0.5) | |
keyboard.send_keys("<enter>") | |
time.sleep(0.5) | |
keyboard.send_keys("<ctrl>+<shift>+q") | |
os.system("notify-send 'Script 5 for AutoKey' 'Done!'") | |
elif '.xbindkeysrc' in activeWindow: | |
keyboard.send_keys("<ctrl>+s") | |
os.system("gnome-terminal") | |
time.sleep(1.90) | |
keyboard.send_keys("killall xbindkeys") | |
time.sleep(0.5) | |
keyboard.send_keys("<enter>") | |
time.sleep(1.5) | |
keyboard.send_keys("xbindkeys") | |
time.sleep(0.5) | |
keyboard.send_keys("<enter>") | |
time.sleep(0.5) | |
keyboard.send_keys("<ctrl>+<shift>+q") | |
os.system("notify-send 'Script 5 for AutoKey' 'Done!'") | |
else: | |
os.system("notify-send 'Script 5 for AutoKey' 'Active Window is Not document .xbindkeysrc'") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment