Home Depot and Lowe’s are trying to capitalize on more consumers switching to battery-powered tools for landscaping lawns, golf courses and parks.