Made the codebase publishable: - Removed various testing code. - Improved the makefile. - Rewrote README.org. - Changed filename to reflect project. - Other minor cleanupspull/1/head
parent
9714c5a3c7
commit
c65561d6b0
3 changed files with 111 additions and 76 deletions
@ -1,16 +1,29 @@ |
||||
TARGET=li
|
||||
SRC=li.c
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
CC=gcc
|
||||
CFLAGS+=-O3 -march=native -std=c11 -Wall -Wno-stringop-truncation
|
||||
lc: lc.c |
||||
$(CC) -o lc $(CFLAGS) $<
|
||||
CFLAGS+=-O3 -march=native -std=c11 -Wall -W -pedantic -Wno-stringop-truncation
|
||||
CPPFLAGS += -D_POSIX_C_SOURCE=1
|
||||
|
||||
debug-lc: lc.c |
||||
$(CC) -o lc-debug -Og -g $<
|
||||
.PHONY: all install uninstall debug clean |
||||
|
||||
check: |
||||
echo "check"
|
||||
|
||||
all: $(TARGET) |
||||
debug: $(TARGET)-debug |
||||
|
||||
clean: |
||||
$(RM) lc
|
||||
$(TARGET): $(SRC) |
||||
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(SRC) -o $@
|
||||
|
||||
install: $(TARGET) |
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
install -m755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(TARGET)
|
||||
uninstall: |
||||
$(RM) $(DESTDIR)$(PREFIX)/bin/$(TARGET)
|
||||
|
||||
$(TARGET)-debug: $(SRC) |
||||
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(SRC) -Og -o $@
|
||||
|
||||
clean: |
||||
$(RM) $(TARGET)
|
||||
$(RM) $(TARGET)-debug
|
||||
|
@ -1,37 +1,64 @@ |
||||
* LC - Light Command |
||||
Light command is a small c program that adjusts the brightness of monitors. |
||||
At the moment, only built-in monitors function i.e. most laptop monitors. |
||||
Why make such a tiny program? There was a vacuum between gui application and |
||||
shell scripts. The author did not particularly enjoy xbacklight |
||||
(specially it's dependence on a xconfig file for the monitor in some cases, |
||||
and the syntax is just stupid... -set?). |
||||
* LI - backLIght changer |
||||
Light command is a small c program that adjusts the brightness of monitors. At |
||||
the moment, only built-in monitors work i.e. most laptop monitors. Why make such |
||||
a tiny program? There was a vacuum between gui application and shell scripts. |
||||
The author did not particularly enjoy =xbacklight= (specially it's dependence on a |
||||
xconfig file for the monitor in some cases, and the syntax is just stupid... |
||||
=-set=?). |
||||
|
||||
** USAGE |
||||
LI seeks to correct this somewhat... but it's not developed for the masses -- |
||||
just for me, so don't expect anything. |
||||
|
||||
* Features |
||||
- Adjust brightness of built-in monitors (laptop monitors). |
||||
- Works on % of maxbrightness, not the arbitrary /sys/class/backlight... value fun. |
||||
- Micro codebase. |
||||
- Somewhat safe to =setuid=. |
||||
|
||||
* Manual |
||||
** Downloading |
||||
*** git HTTPS |
||||
To get the latest version with git over HTTPS: |
||||
#+begin_src sh |
||||
git clone https://github.com/cafkafk/li.git |
||||
#+end_src |
||||
*** git SSH |
||||
To get the latest version with git over SSH: |
||||
#+begin_src sh |
||||
git clone git@github.com:cafkafk/li.git |
||||
#+end_src |
||||
|
||||
** Building |
||||
To build simply run: |
||||
#+begin_src bash |
||||
$ make |
||||
#+end_src |
||||
** Installing |
||||
To install simply run: |
||||
#+begin_src bash |
||||
$ make install |
||||
#+end_srcL |
||||
** Uninstalling |
||||
To uninstall simply run: |
||||
#+begin_src bash |
||||
$ make uninstall |
||||
#+end_src |
||||
** Usage |
||||
To get help for =lc= |
||||
#+begin_src sh |
||||
$ lc --help |
||||
#+end_src |
||||
To set the target brightness (as an integer). |
||||
#+begin_src |
||||
# lc device brightness |
||||
#+end_src |
||||
*Finding devices*: lc will tell you the names of devices on help, |
||||
but if you would like to find it yourself, simply run: |
||||
#+begin_src bash |
||||
$ ls /sys/class/backlight/ |
||||
# lc [int] |
||||
#+end_src |
||||
|
||||
*Notice*: the brightness is a percentage, so 100 -> 100% brightness, |
||||
50 -> 50% brightness etc... |
||||
Further it must be in interval (0;100]. |
||||
** BUILD |
||||
To build simply run make. |
||||
#+begin_src bash |
||||
$ make |
||||
#+end_src |
||||
** INSTALL |
||||
Simply put the =lc= file into your path, or a folder in your path. |
||||
** ROADMAP |
||||
- [ ] Down the road, lc looks to support ddcutils, |
||||
so it can change desktop monitors as well. |
||||
|
||||
|
||||
Further it must be in the interval (0;100]. |
||||
|
||||
** ROADMAP |
||||
- [-] built-in monitor support |
||||
- [ ] I2C support |
||||
- [ ] (unsure) multi-monitor |
||||
|
Loading…
Reference in new issue