remove Emoji func; add FontAwesome func
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
1579e3b48d
commit
433cfda295
|
@ -51,7 +51,7 @@ func main() {
|
|||
|
||||
func CreateChargingBlock(level int) string {
|
||||
value := fmt.Sprintf("%d%%", level)
|
||||
symbol := r.Emoji(emoji.UpArrow)
|
||||
symbol := string(emoji.UpArrow)
|
||||
options := r.NewBlockOptions()
|
||||
options.FullText = r.TextWithPadding(fmt.Sprintf("%s %s", value, symbol), CreateFB(level))
|
||||
|
||||
|
@ -62,7 +62,7 @@ func CreateChargingBlock(level int) string {
|
|||
|
||||
func CreateDischargingBlock(level int) string {
|
||||
value := fmt.Sprintf("%d%%", level)
|
||||
symbol := r.Emoji(emoji.DownArrow)
|
||||
symbol := string(emoji.DownArrow)
|
||||
|
||||
block := r.Block("battery", r.BlockOptions{
|
||||
FullText: r.TextWithPadding(fmt.Sprintf("%s %s", value, symbol), CreateFB(level)),
|
||||
|
|
|
@ -28,7 +28,7 @@ func main() {
|
|||
go runCalendar(&wg)
|
||||
}
|
||||
|
||||
symbol := r.Emoji(emoji.Calendar)
|
||||
symbol := string(emoji.Calendar)
|
||||
date := timefmt.Format(now, argFormat)
|
||||
|
||||
options := r.NewBlockOptions()
|
||||
|
|
|
@ -42,7 +42,7 @@ func main() {
|
|||
body, _ := io.ReadAll(resp.Body)
|
||||
content := string(body)
|
||||
count := strings.Count(content, "<item") + strings.Count(content, "<entry")
|
||||
label := "<span font='FontAwesome'>\uf09e</span>"
|
||||
label := r.FontAwesome("\uf09e")
|
||||
|
||||
fb := r.FB{
|
||||
Foreground: os.Args[4],
|
||||
|
|
|
@ -2,9 +2,8 @@ package rendering
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/enescakir/emoji"
|
||||
)
|
||||
|
||||
func Emoji(e emoji.Emoji) string {
|
||||
return fmt.Sprintf("<span font='FontAwesome'>%s</span>", e)
|
||||
func FontAwesome(str string) string {
|
||||
return fmt.Sprintf(`<span font="FontAwesome">%s</span>`, str)
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ func Text(text string, fb FB) string {
|
|||
fb.Background = Color("default_background")
|
||||
}
|
||||
|
||||
return fmt.Sprintf("<span background='%s' foreground='%s'>%s</span>", fb.Background, fb.Foreground, text)
|
||||
return fmt.Sprintf(`<span background="%s" foreground="%s">%s</span>`, fb.Background, fb.Foreground, text)
|
||||
}
|
||||
|
||||
func TextWithPadding(text string, fb FB) string {
|
||||
|
|
Loading…
Reference in a new issue