Just as David Bowie did with his death-centered final album “Black Star,” the character actor Harry Dean Stanton, who died last month, has left behind a valedictory of sorts: A quietly lyrical last movie, “Lucky.”

Stanton plays the title character, a 90-year-old man living alone in a small town in the desert Southwest. Lucky has a set morning routine: Shower and shave, brush his teeth, make coffee, do some yoga, walk to the diner, trade insults with the owner, Joe (Barry Shabaka Henley), fill in part of his crossword puzzle, walk down Main Street, shout an obscenity at a storefront (for reasons explained eventually), go back to his house and watch his stories.

His evening routine isn’t much different. He usually hangs out at the local bar, owned by the tough-talking Elaine (Beth Grant). He listens to stories from Elaine’s longtime boyfriend, Paulie (James Darren). He also sees his best friend, Howard (played by David Lynch, who just featured Stanton on his revival of “Twin Peaks”). On this day, Howard is lamenting the departure of his pet tortoise, President Roosevelt, who escaped when Howard left the gate open too long.

Throughout his days, Lucky ponders the little nuggets of wisdom that fall his way. He looks up the dictionary definition of “realism,” which is “the act of seeing something for what it is, and being prepared to deal with it accordingly.” Lucky, an atheist who gets a reasonably clean bill of health from his doctor (Ed Begley Jr.) after a kitchen fall, would seem to be the embodiment of that definition.

Character actor John Carroll Lynch (he played LBJ in “Jackie”) makes a touching directorial debut here, working off a script by Logan Sparks and Drago Sumonja that feels tailor-made for Stanton’s life and talents. The movie plays up Stanton’s surface irascibility but also his underlying tenderness.

There’s a nice moment where Lucky, a former Navy man, compares World War II experiences with an old Marine veteran (Tom Skerritt, who co-starred with Stanton in “Alien” back in 1979). And there’s a heartbreaking scene at a Latina neighbor’s fiesta, where he sings a plaintive Mexican ballad and the mariachi band joins in behind him.

All these moments are held together by Stanton, who gets to have the final word on his career. The opening credits read “Harry Dean Stanton is Lucky,” and it’s clear throughout the film that he was, and so were we.

* * * 1/2

Lucky

In his final role, Harry Dean Stanton gets the lead and a chance to sum up his thoughts on life.

Where • Broadway Centre Cinemas (Salt Lake City).

When • Opens Friday, Oct. 13.

Rating • Not rated, but probably R for language.

Running time • 88 minutes.