summaryrefslogtreecommitdiff
path: root/bl
blob: f220e4f6f396be8366377c4012c2edc42246f7ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh

## Backlight controller generic: use either light or xbacklight

CMD=`crcparse bl`

case "$CMD" in
  "light")
    case "$1" in
      "-i")
        light -A "$2"
        ;;
      "-d")
        light -U "$2"
        ;;
      "-s")
        light -S "$1"
        ;;
      "-g")
        light -G
        ;;
      "*")
        printf "$CMD: $1 not understood. Treating it as a direct command."
        light "$@"
        ;;
    esac
    ;;
  "xbacklight")
    case "$1" in
      "-i")
        xbacklight -inc "$2"
        ;;
      "-d")
        xbacklight -dec "$2"
        ;;
      "-s")
        xbacklight -set "$1"
        ;;
      "-g")
        xbacklight -get
        ;;
      "*")
        printf "$CMD: $1 not understood. Treating it as a direct command."
        xbacklight "$@"
        ;;
    esac
esac