Skip to content

Instantly share code, notes, and snippets.

@sl5net
Created November 7, 2020 13:54
Show Gist options
  • Save sl5net/ffaf76a77fd50344634f74c2169788d7 to your computer and use it in GitHub Desktop.
Save sl5net/ffaf76a77fd50344634f74c2169788d7 to your computer and use it in GitHub Desktop.
working example change shortcut in autokey script
from pathlib import Path
import json
home = str(Path.home())
path = home + "/.config/autokey/data/Sample Scripts/"
jsonFilePath = home + "/.config/autokey/data/Sample Scripts/.run-run-lintalistAHK-all.json"
file = open(jsonFilePath)
data = json.load(file)
for x in data['hotkey']:
data['hotkey'][x] = '<f11>'
print(data)
with open(jsonFilePath, 'w') as file:
json.dump(data, file, indent=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment