Walt whitman was shot by a local with his own rifle. There were people at the Luby’s that left their guns in the car because it was illegal to carry inside the restaurant.
You're probably thinking of Charles Whitman.
Walt Whitman died of complications due to pneumonia, in his own bed.
I make no comment regarding what he deserved due to his poetry ...