MCPcopy
hub / github.com/matryer/xbar / String

Method String

pkg/plugins/refresh_interval.go:49–64  ·  view source on GitHub ↗

String returns the RefreshInterval as a string that can be used as an xbar interval, as represented in plugin filenames.

()

Source from the content-addressed store, hash-verified

47// String returns the RefreshInterval as a string that can be used as an xbar
48// interval, as represented in plugin filenames.
49func (r RefreshInterval) String() string {
50 switch r.Unit {
51 case "days":
52 return fmt.Sprintf("%dd", r.N)
53 case "hours":
54 return fmt.Sprintf("%dh", r.N)
55 case "minutes":
56 return fmt.Sprintf("%dm", r.N)
57 case "seconds":
58 return fmt.Sprintf("%ds", r.N)
59 case "milliseconds":
60 return fmt.Sprintf("%dms", r.N)
61 default:
62 return "<invalid>"
63 }
64}
65
66// SetRefreshInterval sets the time interval at which a plugin should be re-run.
67func SetRefreshInterval(pluginDirectory, installedPluginPath string, refreshInterval RefreshInterval) (string, RefreshInterval, error) {

Callers 7

runFunction · 0.80
runInTerminalMethod · 0.80
refreshMethod · 0.80
fetchPluginMethod · 0.80
actionShellFunction · 0.80
SetRefreshIntervalFunction · 0.80

Calls

no outgoing calls

Tested by 1