You are not logged in.
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
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.
Download:
volume_control.tar.bz2
shutdown_box.tar.bz2
Here are the shots and a small video to show you the behavior.
Screenshots:
Movie:
Best regards
Fight
Last edited by FightRight (2008-02-19 23:54:37)
Ps: Sorry for my bad english
Offline
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
Thanks a lot !
Offline
neat
what about PKGBUILD?
Offline
great stuff
a suspend button in the shutdown box would be nice
Offline
Shutdown_box is exactly what i was looking for.
Tried it yesterday night on my box and it was a charm.
Thank you!
Offline
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
Offline
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
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
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
shutdown-box-0.1
I have a new version online for shutdown-box. Try it out
@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
Excellent! I will be adding this to my awesome status bar.
Offline
Thank you! I'm using the shutdown box right now.
Offline
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 . . .
Offline
Screenshots?
Offline
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
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
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
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
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
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
The original author seems to have parked his domain - all links lead to crappy ads
Offline
Offline
Nice froli
Offline
that's really cool
Offline