Skip to content

Commit

Permalink
Improve subtitle
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Jun 9, 2022
1 parent 5b0ec26 commit c82f871
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 1 addition & 3 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -1814,7 +1814,7 @@
<key>queuemode</key>
<integer>2</integer>
<key>runningsubtext</key>
<string>Searching...</string>
<string>Fetching...</string>
<key>script</key>
<string>./alfred-chromium-workflow 'visit-history' '{query}'</string>
<key>scriptargtype</key>
Expand Down Expand Up @@ -3581,8 +3581,6 @@
<key>RESULT_COUNT_LIMIT</key>
<string>50</string>
</dict>
<key>variablesdontexport</key>
<array/>
<key>version</key>
<string>0.2.6</string>
<key>webaddress</key>
Expand Down
2 changes: 1 addition & 1 deletion src/fetchBookmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var FetchBookmark = func(wf *aw.Workflow, query string) {
Arg(bookmark.Url).
Copytext(bookmark.Url).
Autocomplete(bookmark.Name).
Largetype(bookmark.Url)
Largetype(bookmark.Name)

item.Cmd().Subtitle("Press Enter to copy this url to clipboard")

Expand Down
2 changes: 2 additions & 0 deletions src/fetchBookmarkFolder.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ var FetchBookmarkFolder = func(wf *aw.Workflow, query string) {
Subtitle(fmt.Sprintf(`%d items included`, folderChildLen)).
Arg(folder.Id).
Autocomplete(folder.Name).
Copytext(folder.Name).
Largetype(folder.Name).
Icon(&aw.Icon{"assets/folder.png", ""}).
Var("folder", fmt.Sprintf(`--%s=%s`, "folderId", folder.Id))
}
Expand Down
6 changes: 3 additions & 3 deletions src/fetchDownloadHistory.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ var FetchDownloadHistory = func(wf *aw.Workflow, query string, showOnlyExistingF

var subtitle string
if FileExist(downloadedFilePath) {
subtitle = "[✔]"
subtitle = "[✔] "
} else {
if showOnlyExistingFiles == true {
continue
}
subtitle = "[✖]"
subtitle = "[✖] "
}

domainName := ExtractDomainName(downloadedFileFrom)
unixTimestamp := ConvertChromeTimeToUnixTimestamp(downloadedStartTime)
localeTimeStr := GetLocaleString(unixTimestamp)

subtitle += fmt.Sprintf(` Downloaded In '%s', From '%s'`, localeTimeStr, domainName)
subtitle += localeTimeStr

item := wf.NewItem(fileName).
Subtitle(subtitle).
Expand Down
4 changes: 2 additions & 2 deletions src/fetchHistory.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ var FetchHistory = func(wf *aw.Workflow, query string) {
localeTimeStr := GetLocaleString(unixTimestamp)

item := wf.NewItem(urlTitle).
Subtitle(fmt.Sprintf(`From '%s', In '%s'`, domainName, localeTimeStr)).
Subtitle(localeTimeStr).
Valid(true).
Quicklook(url).
Autocomplete(urlTitle).
Arg(url).
Copytext(url).
Largetype(url)
Largetype(urlTitle)

item.Cmd().Subtitle("Press Enter to copy this url to clipboard")

Expand Down
4 changes: 2 additions & 2 deletions src/fetchLoginData.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ var FetchLoginData = func(wf *aw.Workflow, query string) {

var subtitle string
if userNameElement != "" {
subtitle = fmt.Sprintf(`Used by '%s', Group: %s`, userNameElement, domainName)
subtitle = fmt.Sprintf(`Used in '%s', Group: %s`, userNameElement, domainName)
} else {
subtitle = fmt.Sprintf(`Used by '%s'`, domainName)
subtitle = fmt.Sprintf(`Used in '%s'`, domainName)
}

item := wf.NewItem(userNameValue).
Expand Down
4 changes: 2 additions & 2 deletions src/fetchSearchData.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ var FetchSearchData = func(wf *aw.Workflow, query string) {
localeTimeStr := GetLocaleString(unixTimestamp)

item := wf.NewItem(urlTitle).
Subtitle(fmt.Sprintf(`From '%s', In '%s'`, domainName, localeTimeStr)).
Subtitle(localeTimeStr).
Valid(true).
Quicklook(url).
Autocomplete(urlTitle).
Arg(url).
Copytext(url).
Largetype(url)
Largetype(urlTitle)

item.Cmd().Subtitle("Press Enter to copy this url to clipboard")

Expand Down
2 changes: 1 addition & 1 deletion src/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ var GetProfileRootPath = func(browserName string) string {
}

var GetDBFilePath = func(browserName string, chromeProfilePath string, dbFile string) string {
if (browserName == "Opera") {
if browserName == "Opera" {
return fmt.Sprintf(`%s/%s`, GetProfileRootPath(browserName), dbFile)
}
return fmt.Sprintf(`%s/%s/%s`, GetProfileRootPath(browserName), chromeProfilePath, dbFile)
Expand Down

0 comments on commit c82f871

Please sign in to comment.