update config structure and cleanup
This commit is contained in:
parent
2cde9df163
commit
f435b4eb82
16
README.md
16
README.md
@ -16,9 +16,21 @@ go run cmd/tui/main.go
|
|||||||
|
|
||||||
### cmd
|
### cmd
|
||||||
|
|
||||||
- future command line application structure using cobra in cli folder
|
- entrypoint for our application with main.go
|
||||||
- tui in tui folder, makes sense huh
|
|
||||||
|
|
||||||
### internal
|
### internal
|
||||||
|
|
||||||
- code that is not reusable and we don't want to share it with others, maybe parts of code in cmd will be moved here instead
|
- code that is not reusable and we don't want to share it with others, maybe parts of code in cmd will be moved here instead
|
||||||
|
- tui and cli logic
|
||||||
|
|
||||||
|
### configs
|
||||||
|
|
||||||
|
- example of configuration
|
||||||
|
|
||||||
|
### vendor
|
||||||
|
|
||||||
|
- localy downloaded libraries and imports
|
||||||
|
|
||||||
|
```shell
|
||||||
|
go mod vendor
|
||||||
|
```
|
||||||
|
|||||||
29
cmd/main.go
Normal file
29
cmd/main.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"whspbrd/pkg/cell_size"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
//systray.Systray()
|
||||||
|
// and here is agrid making a grid of images
|
||||||
|
//for i := 0; i < 10; i++ {
|
||||||
|
// for j := 0; j < 10; j++ {
|
||||||
|
// render_image.RenderImage("kogami-pf-edit.jpg", i*3+2, j*7+23, 64, 64)
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//render_image.RenderImage("kogami-pf-edit.jpg", 0, 3, 750, 0)
|
||||||
|
|
||||||
|
w, h, err := cell_size.GetTerminalCellSizePixels()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Error getting terminal cell size:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
width, height := cell_size.GetConsoleSize()
|
||||||
|
|
||||||
|
fmt.Println("Terminal cell size in pixels:", w, "x", h)
|
||||||
|
fmt.Println("Console size in characters:", width, "x", height)
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
11
docs/TASKS_TO_BE_SOLVED.md
Normal file
11
docs/TASKS_TO_BE_SOLVED.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# List of task to solve
|
||||||
|
|
||||||
|
- [ ] Emoji input support
|
||||||
|
- [x] Image rendering (gif)
|
||||||
|
- [ ] Style highlighting (**Bold**, ...)
|
||||||
|
- [x] Rerender on scale change, to see images
|
||||||
|
- [ ] ImageMagick files like profile pictures
|
||||||
|
- [ ] Load chat and scroll through it
|
||||||
|
- [ ] File picker on Windows and Linux to upload files and images
|
||||||
|
- [ ] System tray launcher
|
||||||
|
- [ ] Scrolling with images
|
||||||
@ -1,14 +1,14 @@
|
|||||||
package main
|
package tui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
_ "image/jpeg"
|
_ "image/jpeg"
|
||||||
_ "image/png"
|
_ "image/png"
|
||||||
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/jroimartin/gocui"
|
"github.com/jroimartin/gocui"
|
||||||
//"whspbrd/pkg/systray"
|
//"whspbrd/pkg/systray"
|
||||||
"whspbrd/pkg/cell_size"
|
|
||||||
"whspbrd/pkg/render_image"
|
"whspbrd/pkg/render_image"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -193,40 +193,20 @@ func quit(g *gocui.Gui, v *gocui.View) error {
|
|||||||
return gocui.ErrQuit
|
return gocui.ErrQuit
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func Run() {
|
||||||
//systray.Systray()
|
g, err := gocui.NewGui(gocui.OutputNormal)
|
||||||
//g, err := gocui.NewGui(gocui.OutputNormal)
|
|
||||||
//if err != nil {
|
|
||||||
// log.Panicln(err)
|
|
||||||
//}
|
|
||||||
//defer g.Close()
|
|
||||||
//
|
|
||||||
//g.SetManagerFunc(layout)
|
|
||||||
//
|
|
||||||
//if err := keybindings(g); err != nil {
|
|
||||||
// log.Panicln(err)
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//if err := g.MainLoop(); err != nil && err != gocui.ErrQuit {
|
|
||||||
// log.Panicln(err)
|
|
||||||
//}
|
|
||||||
// and here is agrid making a grid of images
|
|
||||||
//for i := 0; i < 10; i++ {
|
|
||||||
// for j := 0; j < 10; j++ {
|
|
||||||
// render_image.RenderImage("kogami-pf-edit.jpg", i*3+2, j*7+23, 64, 64)
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//render_image.RenderImage("kogami-pf-edit.jpg", 0, 3, 750, 0)
|
|
||||||
|
|
||||||
w, h, err := cell_size.GetTerminalCellSizePixels()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error getting terminal cell size:", err)
|
log.Panicln(err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
width, height := cell_size.GetConsoleSize()
|
defer g.Close()
|
||||||
|
|
||||||
fmt.Println("Terminal cell size in pixels:", w, "x", h)
|
g.SetManagerFunc(layout)
|
||||||
fmt.Println("Console size in characters:", width, "x", height)
|
|
||||||
|
|
||||||
|
if err := keybindings(g); err != nil {
|
||||||
|
log.Panicln(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := g.MainLoop(); err != nil && err != gocui.ErrQuit {
|
||||||
|
log.Panicln(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user