mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Fixing merge conflict
This commit is contained in:
commit
5ff80f309a
@ -16,7 +16,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" 👽 BambooHR ", "bamboohr", false),
|
||||
TextWidget: wtf.NewTextWidget(" BambooHR ", "bamboohr", false),
|
||||
}
|
||||
|
||||
return &widget
|
||||
@ -37,7 +37,7 @@ func (widget *Widget) Refresh() {
|
||||
)
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetTitle(fmt.Sprintf(" 👽 Away (%d) ", len(todayItems)))
|
||||
widget.View.SetTitle(fmt.Sprintf("%s(%d)", widget.Name, len(todayItems)))
|
||||
|
||||
widget.View.SetText(fmt.Sprintf("%s", widget.contentFrom(todayItems)))
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" 🕗 World Clocks ", "clocks", false),
|
||||
TextWidget: wtf.NewTextWidget(" World Clocks ", "clocks", false),
|
||||
}
|
||||
|
||||
widget.clockColl = widget.buildClockCollection(Config.UMap("wtf.mods.clocks.locations"))
|
||||
|
@ -22,7 +22,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" 🏃 Runner ", "cmdrunner", false),
|
||||
TextWidget: wtf.NewTextWidget(" CmdRunner ", "cmdrunner", false),
|
||||
|
||||
args: wtf.ToStrs(Config.UList("wtf.mods.cmdrunner.args")),
|
||||
cmd: Config.UString("wtf.mods.cmdrunner.cmd"),
|
||||
|
@ -3,9 +3,8 @@ package cryptolive
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/olebedev/config"
|
||||
"github.com/senorprogrammer/wtf/wtf"
|
||||
@ -32,7 +31,7 @@ type Widget struct {
|
||||
func NewWidget() *Widget {
|
||||
started = false
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" $ CryptoLive ", "cryptolive", false),
|
||||
TextWidget: wtf.NewTextWidget(" CryptoLive ", "cryptolive", false),
|
||||
updateInterval: Config.UInt("wtf.mods.cryptolive.updateInterval", 10),
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" 🍿 Calendar ", "gcal", false),
|
||||
TextWidget: wtf.NewTextWidget(" Calendar ", "gcal", false),
|
||||
}
|
||||
|
||||
return &widget
|
||||
|
@ -17,7 +17,7 @@ func (widget *Widget) display() {
|
||||
}
|
||||
|
||||
title := fmt.Sprintf("[green]%s[white]\n", repoData.Repository)
|
||||
widget.View.SetTitle(fmt.Sprintf(" Git: %s ", title))
|
||||
widget.View.SetTitle(fmt.Sprintf("%s- %s", widget.Name, title))
|
||||
|
||||
str := wtf.SigilStr(len(widget.Data), widget.Idx, widget.View) + "\n"
|
||||
str = str + " [red]Branch[white]\n"
|
||||
|
@ -14,7 +14,7 @@ func (widget *Widget) display() {
|
||||
return
|
||||
}
|
||||
|
||||
widget.View.SetTitle(fmt.Sprintf(" Github: %s ", widget.title(repo)))
|
||||
widget.View.SetTitle(fmt.Sprintf("%s- %s", widget.Name, widget.title(repo)))
|
||||
|
||||
str := wtf.SigilStr(len(widget.GithubRepos), widget.Idx, widget.View) + "\n"
|
||||
str = str + " [red]Stats[white]\n"
|
||||
|
@ -16,7 +16,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget("JIRA", "jira", false),
|
||||
TextWidget: wtf.NewTextWidget(" Jira ", "jira", false),
|
||||
}
|
||||
|
||||
return &widget
|
||||
@ -41,7 +41,7 @@ func (widget *Widget) Refresh() {
|
||||
widget.View.SetWrap(false)
|
||||
widget.View.SetTitle(
|
||||
fmt.Sprintf(
|
||||
" %s: [green]%s[white] ",
|
||||
"%s- [green]%s[white]",
|
||||
widget.Name,
|
||||
Config.UString("wtf.mods.jira.project"),
|
||||
),
|
||||
|
@ -39,7 +39,7 @@ func (widget *Widget) Refresh() {
|
||||
}
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetTitle(fmt.Sprintf(" New Relic: [green]%s[white] ", appName))
|
||||
widget.View.SetTitle(fmt.Sprintf("%s- [green]%s[white]", widget.Name, appName))
|
||||
widget.View.Clear()
|
||||
|
||||
if depErr != nil {
|
||||
|
@ -17,7 +17,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" ⏰ OpsGenie ", "opsgenie", false),
|
||||
TextWidget: wtf.NewTextWidget(" OpsGenie ", "opsgenie", false),
|
||||
}
|
||||
|
||||
return &widget
|
||||
@ -33,7 +33,7 @@ func (widget *Widget) Refresh() {
|
||||
data, err := Fetch()
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetTitle(" ⏰ On Call ")
|
||||
widget.View.SetTitle(widget.Name)
|
||||
|
||||
if err != nil {
|
||||
widget.View.SetWrap(true)
|
||||
|
@ -18,7 +18,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" ⚡️ Power ", "power", false),
|
||||
TextWidget: wtf.NewTextWidget(" Power ", "power", false),
|
||||
Battery: NewBattery(),
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,6 @@ func (widget *Widget) Refresh() {
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.prettyWeather()
|
||||
widget.View.SetTitle(fmt.Sprintf(" %s ", widget.Name))
|
||||
|
||||
widget.View.SetText(fmt.Sprintf("%s", widget.result))
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" 🤺 Security ", "security", false),
|
||||
TextWidget: wtf.NewTextWidget(" Security ", "security", false),
|
||||
}
|
||||
|
||||
return &widget
|
||||
|
@ -18,7 +18,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" 🎉 Status ", "status", false),
|
||||
TextWidget: wtf.NewTextWidget(" Status ", "status", false),
|
||||
CurrentIcon: 0,
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget(date, version string) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" Build ", "system", false),
|
||||
TextWidget: wtf.NewTextWidget(" System ", "system", false),
|
||||
|
||||
Date: date,
|
||||
Version: version,
|
||||
|
@ -30,7 +30,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" 📄 Text File ", "textfile", true),
|
||||
TextWidget: wtf.NewTextWidget(" Text File ", "textfile", true),
|
||||
|
||||
app: app,
|
||||
filePath: Config.UString("wtf.mods.textfile.filePath"),
|
||||
@ -53,7 +53,7 @@ func (widget *Widget) Refresh() {
|
||||
}
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetTitle(fmt.Sprintf(" 📄 %s ", widget.filePath))
|
||||
widget.View.SetTitle(fmt.Sprintf("%s %s", widget.Name, widget.filePath))
|
||||
|
||||
filePath, _ := wtf.ExpandHomeDir(widget.filePath)
|
||||
|
||||
|
@ -44,7 +44,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" 📝 Todo ", "todo", true),
|
||||
TextWidget: wtf.NewTextWidget(" Todo ", "todo", true),
|
||||
|
||||
app: app,
|
||||
filePath: Config.UString("wtf.mods.todo.filename"),
|
||||
|
11
wtf.go
11
wtf.go
@ -155,9 +155,12 @@ var (
|
||||
)
|
||||
|
||||
func makeWidgets(app *tview.Application, pages *tview.Pages) {
|
||||
// Always in alphabetical order
|
||||
bamboohr.Config = Config
|
||||
clocks.Config = Config
|
||||
cmdrunner.Config = Config
|
||||
wtf.Config = Config
|
||||
cryptolive.Config = Config
|
||||
gcal.Config = Config
|
||||
git.Config = Config
|
||||
github.Config = Config
|
||||
@ -166,20 +169,21 @@ func makeWidgets(app *tview.Application, pages *tview.Pages) {
|
||||
newrelic.Config = Config
|
||||
opsgenie.Config = Config
|
||||
power.Config = Config
|
||||
prettyweather.Config = Config
|
||||
security.Config = Config
|
||||
status.Config = Config
|
||||
system.Config = Config
|
||||
textfile.Config = Config
|
||||
todo.Config = Config
|
||||
weather.Config = Config
|
||||
prettyweather.Config = Config
|
||||
wtf.Config = Config
|
||||
cryptolive.Config = Config
|
||||
|
||||
// Always in alphabetical order
|
||||
Widgets = []wtf.Wtfable{
|
||||
bamboohr.NewWidget(),
|
||||
clocks.NewWidget(),
|
||||
cmdrunner.NewWidget(),
|
||||
cryptolive.NewWidget(),
|
||||
gcal.NewWidget(),
|
||||
git.NewWidget(app, pages),
|
||||
github.NewWidget(app, pages),
|
||||
@ -188,14 +192,13 @@ func makeWidgets(app *tview.Application, pages *tview.Pages) {
|
||||
newrelic.NewWidget(),
|
||||
opsgenie.NewWidget(),
|
||||
power.NewWidget(),
|
||||
prettyweather.NewWidget(),
|
||||
security.NewWidget(),
|
||||
status.NewWidget(),
|
||||
system.NewWidget(date, version),
|
||||
textfile.NewWidget(app, pages),
|
||||
todo.NewWidget(app, pages),
|
||||
weather.NewWidget(app, pages),
|
||||
cryptolive.NewWidget(),
|
||||
prettyweather.NewWidget(),
|
||||
}
|
||||
|
||||
FocusTracker = wtf.FocusTracker{
|
||||
|
@ -27,7 +27,7 @@ func NewTextWidget(name string, configKey string, focusable bool) TextWidget {
|
||||
enabled: Config.UBool(fmt.Sprintf("wtf.mods.%s.enabled", configKey), false),
|
||||
focusable: focusable,
|
||||
|
||||
Name: name,
|
||||
Name: Config.UString(fmt.Sprintf("wtf.mods.%s.title", configKey), name),
|
||||
RefreshInt: Config.UInt(fmt.Sprintf("wtf.mods.%s.refreshInterval", configKey)),
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user