You are not logged in.

#1 2008-02-18 16:47:34

FightRight
Member
From: Germany
Registered: 2006-05-25
Posts: 64

Two littel tools for volume control and a openbox shutdown management

Hello there,

i have written two python scripts for volume control and shutdown management.

The volume control script require that you have to install aumix, PyGtk and GTk. In my case i start it with my Openbox session.
For this you need an entry in the autostart script from openbox. You find it on your system under ~./config/openbox/autostart.sh

Add this line with the right path to this script.
/path/to/your/script/vol.py &

And now you can use it with every openbox session cool

Ok at next i have written a shutdown script for openbox. What you need on your system is the sudo program. If you have it installed you
need the following entry in your /etc/sudoers file with the right username.

# shutdown and reboot for defined users
yourUserName ALL=(ALL) NOPASSWD:/sbin/shutdown

On my system i have made a little icon in pypanel from that i open the menu. You can see this in the video below.

OK that it is.I hope you have fun with these scripts. cool

Download:

volume_control.tar.bz2
shutdown_box.tar.bz2

Here are the shots and a small video to show you the behavior.

Screenshots:

Volume Control
Shutdown Box

Movie:

Application Movie

Best regards

Fight

Last edited by FightRight (2008-02-19 23:54:37)


Ps: Sorry for my bad english

Offline

#2 2008-03-04 01:20:43

ep2011
Member
Registered: 2008-02-28
Posts: 66

Re: Two littel tools for volume control and a openbox shutdown management

I know this is a little old, but just want to say I tried this with openbox and it is just what I was looking for! It doesn't use much ram, and is a great volume control, which was much needed for my setup smile

Thanks a lot smile!

Offline

#3 2008-03-04 19:48:12

Dzaro
Member
Registered: 2006-11-06
Posts: 24

Re: Two littel tools for volume control and a openbox shutdown management

neat
what about PKGBUILD? wink

Offline

#4 2008-03-04 22:28:16

gothmog.todi
Member
From: Austria
Registered: 2007-07-18
Posts: 120

Re: Two littel tools for volume control and a openbox shutdown management

great stuff
a suspend button in the shutdown box would be nice

Offline

#5 2008-03-05 08:11:12

dedioste
Member
From: Olgiate Olona, Italy
Registered: 2008-01-18
Posts: 7
Website

Re: Two littel tools for volume control and a openbox shutdown management

Shutdown_box is exactly what i was looking for.
Tried it yesterday night on my box and it was a charm.
Thank you!

Offline

#6 2008-03-24 05:39:45

c3l5o
Member
From: Portugal
Registered: 2007-10-14
Posts: 7

Re: Two littel tools for volume control and a openbox shutdown management

I've been trying to use your volume_control, but I seem to have a problem with aumix, as the sound only mutes on the front channel, I'm lacking the pcm channel that should control the volume for all the other channels sad

Offline

#7 2008-03-24 16:54:56

faelar
Member
From: Amiens (FR)
Registered: 2007-12-18
Posts: 232
Website

Re: Two littel tools for volume control and a openbox shutdown management

A smaller version of the gui
FightRight, there is a problem when I clic on the [X] at the top of the window. I ran your script from the terminal, and I had to do ctrl+c after that.

Offline

#8 2008-03-29 20:23:06

s26c.sayan
Member
From: Kolkata, India
Registered: 2007-02-07
Posts: 176
Website

Re: Two littel tools for volume control and a openbox shutdown management

Shutdown_box is nice.
Is there anything you could do to keep it 'always on top' of all other windows and/or. prevent it from losing focus?

I had done a similar script using wxpython which stayed on top, but I'd prefer pygtk to wxpython!


March Linux : An Arch Linux "distrolet" that I am trying to develop (March = My Arch!)
Please take a look......:)

Offline

#9 2008-03-30 15:32:33

FightRight
Member
From: Germany
Registered: 2006-05-25
Posts: 64

Re: Two littel tools for volume control and a openbox shutdown management

Ok thank you for all your comments and compliments. I have been very busy thats the reason why im answering so late. Excuse me for that roll

shutdown-box-0.1
I have a new version online for shutdown-box. Try it out cool

@s26c.sayan
The new version of the shutdown box stays on top. I hope that is what you want.

@faelar
I have insert a delete-event. Now if you click [x] the box close without any problems.


