Skip to content

Commit

Permalink
update for better user experience
Browse files Browse the repository at this point in the history
- Largetype
- Subtitle
  • Loading branch information
cage1016 committed Aug 26, 2022
1 parent 0392269 commit 7b5dd82
Show file tree
Hide file tree
Showing 17 changed files with 370 additions and 143 deletions.
136 changes: 55 additions & 81 deletions .workflow/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,6 @@
<key>vitoclose</key>
<false/>
</dict>
<dict>
<key>destinationuid</key>
<string>4C3AA443-3696-4DA1-BE97-18252F520E01</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>sourceoutputuid</key>
<string>623A4F44-A078-4672-8975-14041E57A33B</string>
<key>vitoclose</key>
<false/>
</dict>
<dict>
<key>destinationuid</key>
<string>50FCEAF1-2982-4F22-A6C4-7772EF3F958C</string>
Expand Down Expand Up @@ -616,7 +604,7 @@
<array>
<dict>
<key>destinationuid</key>
<string>D2D00E80-4891-40FF-9F52-AD4925066F25</string>
<string>4C3AA443-3696-4DA1-BE97-18252F520E01</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
Expand Down Expand Up @@ -855,7 +843,7 @@
<key>runningsubtext</key>
<string>Loading...</string>
<key>script</key>
<string>./exe checksum $1</string>
<string>./exe checksum "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -902,7 +890,7 @@
<key>runningsubtext</key>
<string>Loading...</string>
<key>script</key>
<string>./exe jwt $1</string>
<string>./exe jwt "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -1177,7 +1165,7 @@
<key>runningsubtext</key>
<string></string>
<key>script</key>
<string>./exe decode $1</string>
<string>./exe decode "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -1226,7 +1214,7 @@
<key>runningsubtext</key>
<string></string>
<key>script</key>
<string>./exe uuid $1</string>
<string>./exe uuid "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -1283,7 +1271,7 @@
<key>runningsubtext</key>
<string></string>
<key>script</key>
<string>./exe li $1</string>
<string>./exe li "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -1332,7 +1320,7 @@
<key>runningsubtext</key>
<string></string>
<key>script</key>
<string>./exe hash $1</string>
<string>./exe hash "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -1381,7 +1369,7 @@
<key>runningsubtext</key>
<string>Loading...</string>
<key>script</key>
<string>./exe qrcode $1</string>
<string>./exe qrcode "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand All @@ -1402,6 +1390,29 @@
<key>version</key>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>path</key>
<string>{query}</string>
<key>sortBy</key>
<integer>0</integer>
<key>sortDirection</key>
<integer>0</integer>
<key>sortFoldersAtTop</key>
<false/>
<key>sortOverride</key>
<false/>
<key>stackBrowserView</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.action.browseinalfred</string>
<key>uid</key>
<string>4C3AA443-3696-4DA1-BE97-18252F520E01</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
Expand Down Expand Up @@ -1451,6 +1462,25 @@
<key>version</key>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>autopaste</key>
<false/>
<key>clipboardtext</key>
<string>{query}</string>
<key>ignoredynamicplaceholders</key>
<false/>
<key>transient</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.output.clipboard</string>
<key>uid</key>
<string>54185D5A-A90D-43D6-8911-882FCBFD4CA4</string>
<key>version</key>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
<dict>
Expand Down Expand Up @@ -1549,25 +1579,6 @@
<key>version</key>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>autopaste</key>
<false/>
<key>clipboardtext</key>
<string>{query}</string>
<key>ignoredynamicplaceholders</key>
<false/>
<key>transient</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.output.clipboard</string>
<key>uid</key>
<string>54185D5A-A90D-43D6-8911-882FCBFD4CA4</string>
<key>version</key>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
<dict>
Expand Down Expand Up @@ -1883,29 +1894,6 @@
<key>version</key>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>path</key>
<string>{query}</string>
<key>sortBy</key>
<integer>0</integer>
<key>sortDirection</key>
<integer>0</integer>
<key>sortFoldersAtTop</key>
<false/>
<key>sortOverride</key>
<false/>
<key>stackBrowserView</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.action.browseinalfred</string>
<key>uid</key>
<string>4C3AA443-3696-4DA1-BE97-18252F520E01</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
Expand All @@ -1925,20 +1913,6 @@
<key>uid</key>
<string>4D96CDF8-BDC6-41A4-B274-67CA02B1DE03</string>
</dict>
<dict>
<key>inputstring</key>
<string>{var:action}</string>
<key>matchcasesensitive</key>
<false/>
<key>matchmode</key>
<integer>0</integer>
<key>matchstring</key>
<string>browse in alfred</string>
<key>outputlabel</key>
<string>browse in alfred</string>
<key>uid</key>
<string>623A4F44-A078-4672-8975-14041E57A33B</string>
</dict>
<dict>
<key>inputstring</key>
<string>{var:action}</string>
Expand Down Expand Up @@ -2822,7 +2796,7 @@ https://github.com/cage1016/alfred-devtoys</string>
<key>xpos</key>
<real>950</real>
<key>ypos</key>
<real>1025</real>
<real>1040</real>
</dict>
<key>2190908E-CE13-43D3-8C8C-A880648445DD</key>
<dict>
Expand Down Expand Up @@ -2857,7 +2831,7 @@ https://github.com/cage1016/alfred-devtoys</string>
<key>xpos</key>
<real>1185</real>
<key>ypos</key>
<real>1020</real>
<real>695</real>
</dict>
<key>4EE4E0AD-A4A7-47E0-8D37-3B95EC3522E0</key>
<dict>
Expand Down Expand Up @@ -2885,7 +2859,7 @@ https://github.com/cage1016/alfred-devtoys</string>
<key>xpos</key>
<real>1185</real>
<key>ypos</key>
<real>920</real>
<real>885</real>
</dict>
<key>60AD413A-80C1-486B-B448-F0161FBAE954</key>
<dict>
Expand Down Expand Up @@ -3058,9 +3032,9 @@ https://github.com/cage1016/alfred-devtoys</string>
<key>E377B5E7-7041-4785-A436-0EE645D6591D</key>
<dict>
<key>xpos</key>
<real>1305</real>
<real>1185</real>
<key>ypos</key>
<real>920</real>
<real>1005</real>
</dict>
<key>E6722CFB-EC4E-4094-AD75-F2B3D973B654</key>
<dict>
Expand Down
26 changes: 22 additions & 4 deletions cmd/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var binaryCmd = &cobra.Command{
}

