#!/bin/bash

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>

# (c) Antonio Sánchez León <introlinux[fix@]gmail[fix.]com>
# (c) Miguel Anxo Bouzada <mbouzada[fix@]gmail[fix.]com>
# (c) GALPon MinNo Team <minino[fix@]galpon[fix.]org>
# july 2012

## -

case $LANG in
    ca*) OFF="Apagar" ;;
    es*) OFF="Apagar" ;;
    gl*) OFF="Apagar" ;;
    *) OFF="Turn off" ;;
esac


TEMP_FILE="/tmp/bright"
#rm $TEMP_FILE 2>&1

cat > $TEMP_FILE << EOF

iconsize=48
item= 5%
cmd=xbacklight -set 5
icon=/usr/local/share/pixmaps/bright10.png

item= 10%
cmd=xbacklight -set 10
icon=/usr/local/share/pixmaps/bright10.png

item= 25%
cmd=xbacklight -set 25
icon=/usr/local/share/pixmaps/bright25.png

item= 50%
cmd=xbacklight -set 50
icon=/usr/local/share/pixmaps/bright50.png

item= 75%
cmd=xbacklight -set 75
icon=/usr/local/share/pixmaps/bright75.png

item= 100%
cmd=xbacklight -set 100
icon=/usr/local/share/pixmaps/bright100.png

SEPARATOR

item= "$OFF"
cmd=apagapantalla
icon=/usr/local/share/pixmaps/brightoff.png

EOF


mygtkmenu $TEMP_FILE