@c3l5o
The problem is that i have only two speakers and not a souround system. I implement only a control for the master channel not for the pcm channel.

If anyone have further problems let me know this i try to find a solution for that.

Best regards

Markus

Last edited by FightRight (2008-03-30 15:43:00)


Ps: Sorry for my bad english

Offline

#10 2008-06-05 13:40:13

timetrap
Member
From: Here and There
Registered: 2008-06-05
Posts: 342
Website

Re: Two littel tools for volume control and a openbox shutdown management

Excellent! I will be adding this to my awesome status bar.  cool

Offline

#11 2008-06-06 15:38:00

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,207
Website

Re: Two littel tools for volume control and a openbox shutdown management

Thank you! I'm using the shutdown box right now.

Offline

#12 2008-06-11 19:30:03

timetrap
Member
From: Here and There
Registered: 2008-06-05
Posts: 342
Website

Re: Two littel tools for volume control and a openbox shutdown management

I added a pm-hibernate command and button to your original.  I have it linked to my awesomewm icon in the upper right hand corner.  It needs a little GUI work though . . .

http://www.mediafire.com/?get11zw3j9x

Offline

#13 2008-08-14 12:21:40

mjjzf
Member
From: Odense, Denmark
Registered: 2008-03-19
Posts: 10
Website

Re: Two littel tools for volume control and a openbox shutdown management

Screenshots?

Offline

#14 2008-11-27 14:04:26

Razien
Member
Registered: 2008-05-15
Posts: 34

Re: Two littel tools for volume control and a openbox shutdown management

Does anyone have a working link for the shutdown box?
I've used a few months back, and now that im back into linux the link is dead x.x *sad*

Offline

#15 2008-11-27 16:46:05

NeOnsKuLL
Member
From: Havana, Cuba
Registered: 2005-03-29
Posts: 117

Re: Two littel tools for volume control and a openbox shutdown management

Here is the script I use for that, written in PyGtk too.

#!/usr/bin/env python
# -*- coding: UTF-8 -*-

__license__ = """
Copyright 2008 Pável Varela Rodríguez <neonskull@gmail.com>
   
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.
"""
__author__ = "Pável Varela Rodríguez <neonskull@gmail.com>"
__version__ = "0.1"


import os
try:
    import pygtk
    pygtk.require('2.0')
    import gtk
except:
    print "Fatal error! PyGTK>=2.0 not found!!!"
    os.sys.exit(1)


class ActionButton(gtk.Button):
    def __init__(self, icon_name):
        super(ActionButton, self).__init__()
        self.__name = icon_name
        self.__size = gtk.ICON_SIZE_DIALOG
        self.__icon = gtk.image_new_from_icon_name(icon_name, self.__size)
        self.__icon.set_size_request(60, 60)
        self.set_focus_on_click(False)
        self.add(self.__icon)
    
    def __str__(self):
        return self.__name


class ShutdownDialog(gtk.Window):
    def __init__(self):
        super(ShutdownDialog, self).__init__()
        self.__config()
        self.__initButtonsMap()
        self.__construct()
        self.show_all()


    def __config(self):
        self.set_default_size(240, 80)
        self.set_icon_name("gnome-session-logout")
        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
        self.set_keep_above(True)
        self.set_resizable(False)
        self.set_title("Logout")
        self.connect("delete-event", self.__quit)
        self.connect("key-press-event", self.__onKeyPress)


    def __construct(self):
        hbox = gtk.HBox()
        
        for idx in range(len(self.__buttonsMap.keys())):
            ID = str(idx)
            icon_name = self.__buttonsMap[ID]["icon"]
            name = icon_name.split("-")[-1]
            button = ActionButton(icon_name)
            setattr(self, "__%s" % name, button)
            button.connect("clicked", self.__doAction)
            hbox.pack_start(button)
        
        bottombox = gtk.HBox()
        btnCancel = gtk.Button("Cancel")
        btnCancel.connect("clicked", self.__quit)
        bottombox.pack_start(btnCancel)
        
        vbox = gtk.VBox()
        vbox.pack_start(hbox, True)
        vbox.pack_start(gtk.HSeparator(), False)
        vbox.pack_start(bottombox, False)
        self.add(vbox)


    def __doAction(self, w):
        for ID in self.__buttonsMap.keys():
            if self.__buttonsMap[ID]["icon"] == w.__str__():
                os.system(self.__buttonsMap[ID]["action"])


    def __initButtonsMap(self):
        self.__buttonsMap = {}
        self.__buttonsMap["0"] = {"icon": "gnome-session-logout",
                                  "action": "killall openbox"}
        self.__buttonsMap["1"] = {"icon": "gnome-session-reboot",
                                  "action": "gksudo reboot"}
        self.__buttonsMap["2"] = {"icon": "gnome-session-halt",
                                  "action": "gksudo halt"}


    def __onKeyPress(self, widget, event):
        if event.keyval == gtk.keysyms.Escape:
            self.__quit()


    def __quit(self, widget=None):
        gtk.main_quit()


