-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfx.py
35 lines (27 loc) · 913 Bytes
/
fx.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf-8 -*-
"""Quickly lanuch a temporary Firefox instance."""
from albert import *
import os
__title__ = "Firefox temporary profile"
__version__ = "0.4.1"
__triggers__ = "fx"
__authors__ = "Benjamin Altpeter"
iconPath = iconLookup("firefox")
def handleQuery(query):
if not query.isTriggered:
return
results = []
results.append(
Item(
id=__title__,
icon=iconPath,
text="Launch temporary Firefox profile",
subtext="This will create a new temporary Firefox profile and launch an instance with it.",
completion=query.rawString,
actions=[
# Command taken from: https://news.ycombinator.com/item?id=18898865
FuncAction("Launch temporary Firefox", lambda: os.system("firefox --new-instance --profile $(mktemp -d) &"))
]
)
)
return results