1
0
mirror of https://github.com/taigrr/wtf synced 2026-03-22 19:22:18 -07:00

WTF-400 CmdRunner extracted to new config format

This commit is contained in:
Chris Cummer
2019-04-13 18:59:39 -07:00
parent 37356679cc
commit 73e0e18ebc
5 changed files with 37 additions and 9 deletions

View File

@@ -12,17 +12,19 @@ import (
type Widget struct {
wtf.TextWidget
args []string
cmd string
result string
args []string
cmd string
result string
settings *Settings
}
func NewWidget(app *tview.Application) *Widget {
func NewWidget(app *tview.Application, settings *Settings) *Widget {
widget := Widget{
TextWidget: wtf.NewTextWidget(app, "CmdRunner", "cmdrunner", false),
args: wtf.ToStrs(wtf.Config.UList("wtf.mods.cmdrunner.args")),
cmd: wtf.Config.UString("wtf.mods.cmdrunner.cmd"),
args: settings.args,
cmd: settings.cmd,
settings: settings,
}
widget.View.SetWrap(true)