Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

HowTo create a volume mixer for IceWM

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
Soul Singin'
Posts: 1605
Joined: 2008-12-21 07:02

HowTo create a volume mixer for IceWM

#1 Post by Soul Singin' »

IceWM has a lot of great features, but a volume mixer for your system tray is not one of them. This HowTo describes a simple way to create one in TK. It is based on a Python script by Ashley Mills. The script was later adapted for FreeBSD by Knoba. And I adapted it for Debian.


Step One: Install Tkinter

Code: Select all

apt-get install python-tk
Step Two: Save the following Python script as /usr/bin/local/mixerapp and save a nice speaker icon to /usr/local/share/icons/audio-speakers.png

Code: Select all

#!/usr/bin/python2
import commands
from Tkinter import Tk,IntVar,Scale,PhotoImage

def adjustVol(vol):
   commands.getoutput('/usr/bin/amixer -c 0 set Master '+vol+'%')
   return

root = Tk(className='mixerapp')
root.geometry('50x100')
root.wm_title("Volume")
imgicon = PhotoImage(file='/usr/local/share/icons/audio-speakers.png')
root.call('wm', 'iconphoto', root._w, imgicon)
vol = IntVar()
scale = Scale(root,variable=vol,from_=100,to=0,command=adjustVol)
scale.set(commands.getoutput("/usr/bin/amixer -c 0 get Master | tail -n1 | sed 's/\[//g;s/\]//g;s/%.*$//g;s/^.*\s//'"))
scale.pack()
root.mainloop()
Step Three: To make the volume mixer appear in the tray, add the following lines to: ~/.icewm/winoptions, adjusting the geometry so that it appears in the appropriate location on your screen.

Code: Select all

mixerapp.tray: Exclusive
mixerapp.dTitleBar: 0
mixerapp.dBorder: 0
mixerapp.startMinimized: 1
mixerapp.geometry: 50x100+1151+26
Step Four: To make the volume mixer appear in the tray at startup, add the following line to: ~/.icewm/startup

Code: Select all

mixerapp &
Step Five: Restart IceWM and enjoy!
.

User avatar
Bloom
df -h | grep > 90TiB
df -h | grep > 90TiB
Posts: 503
Joined: 2017-11-11 12:23
Been thanked: 26 times

Re: HowTo create a volume mixer for IceWM

#2 Post by Bloom »

Have you tried the pnmixer package?


User avatar
None1975
df -h | participant
df -h | participant
Posts: 1387
Joined: 2015-11-29 18:23
Location: Russia, Kaliningrad
Has thanked: 45 times
Been thanked: 64 times

Re: HowTo create a volume mixer for IceWM

#4 Post by None1975 »

If you do not have a pulseaudio in the system, try volumeicon-alsa. Just do not forget add it to your startup file

Code: Select all

sleep 1 &&
volumeicon &
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github

User avatar
Soul Singin'
Posts: 1605
Joined: 2008-12-21 07:02

Re: HowTo create a volume mixer for IceWM

#5 Post by Soul Singin' »

None1975 wrote:volumeicon-alsa
Also good. Thanks!

Image

For a battery monitor, I backported cbatticon. I've got network-manager-gnome to manage my wireless. For a clipboard, I've got clipit. ... And my tray is getting full! . :D
.

Post Reply