Some quick shell scripts for the Neo

I wrote a couple of scripts to help me remember how to do things, and I wanted to document them somewhere.

First are some scripts to change the sound mixer so that sound only comes out of the headphones or the speakers. They basically just call amixer with the proper options:

useheadphones.sh:

#!/bin/sh
amixer set 'Amp Mode' 'Headphones'

usespeakers.sh:

#!/bin/sh
amixer set 'Amp Mode' 'Stereo Speakers'

Next is a script to fade the screen in and out, just for fun:
fade.sh:

#!/bin/sh
echo 0 > /sys/class/backlight/gta01-bl/power
for i in `seq 0 100 5000`;
do
        echo $i > /sys/class/backlight/gta01-bl/brightness
done
for i in `seq 0 100 5000`;
do
        let "o = 5000 - $i"
        echo $o > /sys/class/backlight/gta01-bl/brightness
done
sleep 3
echo 5000 > /sys/class/backlight/gta01-bl/brightness

Thats all for now.

This entry was posted in tech. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>