|
@@ -1,7 +1,10 @@
|
|
package main
|
|
package main
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "os"
|
|
|
|
+ "os/exec"
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "log"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
// bar
|
|
// bar
|
|
@@ -42,11 +45,11 @@ func (bar *ScreenBar) update() {
|
|
// Go home and draw (type) a bar
|
|
// Go home and draw (type) a bar
|
|
fmt.Print("[H[2J[3J")
|
|
fmt.Print("[H[2J[3J")
|
|
fmt.Print("[0;37;40m")
|
|
fmt.Print("[0;37;40m")
|
|
- s := fmt.Sprintf(" %%%ds %%6d ", 9-bar.columns)
|
|
|
|
|
|
+ s := fmt.Sprintf(" %%%ds %%6d ", 10-bar.columns)
|
|
fmt.Printf(s, bar.title, bar.ticks)
|
|
fmt.Printf(s, bar.title, bar.ticks)
|
|
fmt.Print("[0m")
|
|
fmt.Print("[0m")
|
|
|
|
|
|
- // An attempt to display Screenbar using kitty image protocol
|
|
|
|
|
|
+ // An attempt to display Screenbar button using kitty image protocol
|
|
cmd := exec.Command("sh", "-c", fmt.Sprintf("kitten icat -z -1 -n --place 2x1@%dx0 --stdin no images/bar_button.png < /dev/null > /dev/tty", bar.columns))
|
|
cmd := exec.Command("sh", "-c", fmt.Sprintf("kitten icat -z -1 -n --place 2x1@%dx0 --stdin no images/bar_button.png < /dev/null > /dev/tty", bar.columns))
|
|
if out, err := cmd.Output(); err != nil {
|
|
if out, err := cmd.Output(); err != nil {
|
|
os.Stdout.Write(out)
|
|
os.Stdout.Write(out)
|