You know what's boring?
Running on a treadmill is boring!
Riding a bike on a trainer is boring!
I swim 2000 meters in the morning at my local YMCA six days a week. I don't find it boring. There is a lot of stuff to work on.
I will forever be trying to perfect my flip turn. I have to go into a tight tuck. I have to be the perfect distance from the wall to get a good push off. I have to exit the turn facing the ceiling.
I will also always be working on my proficiency at breathing on the right, on the left, and bilaterally.
I keep track of my laps by varying the side I breath on. I do this in groups of five. I breath on the right for laps one and three, on the left for laps two and four, and bilaterally for lap five.
I have friends who bring all manner of swim toys - pull buoys, shorty fins, kick boards, centerline snorkels .... They do all the exercises, but it doesn't seem to make them faster.
I prefer to just swim my laps. My counting system works well enough that I can let my mind wander without immediately losing count.
Regarding the boredom of riding a bike on a trainer, try rollers instead. That's always exciting, especially when you fall off.
I regret I don't have a good solution for the boredom of running on a treadmill.