programs/sxmo_setpinebacklight: drop unused application

Signed-off-by: Stacy Harper <contact@stacyharper.net>
master
Clayton Craft 4 years ago committed by Stacy Harper
parent 921ab1773a
commit d42c4f58d4
No known key found for this signature in database
GPG Key ID: 5BAC92328B7C5D65
  1. 8
      Makefile
  2. 40
      programs/sxmo_setpinebacklight.c

@ -4,7 +4,6 @@ PREFIX:=/usr
PROGRAMS = \ PROGRAMS = \
programs/sxmo_setpineled \ programs/sxmo_setpineled \
programs/sxmo_setpinebacklight \
programs/sxmo_screenlock \ programs/sxmo_screenlock \
programs/sxmo_megiaudioroute \ programs/sxmo_megiaudioroute \
programs/sxmo_vibratepine programs/sxmo_vibratepine
@ -19,9 +18,6 @@ shellcheck:
programs/sxmo_setpineled: programs/sxmo_setpineled.c programs/sxmo_setpineled: programs/sxmo_setpineled.c
gcc -o programs/sxmo_setpineled programs/sxmo_setpineled.c gcc -o programs/sxmo_setpineled programs/sxmo_setpineled.c
programs/sxmo_setpinebacklight: programs/sxmo_setpinebacklight.c
gcc -o programs/sxmo_setpinebacklight programs/sxmo_setpinebacklight.c
programs/sxmo_screenlock: programs/sxmo_screenlock.c programs/sxmo_screenlock: programs/sxmo_screenlock.c
gcc -o programs/sxmo_screenlock programs/sxmo_screenlock.c -lX11 gcc -o programs/sxmo_screenlock programs/sxmo_screenlock.c -lX11
@ -32,7 +28,7 @@ programs/sxmo_vibratepine: programs/sxmo_vibratepine.c
gcc -o programs/sxmo_vibratepine programs/sxmo_vibratepine.c gcc -o programs/sxmo_vibratepine programs/sxmo_vibratepine.c
clean: clean:
rm -f programs/sxmo_setpineled programs/sxmo_screenlock programs/sxmo_setpinebacklight programs/sxmo_megiaudioroute programs/sxmo_vibratepine rm -f programs/sxmo_setpineled programs/sxmo_screenlock programs/sxmo_megiaudioroute programs/sxmo_vibratepine
install: $(PROGRAMS) install: $(PROGRAMS)
cd configs && find . -type f -exec install -D -m 0644 "{}" "$(DESTDIR)$(PREFIX)/share/sxmo/{}" \; && cd .. cd configs && find . -type f -exec install -D -m 0644 "{}" "$(DESTDIR)$(PREFIX)/share/sxmo/{}" \; && cd ..
@ -61,8 +57,6 @@ install: $(PROGRAMS)
install -D -m 0755 programs/sxmo_setpineled $(DESTDIR)$(PREFIX)/bin/ install -D -m 0755 programs/sxmo_setpineled $(DESTDIR)$(PREFIX)/bin/
install -D -m 0755 programs/sxmo_setpinebacklight $(DESTDIR)$(PREFIX)/bin/
install -D -m 0755 programs/sxmo_screenlock $(DESTDIR)$(PREFIX)/bin/ install -D -m 0755 programs/sxmo_screenlock $(DESTDIR)$(PREFIX)/bin/
install -D programs/sxmo_megiaudioroute $(DESTDIR)$(PREFIX)/bin/ install -D programs/sxmo_megiaudioroute $(DESTDIR)$(PREFIX)/bin/

@ -1,40 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
char * pbpScreen = "/sys/class/backlight/edp-backlight/brightness";
char * ppScreen = "/sys/devices/platform/backlight/backlight/backlight/brightness";
void usage() {
fprintf(stderr, "Usage: sxmo_setpinebacklight [number]\n");
}
void writeFile(char *filepath, int brightness) {
FILE *f;
f = fopen(filepath, "w+");
fprintf(f, "%d\n", brightness);
fclose(f);
}
int main(int argc, char *argv[]) {
char * command;
int brightness;
if (argc < 2) {
usage();
return 1;
}
argc--;
brightness = atoi(argv[argc--]);
if (access(pbpScreen, F_OK) != -1) {
writeFile(pbpScreen, brightness);
fprintf(stderr, "Set PBP brightness to %d\n", brightness);
} else if (access(ppScreen, F_OK) != -1) {
writeFile(ppScreen, brightness);
fprintf(stderr, "Set PP brightness to %d\n", brightness);
} else {
fprintf(stderr, "Neither PP or PBP Screen found!\n");
}
}
Loading…
Cancel
Save