You are not logged in.

#1 2007-06-25 17:27:30

mazingaz
Member
Registered: 2007-06-19
Posts: 5

Which pypanel volume-controls are out there?

I was wondering what would be a light weight (panel) volume control for the pypanel openbox system? NE recommendations?

Hmm.. I just wanted to know if there is a volume control apps that could be inserted to the pypanel. (panel)

Last edited by mazingaz (2007-06-25 19:34:45)

Offline

#2 2007-06-30 00:32:01

smurnjiff
Member
Registered: 2007-06-25
Posts: 211

Re: Which pypanel volume-controls are out there?

Take a look at this: http://aur.archlinux.org/packages/gvtray/ or try loading the gnome-volume-manager.

Offline

#3 2007-06-30 01:56:55

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

Re: Which pypanel volume-controls are out there?

There seems to be an error in the PKGBUILD for gvtray. The following ends up creating a folder "{usr" instead of "usr", which causes an error:

mkdir -p $startdir/pkg/{usr/{bin,share/gvtray}}

I changed it to this and it built & installed properly.

  mkdir -p $startdir/pkg/usr/bin
  mkdir -p $startdir/pkg/usr/share/gvtray

Last edited by Axis (2007-06-30 01:59:54)

Offline

#4 2007-06-30 03:12:55

smurnjiff
Member
Registered: 2007-06-25
Posts: 211

Re: Which pypanel volume-controls are out there?

I posted a comment on the package page so the maintainer will update the script.

Edit: Adopted the package and fixed the error myself.

Last edited by smurnjiff (2007-06-30 04:19:20)

Offline

#5 2007-06-30 10:36:52

oliwer
Member
From: Paris
Registered: 2007-06-30
Posts: 153
Website

Re: Which pypanel volume-controls are out there?

I tested gvtray and didn't like it sad

The best solution I found is to code my own trayicon to change the volume with the mouse wheel. Here is the code :

#!/usr/bin/env perl

# volwheel.pl - set volume with mousewheel
# Author : Olivier Duclos <oliwer@free.fr>

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version. 
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details. 
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
# USA

use strict;
use warnings;
use Gtk2 '-init';
use Gtk2::TrayIcon;

our $VERSION = "0.1"; # 2007.05.13
our $MIXER = "xfce4-mixer";


# M A I N #

# Tray icon
my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file("/usr/share/icons/gnome/24x24/apps/multimedia-volume-control.png");
my $icon = Gtk2::Image->new_from_pixbuf($pixbuf);
my $trayicon = Gtk2::TrayIcon->new("volwheel");
my $tooltip= Gtk2::Tooltips->new;
$tooltip->set_tip($trayicon, "VolWheel");
my $eventbox = Gtk2::EventBox->new;
$eventbox->add($icon);
$trayicon->add($eventbox);
$eventbox->signal_connect( 'button_release_event', \&click_handler );
$eventbox->signal_connect( 'scroll_event', \&scroll_handler );
$trayicon->show_all;

Gtk2->main;





# S U B S #

sub volup {
    system "amixer set PCM 3%+ > /dev/null";
}

sub voldown {
    system "amixer set PCM 3%- > /dev/null";
}

sub launchMixer {
    exec $MIXER unless fork;
}

sub click_handler {
    my ($check, $event) = @_;
    
    if (1 eq $event->button) {
        &launchMixer;
    }
    else {
        if (3 eq $event->button) {
            &popup;
        }
    }
}

sub scroll_handler {
    my ($check, $event) = @_;
    
    if ("up" eq $event->direction) {
        &volup;
    }
    else {
        if ("down" eq $event->direction) {
            &voldown;
        }
    }
}

sub popup {
    my $item_factory = Gtk2::ItemFactory->new("Gtk2::Menu", '<main>', undef);
    my $popup_menu = $item_factory->get_widget('<main>');
    my @menu_items = (
               { path => '/About',       item_type => '<Item>', callback => \&about_dialog},
               { path => '/Exit',        item_type => '<Item>', callback => \&out}
             );

    $item_factory->create_items(undef, @menu_items);
    $popup_menu->show_all;
    $popup_menu->popup(undef, undef, undef, undef, 0, 0);
}

sub about_dialog {
    my $about = Gtk2::AboutDialog->new;
    $about->set_name("VolWheel");
    $about->set_version($VERSION);
    $about->set_copyright("Copyright (c) Olivier Duclos 2007");
    $about->set_comments("Set volume with the mousewheel. Sweet!");
    $about->set_website("oliwer\@hedinux.org");
    $about->set_logo($pixbuf);
    $about->run;
    $about->destroy;
}

sub out {
    Gtk2->main_quit;
}

Don't forget to change the mixer and the icon if you don't have XFCE installed.

The only drawback of this perl script is that it uses the Egg Trayicon library, which is now deprecated in Gtk 2.10. If somebody knows a good tutorial on how to manage signals on GObjects in Perl, that would help a lot.

Offline

#6 2009-08-25 18:00:58

pluckypigeon
Member
Registered: 2009-01-09
Posts: 86

Re: Which pypanel volume-controls are out there?

I know this is an old post but just incase someone stumbles upon it ....

I tried "volwheel".  I'd recommend it.

It's as simple as adding it to your startup.sh file.

Last edited by pluckypigeon (2009-08-25 18:01:26)

Offline

Board footer

Powered by FluxBB