[G2 Themes and Apps] khaytsus:
Nope. All mine.

Seriously though, here ya go. It's not the cleanest code, has some test functions in it etc, but it's functional.

Example usage..

Flash the camera LED twice

backlights.sh flashtorch 2

Wiggle the power button lights 6 times

backlights.sh wigglerear 6

Anything else I just do in AOKP's LED settings or just have Tasker make a generic notification.

#!/bin/sh

rear_left=""
rear_left_max=""
rear_right=""
rear_right_max=""
red=""
red_max=""
blue=""
blue_max=""
green=""
green_max=""
torch=""
torch_max=""

blink_patterns="/sys/devices/virtual/g2_rgb_led/use_patterns/blink_patterns"
input_patterns="/sys/devices/virtual/g2_rgb_led/use_patterns/input_patterns"
onoff_patterns="/sys/devices/virtual/g2_rgb_led/use_patterns/onoff_patterns"

# https://groups.google.com/forum/#!topic/tasker/pKWOQXZv7Hs/discussion

pattern=$1
time_on=$2
time_off=$3

green()
{
if [ "$green" == "" ]; then
green=`find /sys/devices/ | grep leds/green/brightness`
green_max=`find /sys/devices/ | grep leds/green/max_brightness`
fi

if [ `cat $green_max` == `cat $green` ]; then
echo 0 > $green
else
echo `cat $green_max` > $green
fi
}

red()
{
if [ "$red" == "" ]; then
red=`find /sys/devices/ | grep leds/red/brightness`
red_max=`find /sys/devices/ | grep leds/red/max_brightness`
fi

if [ `cat $red_max` == `cat $red` ]; then
echo 0 > $red
else
echo `cat $red_max` > $red
fi
}

blue()
{
if [ "$blue" == "" ]; then
blue=`find /sys/devices/ | grep leds/blue/brightness`
blue_max=`find /sys/devices/ | grep leds/blue/max_brightness`
fi

if [ `cat $blue_max` == `cat $blue` ]; then
echo 0 > $blue
else
echo `cat $blue_max` > $blue
fi
}

rear_left()
{
if [ "$rear_left" == "" ]; then
rear_left=`find /sys/devices/ | grep leds/button-backlight1/brightness`
rear_left_max=`find /sys/devices/ | grep leds/button-backlight1/max_brightness`
fi

if [ `cat $rear_left` -gt 0 ]; then
echo 0 > $rear_left
else
echo `cat $rear_left_max` > $rear_left
fi
}

rear_right()
{
if [ "$rear_right" == "" ]; then
rear_right=`find /sys/devices/ | grep leds/button-backlight2/brightness`
rear_right_max=`find /sys/devices/ | grep leds/button-backlight2/max_brightness`
fi

if [ `cat $rear_right` -gt 0 ]; then
echo 0 > $rear_right
else
echo `cat $rear_right_max` > $rear_right
fi
}

get_rear()
{
if [ "$rear_left" == "" ]; then
rear_left=`find /sys/devices/ | grep leds/button-backlight1/brightness`
rear_left_max=`find /sys/devices/ | grep leds/button-backlight1/max_brightness`
fi

if [ "$rear_right" == "" ]; then
rear_right=`find /sys/devices/ | grep leds/button-backlight2/brightness`
rear_right_max=`find /sys/devices/ | grep leds/button-backlight2/max_brightness`
fi
}

rear_both()
{
get_rear

if [ `cat $rear_left` -gt 0 ]; then
echo 0 > $rear_left
else
echo `cat $rear_left_max` > $rear_left
fi

if [ `cat $rear_right` -gt 0 ]; then
echo 0 > $rear_right
else
echo `cat $rear_right_max` > $rear_right
fi
}

flashrear()
{
flashes=0
while [ $flashes -lt $time_on ]; do
let flashes=flashes+1
rear_both
usleep 500000
rear_both
usleep 400000
done
}

wigglerear()
{
get_rear

flashes=0
while [ $flashes -lt $time_on ]; do
let flashes=flashes+1
rear_left
usleep 500000
rear_left
rear_right
usleep 400000
rear_right
done
}

torch()
{
if [ "$torch" == "" ]; then
torch=`find /sys | grep flash_torch.brightness`
torch_max=`find /sys | grep flash_torch.max_brightness`
fi

if [ `cat $torch_max` == `cat $torch` ]; then
echo 0 > $torch
else
echo `cat $torch_max` > $torch
fi
}

flashtorch()
{
flashes=0
while [ $flashes -lt $time_on ]; do
let flashes=flashes+1
torch
usleep 500000
torch
usleep 400000
done
}

case $pattern in
flashrear)
flashrear
;;
wigglerear)
wigglerear
;;
testrear)
rear_left
sleep $time_on
rear_left
sleep $time_on
rear_right
sleep $time_on
rear_right
sleep $time_on
rear_left
rear_right
sleep $time_on
rear_left
rear_right
;;
testfront)
green
sleep 1
green
blue
sleep 1
blue
red
sleep 1
red
;;
testwhite)
red
green
blue
sleep 1
red
green
blue
;;
flashtorch)
flashtorch
;;
greenie)
green
green
green
green
green
green
;;
esac