2025-09-25 10:45:27 +03:00

25 lines
529 B
Go

package plymouth
import (
"fmt"
"os/exec"
"strconv"
)
func ShowPlymouthMessage(message string) {
cmd := exec.Command("plymouth", "update", "--status=\""+message+"\"")
if err := cmd.Run(); err != nil {
fmt.Println(message)
}
}
func ShowPlymouthProgress(progress int) {
if progress < 100 && progress > 0 {
progressStr := strconv.Itoa(progress)
cmd := exec.Command("plymouth", "system-update", "--progress="+progressStr+"\"")
if err := cmd.Run(); err != nil {
fmt.Printf("Progress: %s%%", progressStr)
}
}
}