32 lines
573 B
Go
32 lines
573 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/enescakir/emoji"
|
|
"github.com/itchyny/timefmt-go"
|
|
r "gitnet.fr/deblan/i3-blocks-go/rendering"
|
|
"os"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
argFormat := os.Args[1]
|
|
now := time.Now()
|
|
|
|
if os.Getenv("BLOCK_BUTTON") == "1" {
|
|
}
|
|
|
|
symbol := r.Emoji(emoji.Calendar)
|
|
date := timefmt.Format(now, argFormat)
|
|
|
|
options := r.NewBlockOptions()
|
|
options.FullText = r.TextWithPadding(fmt.Sprintf("%s %s", symbol, date), r.FB{
|
|
Foreground: r.Color("white"),
|
|
Background: r.Color("black4"),
|
|
})
|
|
|
|
block := r.Block("date", options)
|
|
|
|
fmt.Println(block)
|
|
}
|