(oops, remove the debugging ... the three echo's to standard out. Leave the one that stores to ~/.savemute)
-Matt On Mon, Jan 12, 2015 at 3:18 PM, Matthew Dillon <[email protected]> wrote: > Hey, pretty cool. I never got around to making those keys work. I wrote > some scripts for the backlight and mute as well. So here's my .xbindkeysrc > (modify paths as appropriate). > > > # Screen > # > "/home/dillon/adm/backlight -10" > F6 > "/home/dillon/adm/backlight 10" > F7 > > # Volume > # > "/home/dillon/adm/mute" > F8 > "mixer -f /dev/mixer1 vol -5" > F9 > "mixer -f /dev/mixer1 vol +5" > F10 > > And my two scripts: > > #!/bin/csh > # > # backlight script > > set level = `sysctl -n hw.backlight_level` > @ level = $level + $argv > sysctl hw.backlight_level=${level} > > > > #!/bin/csh > # > # mute script > > set curvol = "`mixer -f /dev/mixer1 -s vol`" > > if ( -f ~/.savemute ) then > set lastvol = "`cat ~/.savemute`" > else > set lastvol = "" > endif > > if ( "$curvol" == "vol 0:0 " ) then > if ( "$lastvol" != "" ) then > eval mixer -f /dev/mixer1 $lastvol > endif > else > echo B > echo last "$lastvol" > echo curr "$curvol" > if ( "$lastvol" != "$curvol" ) then > echo "$curvol" > ~/.savemute > endif > mixer -f /dev/mixer1 vol 0 > endif > > >
