eyenseo
6eb9418685
Fix save and restore arguments
Without this patch -O and -I are not supported anymore and lead to an
error.
před 6 roky
Abdullah ibn Nadjo
f62503b299
Fix different kinds of issues with string buffers and pointers
- Use NAME_MAX and PATH_MAX instead of hardcoded values
- Allow paths to be longer than 256 chars
- Check pointers everywhere
- Use strncpy/snprintf instead of strcpy/sprintf
- Validate controllers' name (-s flag + a very long name -> bad things happening)
- Get rid of globals for dir iteration
před 6 roky
Abdullah ibn Nadjo
fa2fba14a6
Fix overflow of raw values < 0
- Rewrite of all clamp operations
- Get rid of unreachable code (the 'else' in the last chunk)
před 6 roky
Abdullah ibn Nadjo
c363ac40a1
Check if specified operation is valid for the wanted field
před 6 roky
Abdullah ibn Nadjo
9032c14237
Print errors to stderr
před 6 roky
Abdullah ibn Nadjo
0ecb5353aa
Don't forget to init variables
před 6 roky
Abdullah ibn Nadjo
bcaa7df99b
Don't try to read brightness values when only targetting max bright.
před 6 roky
Abdullah ibn Nadjo
cd70ff5e01
Create a flag category only for backlight/kbd
Now we can save, restore, get [max] brightness etc. for both screen
and keyboard controllers
před 6 roky
Abdullah ibn Nadjo
6180bb3f5c
Logging of clamps, saves and restores
před 6 roky
Abdullah ibn Nadjo
f288657500
Rewrite light_execute for readability and avoiding unnecessary oper.
před 6 roky
Abdullah ibn Nadjo
6860e111a5
Cache max brightness data from automatic controller detection
před 6 roky
Abdullah ibn Nadjo
9fda8acac0
Improve light folder checking readability
před 6 roky
Abdullah ibn Nadjo
ccff2b57cd
Improve overall logging
před 6 roky
Abdullah ibn Nadjo
55fe7a9eaf
Don't check unsigned int about negative values
před 6 roky
Abdullah ibn Nadjo
9f9d6ae447
Fix wrong behavior of 'light_controllerAccessible'
This function was:
- Reading values from the controller
- Checking write permission even when we just want reading values
- Checking the mincap file instead of the actual controller
The last one is also true for other functions using
'light_getBrightness'.
This commit fixes that.
před 6 roky
Abdullah ibn Nadjo
01e73a2d3d
Fix unclosed DIR when targeting keyboard
před 6 roky
Abdullah ibn Nadjo
accee29c18
Don't check '/etc/light' folder when unnecessary
před 6 roky
Abdullah ibn Nadjo
6aea2b15bf
Improve 'if' readability
před 6 roky
Abdullah ibn Nadjo
2f14acb12e
Avoid redondant checking
před 6 roky
Abdullah ibn Nadjo
3b2835b626
Check if controller is accessible before getting value
před 6 roky
Abdullah ibn Nadjo
9f12ff92a2
Avoid checking for write permission if just getting value
před 6 roky
Sebastian Müller
f0da610cf1
Add -k flag for keyboard backlight support
před 7 roky
Fredrik Haikarainen
77e89d1d34
Fixes #5
před 9 roky
Fredrik Haikarainen
24f6a72cdd
Do not explicitly cast void pointers from malloc
před 10 roky
Fredrik Haikarainen
8dfe104b74
Added save/restore functionality
před 10 roky
Fredrik Haikarainen
a8746f9171
Fixed missing break
před 10 roky
Fredrik Haikarainen
b60192102d
Added operationmode to list controllers (-L)
před 10 roky
Fredrik Haikarainen
cbb147b4e7
Made sure /etc directories exists
před 10 roky
Fredrik Haikarainen
057bb40d04
Fix #1
před 10 roky
Fredrik Haikarainen
adf0861847
Full rewrite (0.9)
před 10 roky