update config structure and cleanup

This commit is contained in:
foglar 2025-06-02 19:01:07 +02:00
parent 2cde9df163
commit f435b4eb82
7 changed files with 71 additions and 36 deletions

View File

@ -16,9 +16,21 @@ go run cmd/tui/main.go
### cmd
- future command line application structure using cobra in cli folder
- tui in tui folder, makes sense huh
- entrypoint for our application with main.go
### 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
- tui and cli logic
### configs
- example of configuration
### vendor
- localy downloaded libraries and imports
```shell
go mod vendor
```

29
cmd/main.go Normal file
View 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)
}

View File

@ -0,0 +1,3 @@
{
}

View File

View 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

View File

@ -1,14 +1,14 @@
package main
package tui
import (
"fmt"
_ "image/jpeg"
_ "image/png"
"log"
"strings"
"github.com/jroimartin/gocui"
//"whspbrd/pkg/systray"
"whspbrd/pkg/cell_size"
"whspbrd/pkg/render_image"
)
@ -193,40 +193,20 @@ func quit(g *gocui.Gui, v *gocui.View) error {
return gocui.ErrQuit
}
func main() {
//systray.Systray()
//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()
func Run() {
g, err := gocui.NewGui(gocui.OutputNormal)
if err != nil {
fmt.Println("Error getting terminal cell size:", err)
return
log.Panicln(err)
}
width, height := cell_size.GetConsoleSize()
defer g.Close()
fmt.Println("Terminal cell size in pixels:", w, "x", h)
fmt.Println("Console size in characters:", width, "x", height)
g.SetManagerFunc(layout)
if err := keybindings(g); err != nil {
log.Panicln(err)
}
if err := g.MainLoop(); err != nil && err != gocui.ErrQuit {
log.Panicln(err)
}
}