This magic instrument should be able
(1) to kill adobe-flashplugin without killing browsers,
(2) to fix all problems with a mouse click.
To create such a magic tool, you can simply modify the native script "killprocs.sh"
Code: Select all
$ cat freesound.sh
#!/bin/bash
# Script to free the sound device for "skype_oss_wrapper" and/or "exclusive mode", e.g. "ossplay -R"
# Source: /usr/lib/oss/scripts/killprocs.sh
# Step 1: Kill programs which are using OSS devices
PROCS="`fuser /dev/mixer* /dev/dsp* /dev/audio* /dev/sequencer /dev/music /dev/midi* 2>/dev/null`"
if test "$PROCS " = " "
then
exit 0
fi
for pid in $PROCS
do
# ps ax|grep "^ *$pid "
# echo killing $pid
kill -9 $pid
done
wait
# Step 2: Relaunch the OSS Mixer GUI daemon
ossxmix -b &
# Pop-up notifications for MATE desktop
# See: http://mate-desktop.org/blog/2013-01-20-changes-to-mate-notification-daemon/
killall mate-notification-daemon -q
icon=/opt/scripts/icons/freesound48.xpm
notify-send " Sound device is free" --icon=$icon -t 5000
exit 0
Save it as "freesound.sh" and make it executable
Code: Select all
$ chmod +x freesound.sh
If you do not use pop-up notifications, you may comment them out.
Copy freesound.sh to your script folder
Code: Select all
$ sudo cp freesound.sh /opt/scripts
Create a symbolic link:
Code: Select all
$ sudo ln -s /opt/scripts/freesound.sh /usr/bin/freesound
Unzip icons and copy them to your script folder
Code: Select all
$ sudo cp -r icons /opt/scripts
Now we can create a launcher for freesound
Code: Select all
$ echo "[Desktop Entry]
Name=freesound
Comment=Free sound device for "exclusive mode"
Exec=freesound
Icon=/opt/scripts/icons/freesound24.xpm
Terminal=false
Type=Application
Encoding=UTF-8
Categories=AudioVideo;" > freesound.desktop
You can view it on terminal
Code: Select all
$ cat freesound.desktop
or open it with a text editor of your choice
Code: Select all
$ pluma freesound.desktop
To enable this "application launcher", you can copy it to /usr/share/applications/
Code: Select all
$ sudo cp freesound.desktop /usr/share/applications/
It will appear in the "Application Menu", and you can drag and drop it to panel.
Now you can test it with browsers/adobe-flash, etc.
How to use:
1. Run "freesound" with a mouse click.
2. Then you can run "skype_oss_wrapper", or "ossplay -R", or "pcm_play -e", or DeadBeef in exclusive mode.