jmesmon / illum Goto Github PK
View Code? Open in Web Editor NEWDaemon that wires button presses to screen backlight level
Daemon that wires button presses to screen backlight level
== illum == Illum is a backlight manager for linux. It changes the screen backlight level based on keypresses (brightness up and brightness down). === Instal (via distro) === Arch Linux: https://aur.archlinux.org/packages/illum-git/ pacaur -S illum-git systemctl enable illum.service systemctl start illum.service Gentoo: https://github.com/jmesmon/overlay https://github.com/jmesmon/overlay/blob/master/sys-apps/illum/illum-9999.ebuild layman -a jmesmon ACCEPT_KEYWORDS="**" emerge illum-git rc-update add illum default /etc/init.d/illum start === build === git submodule update --init ./build OR git submodule update --init ./configure ninja Note that `ninja` does not recognize env vars like CC and CFLAGS, but `./configure` does. `./build` is just a convenience wrapper to configure and then call ninja. === Use === Run `./illum-d`. Currently, it attaches to all event sources that supply backlight up and backlight down keys (assuming they exist under /dev/input/* ) === Notes === - The user running illum-d needs the appropriate permisions to read from the input device (on Arch a member of group 'input' works) and to write to the backlight control === Dependencies === - libev :: an event loop - libevdev :: wrapper for linux's input event system - ccan (as a submodule) :: misc utility code To build: - sh - ninja - pkg-config (to find libevdev) - a C compiler (gcc is tested) === License === GNU Affero General Public License version 3 (AGPL-3) as published by GNU: https://www.gnu.org/licenses/agpl-3.0.en.html ==== TODO ==== - support a "sticky" levels when switching between 0 and 1 (raw values) to better support backlights that can turn completely off. - better brightness curve (right now is based on squaring, exponential might be more acurrate). - automatically select "best" backlight driver rather than just "first" - play nice with old-bios that also want to adjust the screen on keypresses - figure out the right way to enumerate input devices (rather than readdir of /dev/input) - Hotplug new input devices - support using key combinations to adjust at different rates/different ways. - add a client control program/library to allow syncronized control from different sources. - dimming based on "activity" - detects activity - obeys inhibits (time limited and lifetime limited) - [optionally] displays the current backlight status via an overlay - showing other status (caps lock, num lock) may also be useful on come machines - dim bl durring inactivity Inspiration: - brightd: dims on inactivity
Kudos for you
(and probably a few other things).
For me, this is a low priority, but I'd be happy to accept patches to the spec if desired (or remove it if it is better maintained elsewhere).
cc @hramrach
Illum seems to be licensed under AGPLv3, which is mentioned at least in illum.spec
and the Arch Linux package. This is not immediately obvious.
The license should be stated in at least some of the following ways.
README
COPYING
with the fulltextWhichever license you plan to use, the process involves adding two elements to each source file of your program: a copyright notice (such as “Copyright 1999 Terry Jones”), and a statement of copying permission, saying that the program is distributed under the terms of the GNU General Public License (or the Lesser GPL).
I recently started using illum, and just noticed something curious: while some processes res a coerve quite a lot of memory (maybe a few GB at most), illum's daemon seems to be in a separate tier with htop listing its virtual memory as 20.0T (!). Specifically it's illum-d
reserving this amount of memory.
Not sure if this is in any way related to the rest of my system/setup, but it's a relatively vanilla NixOS setup (seeing as I started using NixOS two weeks ago, and setup this laptop yesterday). The system in question has an uptime of 16h, of which maybe 11h was during suspension (suspend-to-RAM).
I am using artix with openrc ... which line should i edit so i can use it for my system ?
Hi.
I have a laptop with a secondary monitor and keyboard connected through a USB C dock. As soon as I unplug the cable, the illum daemon crashes:
illum-d: main-daemon.c:471: evdev_cb: Assertion `r == LIBEVDEV_READ_STATUS_SUCCESS' failed.
To debug this, I have added this code to main-daemon.c
right before the assert statement:
if (r != LIBEVDEV_READ_STATUS_SUCCESS) {
errno = -r;
perror("libevdev_next_event");
}
here is the output:
sudo ./illum-d
<6>using /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight as a backlight
<6>using /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input0/event0 as an input dev
<6>using /sys/devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6.4/3-6.4.4/3-6.4.4.1/3-6.4.4.1:1.1/0003:046D:C548.000D/input/input34/event4 as an input dev
<6>using /sys/devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6.4/3-6.4.4/3-6.4.4.2/3-6.4.4.2:1.2/0003:04D9:A131.0010/input/input39/event9 as an input dev
<6>using /sys/devices/platform/INTC1051:00/input/input13/event12 as an input dev
<6>using /sys/devices/platform/thinkpad_acpi/input/input17/event16 as an input dev
libevdev_next_event: No such device
illum-d: main-daemon.c:474: evdev_cb: Assertion `r == LIBEVDEV_READ_STATUS_SUCCESS' failed.
Aborted
Apparently, libevdev_next_event
really does report other errors than the three values mentioned in the documentation.
People running 'stable' distribution on non-x86 will not be able to build illum out of the box.
openSUSE 42.2 with gcc 4.8.5 does not manage.
This can be detected by gcc failing to build/link when option passed:
[ 40s] [25/26] cc -fsanitize=address -ggdb3 -fvar-tracking-assignments -flto -Og -ggdb3 -fvar-tracking-assignments -o illum-ctl .build-illum-ctl/main-ctl.c.o -lev -levdev
[ 40s] FAILED: cc -fsanitize=address -ggdb3 -fvar-tracking-assignments -flto -Og -ggdb3 -fvar-tracking-assignments -o illum-ctl .build-illum-ctl/main-ctl.c.o -lev -levdev
[ 40s] /usr/lib/gcc/armv7hl-suse-linux-gnueabi/4.8/../../../../armv7hl-suse-linux-gnueabi/bin/ld: cannot find libasan_preinit.o: No such file or directory
[ 40s] /usr/lib/gcc/armv7hl-suse-linux-gnueabi/4.8/../../../../armv7hl-suse-linux-gnueabi/bin/ld: cannot find -lasan
[ 40s] collect2: error: ld returned 1 exit status
[ 40s] ccan/ccan/pr_log/pr_log.c:1:0: warning: -fsanitize=address not supported for this target [enabled by default]
[ 40s] /* Licensed under LGPLv2.1+ - see LICENSE file for details /
[ 40s] ^
[ 41s] main-daemon.c:1:0: warning: -fsanitize=address not supported for this target [enabled by default]
[ 41s] / ex: set noet sw=8 sts=8 ts=8 tw=78: */
[ 41s] ^
[ 41s] ninja: build stopped: subcommand failed.
When trying to run illum-d, I get the following error:
failed to initialize sys backlight at '/sys/class/backlight/intel_backlight' (-1)
strace: https://paste.xinu.at/kbnr/
stat /sys/class/backlight/intel_backlight: https://paste.xinu.at/PgcpWe/
file contents: https://paste.xinu.at/mjCKiT/
uname:
Linux thinkpad 4.7.6-1-ARCH #1 SMP PREEMPT Fri Sep 30 19:28:42 CEST 2016 x86_64 GNU/Linux
Great software that fits my use case well. Works out the box on Arch.
Would be nice to add a command to get brightness value in percent like "xbacklight -get" has so it can be displayed in a top bar in dwm or other Tiling WMs.
Thanks
The app works fine if i start it manually, but if i enable the service it fails at boot and then i get this
mar 25 17:52:28 archlinux systemd[1]: illum.service: Scheduled restart job, re> mar 25 17:52:28 archlinux systemd[1]: Stopped illum.service. mar 25 17:52:28 archlinux systemd[1]: illum.service: Start request repeated to> mar 25 17:52:28 archlinux systemd[1]: illum.service: Failed with result 'exit-> mar 25 17:52:28 archlinux systemd[1]: Failed to start illum.service.
Any advice on how to fix it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.