AutoKey is a text expansion/replacement utility for Linux. In addition to text expansion capabilities it’s also able to be triggered by hotkeys and create custom prompts for inputs.

This script is a simple one I bind to Alt+Space which winds up functioning kinda like Spotlight from OSX but more programmable.

Features:

  • Quick browser access to bookmarks
  • Opening of Jira tickets
  • Search for things faster
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import re
import urllib
import webbrowser

retCode, command = dialog.input_dialog(title='Go',
                                       message='Where to?',
                                       default='')

bookmarks = {
    "gh": "https://github.com/jspaetzel",
    "js": "https://johnspaetzel.com",
    "groupmephp": "https://github.com/jspaetzel/GroupMePHP",
}

if re.search('\\w{2,3}-\\d{1,4}', command):
    webbrowser.open("https://jira.atlassian.net/browse/" + command)
elif command in bookmarks:
    webbrowser.open(bookmarks.get(command))
elif re.search('^google/.+$', command):
    query = re.match('^google/(.+)$', command).group(1)
    webbrowser.open('https://google.com/?q=' + urllib.parse.quote(command))
elif len(command) > 0:
    webbrowser.open('https://duckduckgo.com/?q=' + urllib.parse.quote(command))

Checkout my other post about text expanders & clipboard management.