25 lines
495 B
Go
25 lines
495 B
Go
|
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
|
||
|
}
|