OT: Evolution signature script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi list!
I have created this script for my signature in evolution:
cat evolution_script
#!/bin/bash

##############################################
# This script produces fancy signatures      #
# for Evolution with random animals talking  #
# or thinking of different wise things.      #
#____________________________________________#
# Created by Hiisi <saippua5@xxxxxxxxx>      #
##############################################

# Generate binary choice, that is, "true" or "false" value to choose
between 'cowsay' and 'cowthink' commands; 'cowsay' is default.
BINARY=2
T=1
number=$RANDOM
command="cowsay"
let "number %= $BINARY"
#  Note that    let "number >>= 14"    gives a better random
distribution
#+ (right shifts out everything except last binary digit).
if [ "$number" -eq $T ]
then
  command="cowthink"
fi 

animal=(`ls /usr/share/cowsay`)
# The above command gives as an array of available animal files.
# Now we need a random int within this array length, hence the 'modulo'
operator.
# This returns the remainder of a division operation.

RANGE=${#animal[@]}

number=$RANDOM
let "number %= $RANGE"
#           ^^
# Here goes html-formatting for evolution signature

echo "<div>-- </div>"
echo "<pre>"
/usr/bin/fortune linux -s | /usr/bin/$command -f ${animal[$number]}
echo "</pre>"

It's only a draft so I'm open to corrections/suggestions.
Hope you'll like it!
-- 
____________________________________ 
( Beeping is cute, if you are in the )
( office ;)                          )
(                                    )
( -- Alan Cox                        )
 ------------------------------------ 
   o
    o        .
     .---.  //
    Y|o o|Y// 
   /_(i=i)K/ 
   ~()~*~()~  
    (_)-(_)   

     Darth 
     Vader    
     koala        

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux