2023-08-17 23:10:09 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.akyoto.dev/cli/dash/clock"
|
|
|
|
"git.akyoto.dev/cli/dash/editor"
|
2023-08-18 11:17:46 +00:00
|
|
|
//"git.akyoto.dev/cli/dash/empty"
|
2023-08-17 23:10:09 +00:00
|
|
|
"git.akyoto.dev/cli/dash/osinfo"
|
|
|
|
"github.com/gdamore/tcell/v2"
|
|
|
|
"github.com/rivo/tview"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
app := tview.NewApplication()
|
|
|
|
|
|
|
|
header := clock.New(app)
|
|
|
|
main := editor.New(app)
|
|
|
|
footer := osinfo.New(app)
|
2023-08-18 11:17:46 +00:00
|
|
|
//left := empty.New(app)
|
|
|
|
//right := empty.New(app)
|
2023-08-17 23:10:09 +00:00
|
|
|
|
|
|
|
grid := tview.NewGrid()
|
|
|
|
grid.SetRows(3, 0, 3)
|
|
|
|
grid.SetColumns(0, 80, 0)
|
|
|
|
grid.SetBorders(false)
|
|
|
|
grid.SetBackgroundColor(tcell.ColorDefault)
|
|
|
|
|
|
|
|
grid.AddItem(header, 0, 0, 1, 3, 0, 0, false)
|
2023-08-18 11:17:46 +00:00
|
|
|
grid.AddItem(main, 1, 1, 1, 1, 0, 0, false)
|
2023-08-17 23:10:09 +00:00
|
|
|
grid.AddItem(footer, 2, 0, 1, 3, 0, 0, false)
|
|
|
|
|
|
|
|
// Layout for screens narrower than 100 cells (menu and side bar are hidden).
|
2023-08-18 11:17:46 +00:00
|
|
|
//grid.AddItem(left, 0, 0, 0, 0, 0, 0, false)
|
|
|
|
//grid.AddItem(main, 1, 0, 1, 3, 0, 0, false)
|
|
|
|
//grid.AddItem(right, 0, 0, 0, 0, 0, 0, false)
|
2023-08-17 23:10:09 +00:00
|
|
|
|
2023-08-18 11:17:46 +00:00
|
|
|
// Layout for screens wider than 80 cells.
|
|
|
|
//grid.AddItem(left, 1, 0, 1, 1, 0, 80, false)
|
|
|
|
//grid.AddItem(main, 1, 1, 1, 1, 0, 80, false)
|
|
|
|
//grid.AddItem(right, 1, 2, 1, 1, 0, 80, false)
|
2023-08-17 23:10:09 +00:00
|
|
|
|
2023-08-18 11:17:46 +00:00
|
|
|
app.EnableMouse(true)
|
2023-08-17 23:10:09 +00:00
|
|
|
app.SetRoot(grid, true)
|
|
|
|
app.SetFocus(main)
|
|
|
|
|
|
|
|
err := app.Run()
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|