i3-wallpaper-manager/callback.go

19 lines
325 B
Go

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()
}