Add functions for current status and metadata

This commit is contained in:
Elara 2021-08-23 10:07:11 -07:00
parent cd3daa5848
commit 032147ae61

View File

@ -89,3 +89,19 @@ func Status(onChange func(bool)) error {
}
return nil
}
func CurrentMetadata(key string) (string, error) {
out, err := exec.Command("playerctl", "metadata", key).Output()
if err != nil {
return "", err
}
return string(out), nil
}
func CurrentStatus() (string, error) {
out, err := exec.Command("playerctl", "status").Output()
if err != nil {
return "", err
}
return string(out), nil
}