URI: 
       dimm.c - dimm - simple screen brightness utility
  HTML git clone git://kroovy.de/dimm
   DIR Log
   DIR Files
   DIR Refs
   DIR README
       ---
       dimm.c (415B)
       ---
            1 #include <stdio.h>
            2 #include <stdlib.h>
            3 
            4 #define OUTPUT_FILE "/sys/class/backlight/intel_backlight/brightness"
            5 
            6 int main(int argc, char *argv[]) {
            7         if (argc != 2) {
            8                 fprintf(stderr, "Usage: %s <number> # 1 to 19393\n", argv[0]);
            9                 return 1;
           10         }
           11 
           12         FILE *file = fopen(OUTPUT_FILE, "w");
           13         if (file == NULL) {
           14                 perror("Error opening file");
           15                 return 1;
           16         }
           17 
           18         fprintf(file, "%s\n", argv[1]);
           19 
           20         fclose(file);
           21         return 0;
           22 }