My laptop has some sort of adaptive brightness/dimming feature, and while it isn't an issue on Windows, Ubuntu uses the feature and almost gives me epilepsy. Every other second, the screen either dims or becomes slightly brighter. Sometimes I am writing and it just goes from super bright to almost pitch black. I was playing EU4 recently and the screen just went black, like if it turned off (the light in my room is dark, but not that dark).
My computer is running Ubuntu 18.04, is an asus zenbook ux303ln, with an intel hd and a gt 940m.
How to fix this issue?