add callback option

This commit is contained in:
Simon Vieille 2024-08-01 22:47:26 +02:00
commit d11d8c7f87
Signed by: deblan
GPG key ID: 579388D585F70417
5 changed files with 52 additions and 6 deletions

19
callback.go Normal file
View file

@ -0,0 +1,19 @@
package main
import (
"os"
"os/exec"
)
func CallbackUpdateWallpapers(callback string, files, screens []string) (*exec.Cmd, error) {
args := []string{}
for key, file := range files {
args = append(args, screens[key], file)
}
cmd := exec.Command(callback, args...)
cmd.Env = os.Environ()
return cmd, cmd.Run()
}