aboutsummaryrefslogtreecommitdiffstats
path: root/xorg/.local/usr
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2016-11-23 21:36:19 +0100
committerGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2016-11-23 21:36:37 +0100
commit1746ea2749f651da0423bfe637cddf0c22df831a (patch)
treeebe016acf5b1e641878efac41a750255071bdab3 /xorg/.local/usr
parent1c99670e651c642ae2b5a15c464ce7810653e18c (diff)
downloaddotfiles-1746ea2749f651da0423bfe637cddf0c22df831a.tar.gz
dotfiles-1746ea2749f651da0423bfe637cddf0c22df831a.tar.bz2
dotfiles-1746ea2749f651da0423bfe637cddf0c22df831a.zip
Updated dotfiles
Diffstat (limited to 'xorg/.local/usr')
-rwxr-xr-xxorg/.local/usr/bin/xbacklightmon17
1 files changed, 17 insertions, 0 deletions
diff --git a/xorg/.local/usr/bin/xbacklightmon b/xorg/.local/usr/bin/xbacklightmon
new file mode 100755
index 0000000..39f6b48
--- /dev/null
+++ b/xorg/.local/usr/bin/xbacklightmon
@@ -0,0 +1,17 @@
1#!/bin/sh
2
3path=/sys/class/backlight/acpi_video0
4
5luminance() {
6 read -r level < "$path"/actual_brightness
7 factor=$((max / 100))
8 printf '%d\n' "$((level / factor))"
9}
10
11read -r max < "$path"/max_brightness
12
13xbacklight -set "$(luminance)"
14
15inotifywait -me modify --format '' "$path"/actual_brightness | while read; do
16 xbacklight -set "$(luminance)"
17done