if __name__ == "__main__":
    ShutdownDialog()
    gtk.main()

See you

Last edited by NeOnsKuLL (2008-11-27 16:48:53)


Intel Core 2 Duo E8400 3.0 GHz | 2x1GB 667MHz | 250+750GB Seageate SATAII | Samsung 19" TFT 1440x900
Openbox + obmenugen + PyTyle | bmpanel2 | oblogout | conky | pyBgSetter (with Esetroot as backend)
Projects: obmenugen, pyBgSetter

Offline

#16 2008-11-28 02:03:52

Razien
Member
Registered: 2008-05-15
Posts: 34

Re: Two littel tools for volume control and a openbox shutdown management

Thks a lot man \o

It feels a little odd not having texts, but its a nice box, minimal just like openbox XD
thks a lot

Offline

#17 2008-11-28 02:14:18

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Two littel tools for volume control and a openbox shutdown management

Razien wrote:

Does anyone have a working link for the shutdown box?
I've used a few months back, and now that im back into linux the link is dead x.x *sad*

the link isn't quite dead.

It now opens a directory listing..... and it's not that hard to find where the files have moved.

Offline

#18 2008-11-28 02:51:56

Razien
Member
Registered: 2008-05-15
Posts: 34

Re: Two littel tools for volume control and a openbox shutdown management

iphitus,
just checked now... you're right. It seems to be back online, it just happens that when I posted was offline.
I figured that since it had passed a few months, it would be normal for the link to be off.

Thanks for the heads up.

Offline

#19 2008-11-28 13:14:56

NeOnsKuLL
Member
From: Havana, Cuba
Registered: 2005-03-29
Posts: 117

Re: Two littel tools for volume control and a openbox shutdown management

Razien wrote:

Thks a lot man \o

It feels a little odd not having texts, but its a nice box, minimal just like openbox XD
thks a lot

Thanks you for use it

See you


Intel Core 2 Duo E8400 3.0 GHz | 2x1GB 667MHz | 250+750GB Seageate SATAII | Samsung 19" TFT 1440x900
Openbox + obmenugen + PyTyle | bmpanel2 | oblogout | conky | pyBgSetter (with Esetroot as backend)
Projects: obmenugen, pyBgSetter

Offline

#20 2009-04-19 09:37:41

chochem
Member
From: Denmark
Registered: 2008-03-02
Posts: 176
Website

Re: Two littel tools for volume control and a openbox shutdown management

The original author seems to have parked his domain - all links lead to crappy ads sad

Offline

#21 2009-05-11 19:22:51

froli
Member
From: Montreal, Canada
Registered: 2008-06-17
Posts: 440
Website

Re: Two littel tools for volume control and a openbox shutdown management

chochem wrote:

The original author seems to have parked his domain - all links lead to crappy ads sad

You can find the original one here

I also made a PekWM version smile

Screenshot:

shudown_pekwm

Download it here.


arch64 | I'm using Yaourt smile  | Kik Messenger: froli | Follow me on Twitter!
Intel Core 2 Quad Q8300 2.5Ghz, 6GB RAM DDR2, 1TB HDD, EVGA GTS 450, Gnome3.

Offline

#22 2009-05-11 19:32:40

Rydgel
Member
From: France
Registered: 2008-09-04
Posts: 163
Website

Re: Two littel tools for volume control and a openbox shutdown management

Nice froli big_smile

Offline

#23 2009-05-11 20:54:55

sylvarant
Member
Registered: 2009-02-02
Posts: 17

Re: Two littel tools for volume control and a openbox shutdown management

that's really cool

Offline

Board footer

Powered by FluxBB