This repository has been archived by the owner on Jan 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
config.go
76 lines (61 loc) · 1.61 KB
/
config.go
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//
// Copyright (c) 2017 Dean Jackson <[email protected]>
//
// MIT Licence. See http://opensource.org/licenses/MIT
//
// Created on 2017-11-02
//
package main
import "path/filepath"
var (
issuesURL = "https://github.com/deanishe/alfred-safari-assistant/issues"
forumURL = "https://www.alfredforum.com/topic/10921-safari-assistant/"
)
// Show configuration options in Alfred.
func doConfig() error {
blPath, err := initBlacklist()
if err != nil {
return err
}
wf.NewItem("View Help File").
Subtitle("Open the help file in your browser").
Arg("./README.html").
Valid(true).
Icon(IconHelp).
Var("action", "open")
wf.NewItem("Edit Action Blacklist").
Subtitle("Open action blacklist in your editor").
Arg(blPath).
Valid(true).
Icon(IconBlacklist).
Var("action", "open")
wf.NewItem("User Scripts").
Subtitle("Open user scripts directory in Finder").
Arg(filepath.Join(wf.DataDir(), "scripts")).
Valid(true).
Icon(IconFolder).
Var("action", "open")
wf.NewItem("Check for Update").
Subtitle("Check to see if a new version is available").
Valid(false).
Icon(IconUpdateCheck).
Autocomplete("workflow:update")
wf.NewItem("Report Problem on GitHub").
Subtitle("Open the workflow's issue tracker in your browser").
Arg(issuesURL).
Valid(true).
Icon(IconIssue).
Var("action", "open")
wf.NewItem("Visit Forum Thread").
Subtitle("Open workflow thread on alfredforum.com").
Arg(forumURL).
Valid(true).
Icon(IconURL).
Var("action", "open")
if query != "" {
wf.Filter(query)
}
wf.WarnEmpty("No matching items", "Try a different query?")
wf.SendFeedback()
return nil
}