You are not logged in.

#1 2009-07-19 15:29:53

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Volume change on screen display for lightweight desktops?

Is there some sort of notification that appears in the center of the screen showing the volume meter upon change, similar to Windows or Ubuntu machines? Do any of these work well in lightweight desktops (dwm, no notification area) and provide instant feedback upon change in volume?

Right now I'm using a bash script that checks the volume every second and displays it in my status bar, but that seems wasteful and still has a 1 second delay when I change the volume.

What are my options?


дɭɭɑӎɠїɾ

Offline

#2 2009-07-19 15:42:50

narada
Member
Registered: 2009-07-12
Posts: 34

Re: Volume change on screen display for lightweight desktops?

I may be misunderstanding you, but I think volwheel might be what you're looking for. I'm not sure what you mean by "appears in the center of the screen."

Offline

#3 2009-07-19 15:46:11

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Volume change on screen display for lightweight desktops?

Well, volwheel is a tray icon. I don't have a system tray and don't plan on adding one. Usually, on Windows/Ubuntu/Mac systems, when one changes the volume with the keyboard, a small meter with a volume icon displays near the center of the screen, showing the volume meter as it changes. this is what I'm talking about. Is there anything like this for Arch linux that's nice and light, with few dependencies and little resource usage?


дɭɭɑӎɠїɾ

Offline

#4 2009-07-19 16:33:16

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: Volume change on screen display for lightweight desktops?

Try this. Not sure how far along it is.

Scott

Offline

#5 2009-07-19 17:57:15

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Volume change on screen display for lightweight desktops?

Thanks! that worked, except I have a problem with notify-osd. It always appears too far in the top right of my screen, so it ends up covering my status bar. Is there any way to center the notify-osd window?


дɭɭɑӎɠїɾ

Offline

#6 2009-07-19 18:32:37

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Volume change on screen display for lightweight desktops?

i use my own script ossvol which changes my ossvolume and displays a nice dzen notifacation center screen.  it's a modifacation to bruenig's dvol script (just forum search dvol) which does the same thing for alsa.  the script itself is very readable so you can adjust color/positioning of the dzen bar.  sounds like what you're looking for.

Offline

#7 2009-07-19 18:46:57

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Volume change on screen display for lightweight desktops?

Very interesting. I'll definitely check that out if I can't get notify-osd to work how I want. I finally got the nice icons from ubuntu in it and it displays volume changes with no delay, so hopefully I can move the window (even a little bit down would be ok, as long as my status bar isn't covered)


дɭɭɑӎɠїɾ

Offline

#8 2009-07-19 21:08:03

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Volume change on screen display for lightweight desktops?

Allamgir wrote:

Is there some sort of notification that appears in the center of the screen showing the volume meter upon change, similar to Windows or Ubuntu machines? Do any of these work well in lightweight desktops (dwm, no notification area) and provide instant feedback upon change in volume?

I use a Python utility that has an optional GTK progressbar, pvol.py. It doesn't require an external mixer utility but uses Python ossaudiodev library.


You need to install an RTFM interface.

Offline

#9 2009-07-20 19:43:20

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: Volume change on screen display for lightweight desktops?

I have one that is based on the vol.sh script... There are switches that can be added to change the position of the osd overlay.  I have mine in the bottom center of my screen.   I'ld post the changes, but I'm not at my computer right now.


Knute

Offline

#10 2009-07-20 20:43:33

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Volume change on screen display for lightweight desktops?

I currently use this:

#!/bin/sh
# Written by Ramses de Norre

# Match only positive integers as second argument
if [[ ${2} =~ ^[0-9]+$ ]]; then
  AMM=${2}
else
  AMM=1
fi

CTRL="Master"
PREFIX="Volume"
GB_WIDTH=50
GB_HEIGHT=7
DZEN_SEC=3
DZEN_Y="870"
DZEN_X="1300"
DZEN_TA="c"
DZEN_TW="140"

GB_ARGS="-l ${PREFIX} -w ${GB_WIDTH} -h ${GB_HEIGHT}"
DZEN_ARGS="-p ${DZEN_SEC} -ta ${DZEN_TA} -y ${DZEN_Y} -x ${DZEN_X} -tw ${DZEN_TW}"

if [ "$1" = "+" -o "$1" = "-" ]; then
  /usr/bin/amixer set ${CTRL} ${AMM}%${1} \
    | /bin/sed -n '${s/.*\[\([0-9]*\)%\].*/\1/p}' \
    | /usr/bin/gdbar ${GB_ARGS} \
    | /usr/bin/dzen2 ${DZEN_ARGS}
else
  echo "Wrong usage!" 2>&1
  exit 1
fi

exit 0

Offline

#11 2009-07-20 20:43:47

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Volume change on screen display for lightweight desktops?

Perfect! Bottom center is even better than center. Post your setup of that once you get to your comp.


дɭɭɑӎɠїɾ

Offline

#12 2009-07-21 12:58:11

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: Volume change on screen display for lightweight desktops?

Here it is:

 7:56AM % cat voltun.sh                                     ~/bin (knute) pts/0
#!/bin/sh

usage="usage: $0 -c {up|down|mute} [-i increment] [-m mixer]"
command=
increment=5%
mixer=Aux
label=Tuner

while getopts i:m:h o
do case "$o" in
    i) increment=$OPTARG;;
    m) mixer=$OPTARG;;
    h) echo "$usage"; exit 0;;
    ?) echo "$usage"; exit 0;;
esac
done

shift $(($OPTIND - 1))
command=$1

if [ "$command" = "" ]; then
    echo "usage: $0 {up|down|mute} [increment]"
    exit 0;
fi

display_volume=0

if [ "$command" = "up" ]; then
    display_volume=$(amixer set $mixer $increment+ unmute | grep -m 1 "%]" | cut -d "[" -f2|cut -d "%" -f1)
fi

if [ "$command" = "down" ]; then
    display_volume=$(amixer set $mixer $increment- unmute | grep -m 1 "%]" | cut -d "[" -f2|cut -d "%" -f1)
fi

icon_name=""

if [ "$command" = "mute" ]; then
    if amixer get Master | grep "\[on\]"; then
        display_volume=0
        icon_name="notification-audio-volume-muted"
        amixer set $mixer mute
    else
        display_volume=$(amixer set $mixer unmute | grep -m 1 "%]" | cut -d "[" -f2|cut -d "%" -f1)
    fi
fi

if [ "$icon_name" = "" ]; then
    if [ "$display_volume" = "0" ]; then
        icon_name="notification-audio-volume-off"
    else
        if [ "$display_volume" -lt "33" ]; then
            icon_name="notification-audio-volume-low"
        else
            if [ "$display_volume" -lt "67" ]; then
                icon_name="notification-audio-volume-medium"
            else
                icon_name="notification-audio-volume-high"
            fi
        fi
    fi
fi
#notify-send " " -i $icon_name -h int:value:$display_volume -h string:synchronous:volume
osd_cat -p bottom -A center -c green -s 2 -S black -u black -O 6 -d 1 -f -*-profont-*-*-*-*-40-*-*-*-*-*-*-* -b percentage -P $display_volume -T $label
 7:56AM %                                                   ~/bin (knute) pts/0

Now that I look at it, I see that I used osd_cat.  It's still a little rough but it does the job.


Knute

Offline

#13 2009-07-21 14:12:22

linkmaster03
Member
Registered: 2008-12-27
Posts: 269

Re: Volume change on screen display for lightweight desktops?

I use aosd_cat which is provided by the libaosd package. It has no dependencies and I love it with my Openbox setup. This is the script I tie to keybindings:

#!/bin/bash

case $1 in
up) a="Volume: `amixer sset PCM 5%+ unmute | grep "Left:" | awk '{ gsub(/\[/, " "); gsub(/%\]/, " "); print $5 }'`%" ;;
down) a="Volume: `amixer sset PCM 5%- unmute | grep "Left:" | awk '{ gsub(/\[/, " "); gsub(/%\]/, " "); print $5 }'`%" ;;
mute)
case `amixer set Master toggle | grep "Mono:" | awk '{ gsub(/\[/, " "); gsub(/%\]/, " "); print $6 }' | cut -f1 -d]` in
            on) a="Unmuted" ;;
             *) a="Muted" ;;
             esac ;;
*) echo "Usage: $0 { up | down | mute }"  ;;
esac

killall aosd_cat &> /dev/null
echo "$a" | aosd_cat --fore-color="#dfe2e8" -p 7 --x-offset=520 --y-offset=-50 --font="bitstream bold 20" --transparency=1 --fade-full=600

(modified version of a script in this thread)

Offline

#14 2009-07-21 15:35:26

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Volume change on screen display for lightweight desktops?

Well, I tried Knute's solution, and he wasn't kidding. It is rough. It just doesn't look as nice as notify-osd, even after customization.

Unfortunately, libaosd isn't for x86_64 (is it? Can I just change the PKGBUILD?), and I still can't find a way to move notify-osd, which would probably be the ideal solution.

sad


дɭɭɑӎɠїɾ

Offline

Board footer

Powered by FluxBB