Todd Slater wrote:
Very interesting Todd. Thanks for yor help and input. I am still very much a newbie and not well versed at all in scripting. This will be an opportunity for me to learn something. :-)On Thu, 5 Dec 2002 11:59:53 -0500 Todd Slater <[EMAIL PROTECTED]> wrote: <snip>It seems that this should be an easy thing to do with a bash script, then bind it to some key. In fact, that's all jTFlashManager does--renames the libflashplayer.so and ShockwaveFlash.class. For the script, all you'd have to do is make sure you have permissions to rename the files, then write one script to rename them "x-off" (like your example) and another to return them to their original names. Or, a better idea, use a single script that toggles on/off (depending on which filename exists). So, I might hit alt-f on my keyboard to enable/disable Flash. I'll work on it when I get home, now I'm curious about it! Todd
It's not pretty, but it works! I'm using Fluxbox and I bound this script
to alt-f. Copy and paste into your favorite editor, save and make it
executable (chmod u+x flash.sh).
#!/bin/bash
# flash.sh -- toggle flash on/off
# Where is Flash located? Put all paths here
# You need write access to libflashplayer.so
# and ShockwaveFlash.class
fpath1=/home/todd/phoenix/plugins
#fpath2=/another/place
#fpath3=/still/another/place
# Where to move Flash (to "turn it off"?)
NotherPath=/home/todd
# Locate Flash files and make a list of them
# If you specified more than one path above,
# add them after $fpath1, i.e. # find $fpath1 $fpath2 etc.
if [ ! -f .libflashlocations ] ; then
find $fpath1 -name libflashplayer.so > .libflashlocations
find $fpath1 -name ShockwaveFlash.class > .shockflashlocations
fi
# If Flash is on, turn it off
if [ -f `head -1 .libflashlocations` ] ; then
for i in `cat .libflashlocations`
do
FileName=`basename $i`
mv $i $NotherPath/$FileName
done
for i in `cat .shockflashlocations`
do
FileName=`basename $i`
mv $i $NotherPath/$FileName
done
else # turn it back on for i in `cat .libflashlocations`
do
FileName=`basename $i`
mv $NotherPath/$FileName $i
done
for i in `cat .shockflashlocations`
do
FileName=`basename $i`
mv $NotherPath/$FileName $i
done
fi
exit
Meanwhile, I have found that although simply renaming the Flash files seemed to stop Flash for a while it would reappear. I tracked down every single libflash.so and ShockwaveFlash.class file I could find and re-renamed them from libflash-off.so (I thought just adding -off might be too similar) to xl.so and xs.class. No help... flash would not die.
Finally, I created a new directory in /usr/local/mozilla and moved the Flash files from /usr/local/mozilla/plugins to the new directory. That seems to have done it. Flash was gone from Mozilla, but was still in Phoenix. After doing the same process in /usr/local/phoenix Flash was gone there also. I have no idea why renaming the files did not work. Could the paths have been recreated somehow after closing and reopening Mozilla, or rebooting?
Thanks again for your help and ideas.
Mike
--
-------------------------------------------------------
Mike Larson
Registered Linux User # 246593 http://counter.li.org/
Linux Mandrake 9.0 KDE 3.0.3 Mozilla 1.2.1
-------------------------------------------------------
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
