Ok I am trying to figure out 1) how to make a global alias in bash, these () functions dont work and 2) how to make it so the assigned keycodes from xev perform the desired alias, below is my script:
#######################################################
## COMPAQ MUSIC VOLUME CONTROLS ## #
## - WORKS FOR ANY LAPTOP IN GENERAL ## by #
## JUST USE 'xev' TO DETERMINE THE FN ## Kinetic Labs #
## KEYCODES.
socalchronic@gmail.com ## (C) GNUPL #
###################################################################
# Brightness up and down should already work #
# So just define start/stop/play/forward/reverse/www/etc #
# pressing play w/o a media player open will open it #
# to do: research how to hook into your music player #
# we will use audacious the best X music player for #
# this example! For best results stick this in ~/kde/.Autostart/! #
########### edit to suit your FN keys #############################
# NOTE: This script assumes you run ALSA. #
###################################################################
MEDIA_PLAYER="/usr/local/bin/audacious"
VOL_UP="176"
VOL_DOWN="174"
MEDIA_PLAY="162"
MEDIA_STOP="164"
MEDIA_PREV="144"
MEDIA_FOWR="153"
WWW_BROWSER="/usr/bin/firefox"
ACCESS_WWW="178"
#amixer -c 0 -- sset Master playback -5dB|grep dB|head -1|cut -d' ' -f8
alias increase_vol() {
CURRENT_VOLUME=`amixer -c 0 -- get Master playback|grep dB|head -1|cut -d' ' -f8|cut -d'[' -f2|cut -d']' -f1|cut -d'd' -f1`
NEW_VOLUME=`expr $CURRENT_VOLUME + 1`
amixer -c 0 -- sset Master playback $NEW_VOLUMEdB
}
alias decrease_vol() {
CURRENT_VOLUME=`amixer -c 0 -- get Master playback|grep dB|head -1|cut -d' ' -f8|cut -d'[' -f2|cut -d']' -f1|cut -d'd' -f1`
NEW_VOLUME=`expr $CURRENT_VOLUME - 1`
amixer -c 0 -- sset Master playback $NEW_VOLUMEdB
}
#media_play() {}
#media_stop() {}
#media_prev() {}
#media_fowr() {}
#www_browser() {}