25 lines
495 B
Go
Raw Normal View History

2023-08-17 23:10:09 +00:00
package osinfo
import (
"os/exec"
"strings"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
)
func New(app *tview.Application) *tview.TextView {
view := tview.NewTextView()
view.SetTextAlign(tview.AlignCenter)
view.SetBackgroundColor(tcell.ColorDefault)
view.SetBorderPadding(1, 1, 1, 1)
out, _ := exec.Command("lsb_release", "-sd").Output()
distro := string(out)
distro = strings.TrimSpace(distro)
distro = strings.Trim(distro, "\"")
view.SetText(distro)
return view
}