xcowsay talking lobster? new x message display with icon

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#76 Post by Lobster »

Thanks Seaside

I have released an updated version here
http://www.murga-linux.com/puppy/viewto ... 208#445208
which includes some background sparkle

This is the new code
would like to get that full screen toggle to work . . .

Code: Select all

#! /bin/bash
# CyberChant 0.5
# Lobster, Vovchic, Joe Big Bass, Seaside, Potong, Seaside - Aug 25 010
# for Lucid 5.1
# http://www.timesonline.co.uk/tol/news/uk/article631958.ece
# Anglican priest Hindu

# --------------------
function init_vars()
# --------------------
{
cd /mnt/home/aaa_ganesha/cyberchant	
   NUM=3 # Change the number of default recitations
   sec=10
   fnt="DejaVu Sans Bold 15"

 txt1="Ganesh\n
Will chant mantras for you\n
OM SHANTI OM" 
   
 txt2="Om Gam Ganapatayei Namaha"  
} 

# # # # # # # # # # # # # # #
function input_message()
# # # # # # # # # # # # # # #
{
# click on x top right does not cancel but runs - add option to turn off full screen
export DIALOG='
<window title="Mantras" icon-name="gtk-dialog-question">
  <vbox>
    <hbox>
      <text>
        <label>Mantra Recitals:</label>
      </text>
      <entry activates-default="true">
        <default>3</default>
   <variable>NUM</variable>
      </entry>
    </hbox>
   <checkbox use-stock="true" label="gtk-fullscreen" image-position="1"
tooltip-text="checkbox derives from button ...">
</checkbox>
   <hbox>
      <button cancel></button>
      <button can-default="true" has-default="true" use-stock="true" >
        <label>gtk-ok</label>
         </button>
    </hbox>
  </vbox>
</window>
'
CHOICES=`gtkdialog3 --program=DIALOG`
eval $CHOICES
repetitions=$NUM 
}

# # # # # # # # # # # # # # #
function display_message()
# # # # # # # # # # # # # # #

{
 aplay tinsha.wav "$@" &
 xpupsay --image=ganesha1.gif --time=4 "Om Gam Ganapatayei Namaha"  "$@"
   printf %b "$txt1" | xpupsay --image=nandi.png --time=$sec --font="$fnt" "$@" | aplay &
  sleep 10

 for g in $(eval echo {$repetitions..1})
  do
   mplayer Ganesh_Mantra.mp3 "$@" &
   mplayer -fs -nosound ed2.mp4 &
    printf %b "$txt2 \n\n" " $g" | xpupsay --image=ganesh.gif --time=7 --font="$fnt" "$@" 
  #  gxine Ganesh_Mantra.mp3 "$@" & 
  done
 sleep 2 

 xpupsay --image=ganesha1.gif --time=9 "Om Gam Ganapatayei Namaha" "$@" &
 aplay tinsha.wav "$@" &
}

# # # # # # # #
# END FUNCTIONS
# # # # # # # #


# # # # # # # #
# MAIN
# # # # # # # #

init_vars

#if [ "gtk-fullscreen" = "1" ]
#then
#echo true
#fi
#else echo false
input_message
display_message

# # # # # # # #
# END MAIN
# # # # # # # #
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#77 Post by big_bass »

Hey Lobster

its good to see that you are having fun coding


I want to get back to using xcowsay
there is still a lot that can be done with it

we just scratched the surface of all the cool things that will be done with it

I am still thinking about an easy code generator GUI for
it I believe it will happen when we have more users
post there examples to express their imaginations

that will better define what should be added to the options in the GUI list

Joe

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#78 Post by Lobster »

Image

Thanks Joe,

Have done a Buddhist version for Tara
Mother of the imaginary Tantric Buddhas

http://tmxxine.com/tara/tara.zip
run the enclosed pupsay if not on your system
- I would not try more than 3 loops
as I have not done the timings
as I quite like the over looping . . .

You can see it running here
http://www.youtube.com/watch?v=p3v_cr5o3JE

OM TARE TU TARE TURE SOHA
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

mave
Posts: 129
Joined: Thu 02 Apr 2009, 13:42
Location: Germany

#79 Post by mave »

Hi,

saw chinese and russian examples. So compiled xcowsay under 5.1 and didn't get german umlaute. uuups. Should be showing UTF correctly, or not?

Markus
Attachments
xcowsay-umlaute.jpg
(87.6 KiB) Downloaded 1007 times

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

Umlauts

#80 Post by vovchik »

Works for me - for some reason....
Attachments
xcowsay-german.jpg
(38.68 KiB) Downloaded 2407 times

mave
Posts: 129
Joined: Thu 02 Apr 2009, 13:42
Location: Germany

#81 Post by mave »

Danke vovchik :wink:

Uuups,I used the original xcowsay, now taken the modified xpupsay and it works - wow!

Thanks to the guys!

