You are not logged in.

#26 2010-01-24 12:58:21

Chokkan
Member
Registered: 2009-04-06
Posts: 129

Re: Fancy New Onscreen Volume Display for Openbox, et al

OK, I'm a convert, and your script is working great. Can you give me some pointers on further config? I ran xfce4-notifyd-config and managed to do a bit.


< Daenyth> tomkx: my girlfriend is linux
< Daenyth> srsly
< Daenyth> she loves the way I «make install»
< Daenyth> all her /dev entries are mode 7 for me

Offline

#27 2010-01-24 13:10:58

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: Fancy New Onscreen Volume Display for Openbox, et al

Chokkan wrote:

OK, I'm a convert, and your script is working great. Can you give me some pointers on further config? I ran xfce4-notifyd-config and managed to do a bit.

big_smile
[OT]
The default theme should suit your gtk theme; however this does not look good for some themes.
ZOMG-PONIES theme is a bit strange but... you might like it. lol
So, the first step is to take the Smoke theme (/usr/share/themes/Smoke), copy it in ~/.themes, change the name of the folder, and look at the gtkrc file: you can change colors, shape and the border of the notification.

For example if you download my Arkid theme you will find also a xfce4-notifyd theme, you might take a look at the gtkrc and see how it looks (just place the Arkid folder in .themes and select the theme from xfce4-notifyd-config).
--> http://rent0n86.deviantart.com/art/Arkid-148937983
[/OT]

Good luck! smile


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#28 2010-01-25 14:51:11

Roline
Member
From: Netherlands
Registered: 2009-12-05
Posts: 207
Website

Re: Fancy New Onscreen Volume Display for Openbox, et al

rent0n wrote:

Well, I really don't like notify-osd; xfce4-notifyd is much better and more customizable (and is not ubuntu's)! wink

So I've modified the script to work with my Volume config (I use PCM mainly + Master to toggle mute/unmute) and to work with xfce4-notifyd. It's much simpler because it has no icons or bars and just displays "Volume: 50%" for example. So it's not that fancy anymore, but fits perfectly on a minimal desktop. big_smile

...

Could you post your keybindings? I can't get the script to work smile


Bitbucket - DeviantART - Userstyles
*Currently Not Using Arch

Offline

#29 2010-01-25 16:31:23

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

Re: Fancy New Onscreen Volume Display for Openbox, et al

pvol.png

pvol - no notify, no dbus, no amixer, no aumix... only python.


You need to install an RTFM interface.

Offline

#30 2010-01-25 17:11:41

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: Fancy New Onscreen Volume Display for Openbox, et al

Roline wrote:

Could you post your keybindings? I can't get the script to work smile

I just put the script in ~/.scripts, chmod +x it and then set up my rc.xml this way:

    <keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <execute>/home/enrico/.scripts/VolumeNotify.sh up</execute>
      </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <execute>/home/enrico/.scripts/VolumeNotify.sh down</execute>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute">
        <execute>/home/enrico/.scripts/VolumeNotify.sh toggle</execute>
      </action>
    </keybind>

It should work! big_smile

@anrxc: Nice project, will test it as soon as I have some time!


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#31 2010-05-09 19:19:03

Axis
Member
Registered: 2007-05-13
Posts: 60

Re: Fancy New Onscreen Volume Display for Openbox, et al

rent0n, great job! I modified the script to work with OSS PCM channel. However one issue: If I change the volume multiple times, the notification does not update until the previous one disappears. In other words, if I run the script 3 times (Volume: 10%, 16%, 19% for example) the notification will not update the volume level until the previous notification goes away. Any way to make it regenerate automatically even if a notification is already being displayed?

I added "--expire-time=1" to make the notification disappear faster but it only helps a little.

P.S. The mute section may not be completely correct because I have never been able to get OSS to restore my volume levels when I unmute. But that's another issue entirely.

EDIT: I noticed this is only an issue with knotify and notify-osd. Works fine with xfce4-notifyd.

#!/bin/bash

command=$1

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

display_volume=0

if [ "$command" = "up" ]; then
    ossmix pcm +3
    display_volume=$(ossmix pcm | cut -d ":" -f2)
fi

if [ "$command" = "down" ]; then
    ossmix -- pcm -3
    display_volume=$(ossmix pcm | cut -d ":" -f2)
fi

icon_name=""

if [ "$command" = "toggle" ]; then
    ossmix pcm toggle
    display_volume=$(ossmix pcm | cut -d ":" -f2)
fi

notify-send --expire-time=1 "Volume: $display_volume%"
exit 1

Last edited by Axis (2010-05-10 15:36:12)

Offline

#32 2011-08-23 00:05:51

semaphore
Member
Registered: 2011-08-22
Posts: 1

Re: Fancy New Onscreen Volume Display for Openbox, et al

i had a misunderstanding of how to use it(i thought that arguments "-i", "-m" was optional), so open the code to understand it and i make some changes to it, so i am posting it back in my Version 0.03
-adding default values
-c argument is needed to work
-improve help file

#!/bin/sh
version=0.03
# created by abarilla
# modified by wujaklija
# modified by ^^FiCK^^
#usage="usage: $0  -c up|down|mute [-i increment] [-m mixer]"
usage="$0 Version $version Help\nDependencies: libnotify, alsa-utils\nusage:\n\t $0  [OPTIONS] -c COMMAND \nCOMMAND:\n-c\t up \n\t\t(increase volume by increment)\n\tdown \n\t\t(decrease volume by increment)\n\tmute \n\t\t(mute volume) \n\nOPTIONS:\n-i\t increment \n\t\t(the amount of db to increase/decrease)[default:2500] \n-m\t mixer \n\t\t(the device to change)[default:Master]"

#Default values
command=
increment=2500
mixer="Master"

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

#if [[ -z $command ]] || [[ -z $increment ]] || [[ -z $mixer ]]
#then
#     echo $usage
#     exit 1
#fi

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

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

display_volume=0
icon_name=""
if [ "$command" = "up" ]; then
    display_volume=$(amixer set $mixer $increment+ unmute | grep -m 1 "%]" | cut -d "[" -f2|cut -d "%" -f1)
else 
	if [ "$command" = "down" ]; then
	    display_volume=$(amixer set $mixer $increment- unmute | grep -m 1 "%]" | cut -d "[" -f2|cut -d "%" -f1)
	else 
		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
		else
		     echo -e $usage
		     exit 1
		fi
	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 -u normal -t 100 "$mixer"
notify-send " " -i $icon_name -h int:value:$display_volume -h string:synchronous:volume 
#notify-send "$mixer" -i $icon_name

Offline

#33 2011-11-30 19:34:06

Premik
Member
Registered: 2011-11-30
Posts: 1

Re: Fancy New Onscreen Volume Display for Openbox, et al

Thank you guys, finally my Print Screen and Scroll Lock became useful keys smile

Offline

Board footer

Powered by FluxBB