func runBinary(cmd *cobra.Command, args []string) {
query := strings.Join(args, " ")
query := args[0]
if strings.TrimSpace(query) == "" {
query = string(clipboard.Read(clipboard.FmtText))
}
Expand All @@ -36,13 +36,31 @@ func runBinary(cmd *cobra.Command, args []string) {
wf.NewItem(fmt.Sprintf("`%s` is invalid binary", query)).Subtitle("Try a different query?").Icon(NumberGrayIcon)
} else {
b := lib.BinToDec(query)
wf.NewItem(DecimalFormat(b)).Subtitle("➜ Binary to Decimal").Valid(true).Arg(b).Icon(NumberIcon).Var("action", "copy")
wf.NewItem(DecimalFormat(b)).
Subtitle(" ⌘+L, ↩ Copy Binary to Decimal").
Valid(true).
Arg(b).
Largetype(b).
Icon(NumberIcon).
Var("action", "copy")

o := lib.BinToOct(query)
wf.NewItem(OctalFormat(o)).Subtitle("➜ Binary to Octal").Valid(true).Arg(o).Icon(NumberIcon).Var("action", "copy")
wf.NewItem(OctalFormat(o)).
Subtitle(" ⌘+L, ↩ Copy Binary to Octal").
Valid(true).
Arg(o).
Largetype(o).
Icon(NumberIcon).
Var("action", "copy")

h := lib.BinToHex(query)
wf.NewItem(HexFormat(h)).Subtitle("➜ Binary to Hexadecimal").Valid(true).Arg(h).Icon(NumberIcon).Var("action", "copy")
wf.NewItem(HexFormat(h)).
Subtitle(" ⌘+L, ↩ Copy Binary to Hexadecimal").
Valid(true).
Arg(h).
Largetype(h).
Icon(NumberIcon).
Var("action", "copy")
}

wf.SendFeedback()
Expand Down
18 changes: 15 additions & 3 deletions cmd/case.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var caseCmd = &cobra.Command{
}

func runCase(cmd *cobra.Command, args []string) {
query := strings.Join(args, " ")
query := args[0]
if strings.TrimSpace(query) == "" {
query = string(clipboard.Read(clipboard.FmtText))
}
Expand All @@ -75,7 +75,13 @@ func runCase(cmd *cobra.Command, args []string) {
wf.NewItem(fmt.Sprintf("`%s` is invalid input", query)).Subtitle(fmt.Sprintf("Try a different query for %s?", v)).Icon(TextChangeCaseGrayIcon)
} else {
str := m.Fn(query)
wf.NewItem(str).Subtitle(fmt.Sprintf("%s ➜ %s", v, m.Subtitle)).Valid(true).Arg(str).Icon(TextChangeCaseIcon).Var("action", "copy")
wf.NewItem(str).
Subtitle(fmt.Sprintf("%s ➜ ⌘+L, ↩ Copy %s", v, m.Subtitle)).
Valid(true).
Arg(str).
Largetype(str).
Icon(TextChangeCaseIcon).
Var("action", "copy")
}
}
} else {
Expand All @@ -84,7 +90,13 @@ func runCase(cmd *cobra.Command, args []string) {
wf.NewItem(fmt.Sprintf("`%s` is invalid input", query)).Subtitle(fmt.Sprintf("Try a different query for %s?", t)).Icon(TextChangeCaseGrayIcon)
} else {
str := m.Fn(query)
wf.NewItem(str).Subtitle(fmt.Sprintf("%s ➜ %s", t, m.Subtitle)).Valid(true).Arg(str).Icon(TextChangeCaseIcon).Var("action", "copy")
wf.NewItem(str).
Subtitle(fmt.Sprintf("%s ➜ ⌘+L, ↩ Copy %s", t, m.Subtitle)).
Valid(true).
Arg(str).
Largetype(str).
Icon(TextChangeCaseIcon).
Var("action", "copy")
}
}
}
Expand Down
Loading

0 comments on commit 7b5dd82

Please sign in to comment.