forked from Elara6331/infinitime
Add functions for current status and metadata
This commit is contained in:
parent
9553844896
commit
75121b709c
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user