Skus si toto:
#include
#define LCD_PATH "/proc/acpi/video/VGA/LCD/brightness"
#define LCD_VAL "1"
extern int errno;
int main(int argc, char *argv[]) {
FILE *f;
if((f = fopen(LCD_PATH, "w")) == NULL) {
fprintf(stderr, "Unable to open: %s (are you root?)\n", LCD_PATH);
return 1;
}
if(fputs(LCD_VAL, f) <= 0) {
fprintf(stderr, "Could not write %s: %s", LCD_PATH, strerror(errno));
}
return 0;
}
skompilovat:
gcc meno_suboru.c -o meno_programu
a potom spustit:
sudo ./meno_programu
Odporucam najprv otestovat na nejakom pokusnom subore..