Using C in Linux, would it be possible to change the brightness of the viewing screen? This isn't expected to be portable other than running on my installs of Ubuntu and Fedora. I'm asking about how I would interface with the os to change the brightness.
相关问题
- Multiple sockets for clients to connect to
- Is shmid returned by shmget() unique across proces
- What is the best way to do a search in a large fil
- glDrawElements only draws half a quad
- how to get running process information in java?
I'd start with selecting from the following list of ubuntu pacakges, the tool that allows you to manage your screen's brightness (hint: it depends on the brand)
Once you have selected it,
should get you on the right track
Check out the xbacklight source. For example, the following code sets the screen brightness to 50%.
Poke
/sys/class/backlight/*/brightness
. Yes, even in C.Yes, but not portably -- you need a platform-specific function, there is nothing in the C standard library.