Tiny Core Extensions > TCE Tips & Tricks

nifty volume control for jwm

<< < (2/10) > >>

jpeters:
Any way to use the same .jwmrc button with separate commands for right and left mouse clicks?
(I'd like to save a button for turning my mike on and off).  Thanks

Edit:  You could also issue different volume controls for right /vs left mouse click

tobiaus:
very interesting onyarian, i wonder if ossmix has been updated... no, i just downloaded it from apps browser yesterday. i'm glad you found a way to use it though!

jpeters: i've never heard of getting jwm to distinguish left/right mouse from the tray, that would be cool. originally i thought of making the buttons more narrow, using 8x16 or fewer pixel icons instead of text, i was happy with the two buttons though. you could easily make it go up to 100 and then cycle back to 0 if you wanted to use only one button that way.

mikshaw:
A modification of the above, mainly done as a distraction from my own current puzzles.
The result should be the same.

--- Code: ---u=`ossmix vmix0-vol`
#v=`echo $u | sed 's/.*\([0-9]\{1,3\}\)\.0.*/\1/'` # can't get the regex right
v=`echo $u | awk '{print $10}'|cut -d. -f1` #grab just the value
max=25 #maximum level
step=5

case "$1" in
"-up")
  case "$v" in
   $max) a="" ;;
      *) let a=$v+$step ;;
  esac ;;
"-down")
  case "$v" in
      0) a="" ;;
      *) let a=$v-$step ;;
  esac ;;
esac

ossmix vmix0-vol $a

--- End code ---
I had originally tried to use a single sed command to extract the current level, but I can't seem to get the regular expression right to work for both 25 and 5

This assumes that the decimal is always a single digit (it cuts it off)...it'll break otherwise.  EDIT: I don't think that's true anymore.
It also assumes that step will be set at a number that is evenly divisible into max.  I haven't tested what will happen otherwise.

jpeters:
Careful....this script could get flagged as an attempt to print $10 bills.

mikshaw:
=o)

Also the first two lines could easily be condensed into a single line to save a process.  I was originally testing it with a "Value of mixer control..." string and never thougt to combine them afterwards.

--- Code: ---v=`ossmix vmix0-vol | awk '{print $10}'|cut -d. -f1`
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version