These authors suggest that attention plays an important role in creating boredom. In particular, there are a few conditions that need to be met for people to feel bored. First, people need to have a reasonable level of psychological energy or arousal to feel bored. When people have low arousal and there is not much happening in the world, then they often feel relaxed. When they have high arousal, though, they have energy they would like to devote to something, but they cannot find anything engaging.
Martin Heidegger wrote about boredom in two texts available in English, in the 1929/30 semester lecture course The Fundamental Concepts of Metaphysics, and again in the essay What is Metaphysics? published in the same year. In the lecture, Heidegger included about 100 pages on boredom, probably the most extensive philosophical treatment ever of the subject. He focused on waiting at railway stations in particular as a major context of boredom. Søren Kierkegaard remarks in Either/Or that "patience cannot be depicted" visually, since there is a sense that any immediate moment of life may be fundamentally tedious.
The French loanword ennui comes from the very same Late Latin word that gave us annoy — inodiare ("to make loathsome"). We borrowed ennui several centuries after absorbing annoy into the language. Ennui deals more with boredom than irritation - and a somewhat specific sort of boredom at that. It generally refers to the feeling of jadedness that can result from living a life of too much ease. The poet Charles Lloyd described it well in his 1823 Stanzas to Ennui when he referred to that world-weary sensation as a "soul-destroying fiend" which visits with its "pale unrest / The chambers of the human breast / Where too much happiness hath fixed its home."