diff options
Diffstat (limited to 'bin/hornet/backlight')
-rwxr-xr-x | bin/hornet/backlight | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/bin/hornet/backlight b/bin/hornet/backlight deleted file mode 100755 index 314e874..0000000 --- a/bin/hornet/backlight +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use 5.014; - -my @levels = ( - 1, - 2, - 4, - 8, - 16, - 31, - 63, - 125, - 250, - 500, - 1000, -); -chomp(my $current = `xbacklight -getf`); -$current = int($current * 10); -my $idx; -for my $i (0..$#levels) { - my $level = $levels[$i]; - $idx = $i; - last if $level >= $current; -} - -my $inc; -if ($ARGV[0] eq 'inc') { - $inc = 1; -} -elsif ($ARGV[0] eq 'dec') { - $inc = -1; -} -elsif ($ARGV[0] eq 'get') { - say $idx * 10; - exit; -} -else { - die "unknown arg '$ARGV[0]'"; -} - -my $new_idx = $idx + $inc; -if ($new_idx >= 0 && $new_idx <= $#levels) { - my $new_level = $levels[$new_idx] * 0.1; - system("xbacklight -set $new_level"); -} |