You are not logged in.
I created a script for handling my volume control which uses the notify-osd package from AUR. This is the newfangled notifications from Ubuntu. It's nothing fancy so the notify-osd-bzr package will probably work fine as well.
This is for alsa but with some minor mods it should work with oss.
You can download the script here: http://mozicodo.s3.amazonaws.com/vol.sh
The format for the command is: vol.sh {up|down|mute} [-i increment] [-m mixer]
Increment is either a percent or number just like you would pass to amixer. Defaults to 5%
Mixer is the name of the control to change. Defaults to Master
For example to increase the volume of PCM by 10% you would do:
vol.sh up -i 10% -m PCM
Let me know of any suggestions for improvements.
Edit: fixed the urls
Last edited by abarilla (2009-10-27 15:07:40)
Sic gorgiamus allos subjectatos nunc
Offline
This looks really nice. I would like to try this out when i get home, wich is in a few hours. But again, looks like something i would like to use. Great work!
Offline
Using it now. Works well. Thanks
Offline
Geat!!!
I'm searching some program for this but old xosd don't work with Fluxbox.
"Yo creo que los muertos son tiernos. ¿Nos besamos?"
Offline
wooooow, this is really pretty. i had a hacked-together script i used that worked with the old libnotify, but this new one didn't play all that nicely. thanks for this!
Offline
Can someone post the script here? The link to the script is "under construction", and I was thinking of doing something similar, which (since it has already been done) saves me some work!
Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds
Offline
I also only get a blank page with "under constructions" as a title when trying to open the screenshot or the script. It would be really nice if someone could fix the links or post the script again.
My System: Dell XPS 13 | i7-7560U | 16GB RAM | 512GB SSD | FHD Screen | Arch Linux
My Workstation/Server: Supermicro X11SSZ-F | Xeon E3-1245 v6 | 64GB RAM | 1TB SSD Raid 1 + 6TB HDD ZFS Raid Z1 | Proxmox VE
My Stuff at Github: github
My Homepage: Seiichiros HP
Offline
I've emailed the OP, and I will (if he doesn't mind), post the script here if I get it from him.
Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds
Offline
i made a little change on a script
http://www.4shared.com/file/117790213/59106c1f/vol.html
Offline
I have tested the script out, but yet I seem to be having issues with notify-osd displaying the stuff.
It seems as if notify-osd isn't drawing anything but the bubble. Has anyone had this issue with the script? (Notify-osd works fine for all the other things I use it for, save for the fact that it doesn't seem to show icons for anything but Dropbox...maybe I'm missing the icon package for it?)
Below are the notify-osd related packages I have installed:
┌─[lswest@Monster:~]-[16:57:11 on 09-07-13]
└─> yaourt -Ss notify-osd|grep installed
aur/gnome-mount-notify-osd 0.8-2 [installed] (31)
aur/gnome-settings-daemon-notify-osd 2.26.1-2 [installed] (15)
aur/notify-osd-bzr 311-1 [342-1 installed] (73)
aur/pidgin-libnotify-notify-osd 0.14-3 [installed] (60)
Thanks in advance for any ideas,
Lswest
Also, below is the original vol.sh script from Abarilla:
#!/bin/sh
usage="usage: $0 -c {up|down|mute} [-i increment] [-m mixer]"
command=
increment=5%
mixer=Master
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
Last edited by lswest (2009-07-13 15:07:17)
Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds
Offline
screenshot.working = false;
dieter@dieter-ws-a7n8x-arch ~ curl -I http://exit66.com/static/screen20090410.png
HTTP/1.1 404 Not Found
Date: Mon, 13 Jul 2009 16:36:52 GMT
Server: Apache/2.2.9 (Fedora)
X-Powered-By: PHP/4.4.9
Content-Length: 839
Connection: close
Content-Type: text/html; charset=UTF-8
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
Im using wicd and batterymon which both use libnotify and notification-daemon. I have removed libnotify and notification-daemon and used notify-osd and the volume works, but wicd and batterymon don't. Using libnotify i can get the other 2 to work but not this script, i get the popup but then no text just the volume icon. Thanks
Offline
Awesome! This is working perfectly! I just have one question:
How can I center the notify-osd window? It always seems to appear in the top right of my screen, covering my status bar. I would prefer a centered notification.
дɭɭɑӎɠїɾ
Offline
FYI, I updated the urls in the first post so they are working again.
Thanks,
Andy
Sic gorgiamus allos subjectatos nunc
Offline
Allamgir: you can't center the notify-osd popups. Ubuntu's notify-osd dev team (or single dev, I'm not sure) has decided that 'sane defaults' are the best way to go and have foregone any ability to change position of the notifications. (This is the reason I'm not using notify-osd at the moment. I also won't be using it until they understand that, while adding configuration makes the program more difficult to test, it's the only way to truly satisfy any sizeable audience.)
"Unix is basically a simple operating system, but you have to be a genius to understand the simplicity." (Dennis Ritchie)
Offline
This is going to be a pretty silly question, but how exactly do I use it? How do I identify the keystoke from the keyboard?
Offline
You can edit rc.xml to add keymaps for vol.sh.
Offline
great job mate. I'm using it right now with xbindkeys in place of setting directly the volume scrollwheel of my laptop to change the volume of alsamixer. Thanks
Offline
Awesome, thanks for sharing!
Offline
very awesome script... thank you for sharing!
Offline
uhm...doesn't work for me.
I've just got a blank notification
(Maybe because I'm trying to use it with xfce4-notifyd?)
The links in the first post are not working.
Thanks!
Last edited by rent0n (2010-01-23 22:34:39)
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
It won't work with xfce4-notifyd, because xfce4-notifyd doesn't support the "synchronous" hint. You shouldn't get a blank notification though, what you should get is a new bubble with each volume change. Oh, I just remembered - even this only works with the git version of xfce4-notifyd. But basically, you're out of luck; this script only works correctly with notify-osd.
Offline
Well, I really don't like notify-osd; xfce4-notifyd is much better and more customizable (and is not ubuntu's)!
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.
#!/bin/bash
command=$1
if [ "$command" = "" ]; then
echo "usage: $0 {up|down|toggle}"
exit 0;
fi
display_volume=0
if [ "$command" = "up" ]; then
amixer sset Master unmute
display_volume=$(amixer sset PCM 4+ unmute | grep -m 1 "%]" | cut -d "[" -f2|cut -d "%" -f1)
fi
if [ "$command" = "down" ]; then
amixer sset Master unmute
display_volume=$(amixer sset PCM 4- unmute | grep -m 1 "%]" | cut -d "[" -f2|cut -d "%" -f1)
fi
icon_name=""
if [ "$command" = "toggle" ]; then
if amixer get Master | grep "\[on\]"; then
amixer sset Master mute
display_volume=0
else
amixer sset Master unmute
display_volume=$(amixer get PCM | grep -m 1 "%]" | cut -d "[" -f2|cut -d "%" -f1)
fi
fi
notify-send "Volume: $display_volume%"
exit 1
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
I'm using the original script. Works great! rent0n, can you explain how xfce4-notifyd is more customizable?
< 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
Well, basically you can decide pretty everything (colors, style, font, borders, transparency, time before disappearance) using a simple gtkrc file.
This way it can follow the color and the style of your gtk theme (very cool).
And another good thing is that it has a normal notification behaviour. I never liked how notify-osd behave, it's so weird!
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