Skip to content

Instantly share code, notes, and snippets.

@taylor
Created August 21, 2014 02:58
Show Gist options
  • Select an option

  • Save taylor/a8ffb20c2cc84b0f8b95 to your computer and use it in GitHub Desktop.

Select an option

Save taylor/a8ffb20c2cc84b0f8b95 to your computer and use it in GitHub Desktop.
#!/bin/bash
cmd="transset-df"
cmdopts="-a"
if [ ! -x "/usr/bin/$cmd" ] ; then
echo "install transset"
exit
fi
def_inc="0.05"
clickopt=""
[[ "$1" = "click" ]] &&
clickopt="-c" && shift
case $1 in
up)
action="--inc"
inc=${2:-$def_inc}
;;
down)
action="--dec"
inc=${2:-$def_inc}
;;
min)
action="--min"
inc="0.5"
;;
max)
action="--max"
inc="1"
;;
[0-9]*)
action=""
inc="$1"
;;
*)
#echo "unknown action $1"
#exit
action=""
cmdopts="-a -t"
inc="0.9"
;;
esac
cmdopts="$cmdopts $clickopt"
if [ "$QUIET" ] ; then
$cmd $cmdopts $action $inc > /dev/null 2>&1
else
$cmd $cmdopts $action $inc
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment