32 lines
653 B
Go
32 lines
653 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"github.com/enescakir/emoji"
|
|
"github.com/itchyny/timefmt-go"
|
|
r "gitnet.fr/deblan/i3-blocks-go/rendering"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
argFormat := flag.String("format", "%H:%M:%S %m-%d-%Y", "time format")
|
|
flag.Parse()
|
|
symbol := string(emoji.Calendar)
|
|
|
|
for {
|
|
now := time.Now()
|
|
date := timefmt.Format(now, *argFormat)
|
|
|
|
options := r.NewBlockOptions()
|
|
options.FullText = r.TextWithRightPadding(fmt.Sprintf("%s %s", symbol, date), r.FB{
|
|
Foreground: r.Color("white"),
|
|
Background: r.Color("black4"),
|
|
})
|
|
|
|
block := r.Block("date", options)
|
|
fmt.Println(block)
|
|
time.Sleep(time.Millisecond * 500)
|
|
}
|
|
}
|