View previous topic :: View next topic |
Author |
Message |
beerisgoodmate Tux's lil' helper
Joined: 20 May 2005 Posts: 129
|
Posted: Fri Jan 13, 2006 4:04 am Post subject: Displaying Volume in Torsmo [solved] |
|
|
I would like torsmo to display what my volume is currently set to...
Any idea on how to do this?
I am using aumix to change my volume levels using my laptops volume buttons... but I have alsamixer as well...
Thanks!
Last edited by beerisgoodmate on Fri Jan 13, 2006 5:20 am; edited 1 time in total |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Fri Jan 13, 2006 4:14 am Post subject: |
|
|
I use this to get the volume with aumix into a script to show it into a FvwmButtons (I use Fvwm):
Code: |
aumix -vq | sed -e 's/, P//'
|
I suggest you to do that into the command line, to see if the output is the desired one. That should work ok for master volume, if you want pcm volume then the sed string might be a bit different. Then integrate it into your torsmo config. I think that torsmo can manage bash scripts, cant it? But it has been so long since I last used it, so cant help you with that. |
|
Back to top |
|
|
beerisgoodmate Tux's lil' helper
Joined: 20 May 2005 Posts: 129
|
Posted: Fri Jan 13, 2006 4:37 am Post subject: |
|
|
ok, so I get:
Code: | aumix -vq | sed -e 's/, P//'
vol 70, 70 |
Or
Quote: | aumix -wq | sed -e 's/, P//'
pcm 20, 20 |
because I use the pcm...
I never use sed so I don't know what to do with that... but the sed doesn't seam to do anything different to the command line output... I assume the sed is to format the output, but it doesn't seem to be doing anything...
I can run the script from torsmo and it works but I get I would rather just 70 etc...
Thanks! |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Fri Jan 13, 2006 5:05 am Post subject: |
|
|
Ooops, sorry. FvwmScript has a function to take an arbitrary field of the output, so I just removed the tailing ", P" of the end and took that. To do the whole thing with sed try this one:
Code: |
aumix -vq | sed -e 's/, P//' -e 's/vol \([0-9]*\)*, //'
|
Scary, I know, as all sed ifself. Hope this one works. |
|
Back to top |
|
|
beerisgoodmate Tux's lil' helper
Joined: 20 May 2005 Posts: 129
|
Posted: Fri Jan 13, 2006 5:06 am Post subject: |
|
|
Thanks for the reply, But I found another solution:
Code: | aumix -wq | awk '{ print $3}' |
[/code][/quote] |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Fri Jan 13, 2006 5:17 am Post subject: |
|
|
beerisgoodmate wrote: | Thanks for the reply, But I found another solution:
Code: | aumix -wq | awk '{ print $3}' |
[/code] | [/quote]
Ahhh! Some day I will have to learn a bit about awk, sed is really something bad to know about. |
|
Back to top |
|
|
|