Alright, at the risk of answering my own question, I came up with a bit of a hacked together pyqt version of pvol from the link in the question above. If nothing else, maybe someone else can improve on my code. Eventually, I plan to either get rid of the parts in the script below which go unused or to take the bash scripts out of the equation and have one pyqt script handle all of the button events. Right now, the OSD times out at a constant rate from the first button press instead of staying on for a fixed amount of time after the last button press.
Just copy, paste and save the files (with the names in bold), put them all in the same directory, set the executable bits, and modify the system calls in the pyqt script according to wherever you save them, or put them all in directory that's in your path. Then map the shell scripts to Compiz commands, Openbox shortcuts, or something similar, and change the pyqt script if you're not using multimedia keyboard volume buttons.
Note: The class name Qvol was a working title, and I didn't bother to change it. Please also note that the mute button goes unhandled--This is just a prototype to express a possible avenue for fulfilling the requested features, and it is not currently associated with any kind of hosted project or standard development model. Any kind of significant development derived from the code below should probably belong on Sourceforge, GitHub or a project website. That said, feel free to edit this answer or to suggest an existing project which allows is similar in function and design.
vol_step_down
#!/bin/bash
pulseaudio --check
#if [ $? -ne 0 ] ; then
if [ $? -eq 0 ] ; then
pactl set-sink-volume 0 -- -3db
else
amixer -c0 set Master playback 3-
fi
if [ -z "$1" ] ; then
pqvol -s
fi
vol_step_up
#!/bin/bash
pulseaudio --check
#if [ $? -ne 0 ] ; then
if [ $? -eq 0 ] ; then
pactl set-sink-volume 0 -- +3db
else
amixer -c0 set Master playback 3+
fi
if [ -z "$1" ] ; then
pqvol -s
fi
pqvol
#!/usr/bin/env python2
# pvol -- Commandline audio volume utility
# with an optional GTK progressbar
# Copyright (C) 2009 Adrian C. <anrxc_sysphere_org>
# Modified by 2011 Reza Jelveh
# Ported to pyqt and renamed to pqvol 2013 by Adam R.
# 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.
import os.path
import optparse
import alsaaudio
import sys
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import QTimer
appname = "Qvol"
#appicon = "/usr/share/icons/ubuntu-mono-light/status/24/audio-volume-high-panel.svg"
DEFAULT_STYLE = """
QProgressBar{
border: 2px solid grey;
border-radius: 5px;
background-color: transparent;
}
QProgressBar::chunk {
background-color: Gainsboro;
}
"""
class AlsaMixer():
def __init__(self, pcm=False, mute=False, arg=None):
self.mixer = alsaaudio.Mixer()
self.percent = self.mixer.getvolume()[0]
print self.percent
self.label = "dB" #% name
if arg:
self.percent = min(100, max(0, self.percent + int(arg)))
self.mixer.setvolume(self.percent)
if mute:
mutestate = self.mixer.getmute()[0]
if mutestate:
self.label = "Unmuted: "
else:
self.label = "Muted: "
self.mixer.setmute(mutestate^1)
# self.label = self.label + "%.0f%%" % self.percent
class Qvol(QtGui.QWidget):
def __init__(self):
super(Qvol, self).__init__()
# self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
self.setWindowFlags(QtCore.Qt.Popup)
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
self.setWindowTitle("Qvol")
self.initUI()
def initUI(self):
self.pbar = QtGui.QProgressBar(self)
self.pbar.setGeometry(5, 5, 20, 470)
self.pbar.setOrientation(QtCore.Qt.Vertical)
self.pbar.setRange(0,100)
volume = AlsaMixer()
self.pbar.setValue(volume.percent)
self.pbar.setTextVisible(False)
self.setStyleSheet(DEFAULT_STYLE)
self.setGeometry(1260, 180, 30, 480)
self.setWindowTitle('QtGui.QProgressBar')
self.show()
QTimer.singleShot(2000, finished)
def keyPressEvent(self, event):
if event.key()==QtCore.Qt.Key_VolumeMute:
# QtGui.QWidget.paintEvent()
finished()
elif event.key()==QtCore.Qt.Key_VolumeDown:
launch_process ("vol_step_down silent")
volume=AlsaMixer()
self.pbar.setValue(volume.percent)
# finished()
elif event.key()==QtCore.Qt.Key_VolumeUp:
launch_process ("vol_step_up silent")
volume=AlsaMixer()
self.pbar.setValue(volume.percent)
# finished()
# else:
# QtGui.QWidget.keyPressEvent(self, event)
processes = set([])
def launch_process(process):
# Do something asynchronously
proc = QtCore.QProcess()
processes.add(proc)
proc.start(process)
proc.waitForFinished(-1)
def finished():
print "The process is done!"
# Quit the app
QtCore.QCoreApplication.instance().quit()
def main():
app = QtGui.QApplication(sys.argv)
ex = Qvol()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
You can use webcam studio.
Some of the features include:
- Switch webcams on a single click
- Show an IRC channel in your video broadcast
- Broadcast your desktop for creation of nice HOWTO's
- Be creative and put animations and banners
- Display what song is currently played by Rhythmbox
- Co-host a remote friend, show his webcam inside your output
(PicInPic)
- Connect to WeatherBug and display your current weather
- Apply some fancy effects on each source
- Have a green wall, then why not use the ChromaKey effect to do the
same as the weather man on the news network
- Use all kinds of devices as webcamera like a MiniDV, your iPhone,
etc....
Download from here
source
Another way is to use the Gnome Mplayer
you can install by:
sudo apt-get install gnome-mplayer
This command will show the window of the webcam output while screencasting so any screencast software you can use can also screencast your webcam output so you don't need other software to merge.
mplayer -cache 128 -tv driver=v4l2:width=176:height=177 -vo xv tv:// -noborder -geometry "95%:93%" -ontop
Please watch this video to demonstarte how to use gnome-mplayer in screencasting with webcam window enabled
How to record my screen? : List of screencast software for Ubuntu( Personally I advise you kazam)
Best Answer
Install
compizconfig-settings-manager
Open CCSM and go to
Effects
->Wizard
, choose some key combination to turn it on/off.For me it is Ctrl+Shift+Alt+W.
Don't forget to enable Wizard.
Now you can try it. Press Ctrl+Shift+Alt+W to turn on/off animation.
I hope this is enough blatant for you.
Do Alarm
Now go to terminal, And run:
If you want to run it every 20 minutes, just add this command to
crontab
, with exportingDISPLAY
variable.execute
crontab -e
, and add this lineMay be it would be better to turn off this effects automatically, especially if you are away from computer.
This command will do the same, but after 20 seconds it turns off.