Skip to content

Commit

Permalink
Look for the vendor backlight directory instead of hardcoding it
Browse files Browse the repository at this point in the history
Hopefully this addresses the problem of the project not building on
systems with a different vendor backlight directory.
  • Loading branch information
Hendrikto committed Jun 7, 2018
1 parent e594ec4 commit 252b820
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ CC = gcc
CFLAGS += -Wall -Wextra -O3 -march=native

prefix = /usr/local
backlight_dir = /sys/class/backlight/intel_backlight/
max_brightness = $(shell cat $(backlight_dir)max_brightness)
backlight_dir = /sys/class/backlight
vendor_backlight_dir = $(backlight_dir)/$(shell ls $(backlight_dir) | head -n1)
max_brightness = $(shell cat $(vendor_backlight_dir)/max_brightness)

DEFINES += -D BACKLIGHT_DIR=\"$(backlight_dir)\"
DEFINES += -D BACKLIGHT_DIR=\"$(vendor_backlight_dir)/\"
DEFINES += -D MAX_BRIGHTNESS=$(max_brightness)

all: backlight_control
Expand Down

0 comments on commit 252b820

Please sign in to comment.