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


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to