日期:2014-05-16 浏览次数:20737 次
#!/bin/bash value=$2 #init value usage(){ echo "Usage: $0 [-g][-b] <value>" echo "-g --gamma set the gamma value from 0.1-10.0" echo "-b --brightness set the brightness value from 0(dark)-99" echo " brightness suggest value is 25,50,75,90" } vga_brightness(){ vga_interface=`lspci | grep VGA | awk '{print $1}'` sudo setpci -s $vga_interface F4.B=$value } vga_gamma(){ xgamma -gamma $value } if [ $# -gt 1 ] && [ $# -lt 3 ]; then if [ $1 = "-g" ] || [ $1 = "--gamma" ]; then vga_gamma elif [ $1 = "-b" ] || [ $1 = "--brightness" ]; then vga_brightness else usage fi else usage fi