Steven Nyeo


 


 


Steven Nyeo










My Bitcoin Wallet
Bitcoin Address
Address: 171jqum72kWrUD5sBVbVRXXiyshwiWAvw2

 

backlight_c: A lightweight alternative to Xbacklight

Posted on 10.09.2020

I have recently written a mini-program in C to deal with the backlight problem on my new Thinkpad E15 Gen 2 laptop. It's a simple program that utilizes sysfs to change the backlight so I could use the Fn keys to adjust the laptop's screen brightness again.

I had to create this program since Xbacklight could not detect the backlight property using the RandR extension. I am not sure why Xorg cannot register the backlight property, but this program is the quickest approach to replacing Xbacklight functionality. To eliminate the Xorg overhead, I directly read from and wrote to the file in charge of the brightness value, which seems to be much straightforward than going through the Xorg X server.

As of right now, the source code is hard-coded with AMDGPU configurations. The makefile also directly adds the setuid bit to the compiled binary to work for non-root users. I am hoping to update these parts to make them more configurable.

The link to the source code is provided below. Any constructive comments and suggestions are welcome!

https://github.com/limpingstone/backlight_c

 

 

Recent Posts

MiniOS Tutorial: A tutorial to build a 64-bit OS
— 12.18.2020
backlight_c: A lightweight alternative to Xbacklight
— 10.09.2020
Characters in The Man in the High Castle
— 09.18.2020
Evening Bird Outside of Window Sill
— 09.08.2020
Difference Between Ti and Te in Teaching Styles
— 09.07.2020

Some Numbers!