Markus

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#82 Post by Lobster »

Image
In my efforts to educate myself and perhaps the children who will be learning programming on Puppy running on raspberry pi (when available) I have created a complete first lesson in Bash script using xpupsay . . .
The downloadable zip file includes all you need including xpupsay
which works OK in Puppy 5.3.1 - the only system I tried it on 8)

To run the tutorial you need to install xpupsay
just click on xpupsay.pet
You will need to change the permissions of script files
with the .sh - to allow them to run
in puppy - right click on the file in rox
(click on the home icon - you are in rox)
and change permissions

The first program is a hello world example

Code: Select all

#! /bin/bash
# 16 Dec 2011 Lobster
# Example 1 hello world example

xpupsay "hello world"
xpupsay "puppy power"

Code: Select all

#! /bin/bash
# 16 Dec 2011 Lobster
# Example 3 play audio loop

  xpupsay "Let's boogy"
  
for i in {1..5}
do
 aplay /usr/share/audio/beep_high.wav
 aplay /usr/share/audio/beep_high.wav
  sleep .2
 aplay /usr/share/audio/beep_low.wav 
   sleep 1
 aplay /usr/share/audio/beep_high.wav
 aplay /usr/share/audio/audio/error.wav
done 
moving right up to example 3 which covers the first use of loops
Is that the simplest for loop?
Attachments
pupschool1.zip
(109.77 KiB) Downloaded 755 times
Last edited by Lobster on Tue 20 Dec 2011, 06:32, edited 2 times in total.
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#83 Post by vovchik »

Dear Lobster,

Very nice start. I could see a complete tutorial, and having teachers flock to puppy as a preferred vehicle for teaching basic programming concepts. Too much work for me, but it could be a collective effort. If my memory serves me right, quite a bit of work was done already on an edupuppy at some point but i don't know what's in it. I'll have to have a look.

With kind regards,
vovchik

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#84 Post by Lobster »

Well now . . .

Talking cows, need raspberries (a well known fact) :)

Using genuine raspberry pi, some scripting help,
- real alpha 2 software from Barry K and Lobsterian almost programming
I have been working on this script

Code: Select all

#! /bin/bash

xcowsay --image /root/a_rap/lobster.png --time=1 Hello Raspberrians, Lobster here with Puppi
xcowsay --image /root/a_rap/puppi.png --time=1 Hello Lobster. Hello world. Hello Puppys.
xcowsay --image /root/a_rap/lobster.png --time=1 Puppy are you really running on Raspberries?
xcowsay --image /root/a_rap/puppi.png --time=1 I am being tested on Raspberry Pi
xcowsay --image /root/a_rap/lobster.png --time=1 Puppi, you changed your name slightly?
xcowsay --image /root/a_rap/puppi.png --time=1 Just a slice of Pi . . .
xcowsay --image /root/a_rap/lobster.png --time=1 Ha Ha . . . What is the Raspberry Pi?
xcowsay --image /root/a_rap/puppi.png --time=1 The smallest, dinkiest, cheapest motherboard . . .
xcowsay --image /root/a_rap/lobster.png --time=1 What can you do on it Puppi?
xcowsay --image /root/a_rap/puppi.png --time=1 I will demonstrate . . .

abiword text.abw &
sleep 3
killall abiword

inkscapelite draw1 &
sleep 3
killall inkscapelite

gnumeric Book1.gnumeric &
sleep 3
killall gnumeric

xcowsay --image /root/a_rap/puppi.png --time=1 Browse, calculate, FTP etc 
/usr/local/bin/defaultbrowser http://puppylinux.org/wikka/PuppiPlan &
sleep 3
killall defaultbrowser

xcowsay --image /root/a_rap/lobster.png --time=1 Very cool. Where can I get all that?
xcowsay --image /root/a_rap/puppi.png --time=1 Google 'raspberry puppi'
xcowsay --image /root/a_rap/lobster.png --time=1 Pawsome. Woof. Woof.
I produced this video (still some bugs in my attempts at code)
http://youtu.be/c7MvS_3BHYY

and I have included all the files I have used including a recording script from Mick

You will need to install xcowsay on Puppy Sap alpha 2, which you can do with the package manager and download from Debian main

Some of the programs are not displaying properly . . .
will have to do some more coding or ask for further suggestions :)


Puppy is Pawsome
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
antiloquax
Posts: 405
Joined: Fri 27 Jan 2012, 09:17

#85 Post by antiloquax »

Hi Lobster,
I hadn't noticed this before. I must have a go!
mark
My System:Arch-Arm on RPi!
"[url=http://murga-linux.com/puppy/viewtopic.php?t=76049l]RacyPy[/url]" puplet on Toshiba Tecra 8200. PIII, 256 MB RAM.
[url=http://raspberrypy.tumblr.com/]RaspberryPy[/url]: Lobster and I blog about the RPi.

Post Reply