forked from xtaci/safebox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
53 lines (46 loc) · 1.24 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package main
import (
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
)
// The application.
var app = tview.NewApplication()
// The master key
var masterKey *MasterKey
var (
keyNames = map[tcell.Key]string{
tcell.KeyF1: "F1",
tcell.KeyF2: "F2",
tcell.KeyF3: "F3",
tcell.KeyF4: "F4",
tcell.KeyEsc: "ESC",
tcell.KeyCtrlC: "Ctrl-C",
}
shortCuts = map[tcell.Key]string{
tcell.KeyF1: "GENERATE MASTER KEY",
tcell.KeyF2: "LOAD MASTER KEY",
tcell.KeyEsc: "BACK",
tcell.KeyCtrlC: "QUIT",
}
)
var theme = tview.Theme{
PrimitiveBackgroundColor: tcell.ColorWhite,
ContrastBackgroundColor: tcell.ColorBlue,
MoreContrastBackgroundColor: tcell.ColorGreen,
BorderColor: tcell.ColorBlack,
TitleColor: tcell.ColorRed,
GraphicsColor: tcell.ColorBlack,
PrimaryTextColor: tcell.ColorBlack,
SecondaryTextColor: tcell.ColorBlack,
TertiaryTextColor: tcell.ColorGreen,
InverseTextColor: tcell.ColorBlue,
ContrastSecondaryTextColor: tcell.ColorDarkCyan,
}
func main() {
tview.Styles = theme
initLayouts()
// Start the application and set root to Cover
if err := app.SetRoot(root, true).Run(); err != nil {
panic(err)
}
}