Page 1 of 1
Lobster Shell
Posted: Tue 24 May 2005, 03:20
by Lobster
Using the rute guide
http://wireless.ictp.trieste.it/school_ ... /rute.html
was able to create the enclosed shell by hacking an existing wizard.
I store it in /usr/sbin with the name welcome.sh
drag it onto the desktop
seems to work OK on 1.0.2
Does it work on 1.0.1 of Puppy?
Gosh it was pretty easy to do - considering my first script was ech0 "hello world"
Hope it works OK
from the shell (rxvt)
chmod +x welcome.sh
Then you can start your script by typing: ./welcome.sh
Code: Select all
#!/bin/sh
# Lobster May 2005 version 0.0.4
export WelcomePuppy="
<vbox>
<hbox>
<text>
<label>OFF LINE SERVICES</label>
</text>
</hbox>
<hbox>
<text>
<label>Wizards...</label>
</text>
<button>
<input file>/usr/local/lib/X11/mini-icons/wizard16.xpm</input>
<action>/usr/sbin/wizardwizard &</action>
</button>
</hbox>
<hbox>
<text>
<label>Net Connect...</label>
</text>
<button>
<input file>/usr/local/lib/X11/mini-icons/mini.netscape.xpm</input>
<action>dillo /usr/share/doc/HOWTO_Internet.htm &</action>
</button>
</hbox>
<hbox>
<text>
<label>Sound test...</label>
</text>
<button>
<input file>/usr/local/lib/X11/mini-icons/mini.audiovol.xpm</input>
<action>play /usr/share/audio/ivy.mp3 &</action>
</button>
</hbox>
<hbox>
<text>
<label>ON LINE SERVICES</label>
</text>
</hbox>
<hbox>
<text>
<label>More Programs...</label>
</text>
<button>
<input file>/usr/local/lib/X11/mini-icons/mini-diskette.xpm</input>
<action>dillo http://www.goosee.com/puppy/wikka/DotPups &</action>
<action> /usr/sbin/pupget &</action>
</button>
</hbox>
<hbox>
<text>
<label>Tell a Friend...</label>
</text>
<button>
<input file>/usr/local/lib/X11/mini-icons/mini-happy.xpm</input>
<action>mozilla http://www.goosee.com/puppy/wikka/FriendEmail &</action>
</button>
</hbox>
<hbox>
<text>
<label>Puppy Forum...</label>
</text>
<button>
<input file>/usr/local/lib/X11/mini-icons/mini-dog.xpm</input>
<action>mozilla http://www.murga.org/~puppy/ &</action>
</button>
</hbox>
<hbox>
<text>
<label>Puppy IRC Chat...</label>
</text>
<button>
<input file>/usr/local/lib/X11/mini-icons/chat16.xpm</input>
<action>mozilla http://www.goosee.com/puppy/wikka/PuppyLinuxIRC &</action>
</button>
</hbox>
<hbox>
<text>
<label>Latest News...</label>
</text>
<button>
<input file>/usr/local/lib/X11/mini-icons/mini-news.xpm</input>
<action>mozilla http://www.goosee.com/puppy/wikka/LatestNews &</action>
</button>
</hbox>
<hbox>
<button cancel></button>
</hbox>
</vbox>
"
gtkdialog --program WelcomePuppy
unset WelcomePuppy
Posted: Tue 24 May 2005, 03:42
by Pizzasgood
I didn't test all the buttons, but the ones I clicked (tell a friend, sound test, more programs) all worked in 1.0.1.
Posted: Tue 24 May 2005, 06:30
by Lobster
Thanks Pizzasgood,
Glad to hear it.
It is an easy and useful one to hack as it allows us to set up a customised menu for a relative, a relative beginner or a beginner relative - I even use it myself.
If you are not sure how to run it please ask. All you need is a text file called
welcome.sh saved in usr/sbin
I always knew shells were good.
One of the things that threw me was trying to implement a function. Well the rute guide is for Bash and I know that Barry is thinking seriously (hopefully for 1.0.3) of using Bash.
Posted: Tue 24 May 2005, 07:14
by GuestToo
you can use bash right now
just download the bash unleashed package from ibiblio and unzip it
put bash somewhere convenient ... for example, /root/bash
if you change the first line in your script to
#!/root/bash
it will run the script using bash instead of sh
if you put this line in /etc/profile:
export SHELL=/root/bash
then bash will be used automatically when you open an rxvt window
most scripts will still run /bin/sh
if you copy /root/bash to /bin/sh, then sh will be bash
or you can copy bash to /bin and symlink /bin/sh to /bin/bash ... that's what i do, i do it in rc.local ... i run a script something like this:
#!/root/bash
cp -f /root/bash /bin
ln -sf /bin/bash /bin/sh
again, some bash scripts still won't work right, because the gnu-utils are still busybox replacements
Having a bash
Posted: Tue 24 May 2005, 07:35
by Lobster
Thanks G2,
I did download Bash but did not know how to make it work - now I have a chance to use the most widely used Shell in Puppy. Hooray.
I did read somewhere (probably the back of a Tux Box - like an X box but with 24 Cell processors and a secret fish stash) that the real power of Linux is in the Shell (we cructaceans have a similar knowing)
I am gonna do it by hand (no innuendo from Ian and the lewd lurkers) - I am keen - but perhaps a Dotpup?
I feel like I have been Born again and the big Puppy in the sky has . . .
[rambles off into the distance . . .]
Posted: Tue 24 May 2005, 19:30
by GuestToo
i thought about a dotpup to automatically setup bash to replacee /bin/sh when Puppy boots, but if things don't work right, Puppy may not boot at all ... the only way to fix it is to mount pup001 in another distro and edit rc.local and comment or remove the line that replaces /bin/sh with bash
i figured it would be easier for someone to fix the problem if they set it up themselves in the first place
on the other hand, if you can copy bash to /bin (using rox or the command line) and it copies ok, then there really should be no problem ... all you need to do to make /bin/bash your shell is symlink /bin/sh to /bin/bash
since /bin is in ram, you have to do this every time you boot ... i have a couple of lines in rc.local
if you have an option 2 install, all you have to do is copy bash to /bin and symlink bash to sh, and bash will be your shell and will still be your shell after a reboot
Posted: Wed 25 May 2005, 00:36
by BarryK
Lobster, it is probably a good idea if we take another look at what the developer of gtkdialog is doing... we did try his latest sometime ago, and it was slightly broken.
...a problem with environment variables I think.
Posted: Wed 25 May 2005, 20:23
by Rich
Good Work Lobster.
For new users, something like this would be fantastic to get started with Puppy, without the need to instantly learn to navigate the pup001 file, as well as figure out what all the packages do !
Rich
about BASH
Posted: Thu 26 May 2005, 17:08
by gelias
GuestToo wrote:you can use bash right now
just download the bash unleashed package from ibiblio and unzip it
put bash somewhere convenient ... for example, /root/bash
if you change the first line in your script to
#!/root/bash
it will run the script using bash instead of sh
if you put this line in /etc/profile:
export SHELL=/root/bash
then bash will be used automatically when you open an rxvt window
most scripts will still run /bin/sh
if you copy /root/bash to /bin/sh, then sh will be bash
or you can copy bash to /bin and symlink /bin/sh to /bin/bash ... that's what i do, i do it in rc.local ... i run a script something like this:
#!/root/bash
cp -f /root/bash /bin
ln -sf /bin/bash /bin/sh
again, some bash scripts still won't work right, because the gnu-utils are still busybox replacements
Hello GuestToo
I downloaded and copied bash in my-applications/bin
It works well, but the history file doesn't exist.
I copied a .bash_history in /root to keep track of the commands, and aliases I usually use but bash does not read it.
Where should I put this file?
thanks in advance
Posted: Thu 26 May 2005, 20:18
by GuestToo
bash sets up a history file automatically in $HOME (/root for Puppy)
if you run bash as sh, bash behaves differently ... it pretends to be sh ... sh does not use .bashrc for example
i put SHELL=/bin/bash in /etc/profile ... so when i open an rxvt window, it automatically runs /bin/bash ... which means it's running as bash, so it will use .bashrc, and a history file too
i made a /root/.bashrc file:
#. /etc/profile
export HISTFILESIZE=2000
export HISTCONTROL=ignoredups
this keeps 2000 lines in your history files, and doesn't add duplicates lines
i have bash setup a little differently to the way i had it before, and i noticed if i killed X and restarted it, my LD_LIBRAY path wasn't set right, so i put . /etc/profile in .bashrc, which fixed it ... but it shouldn't do that, it should be runing bash as sh, and should automatically use /etc/profile ... so i'm not sure about that ... which is why i didn't make an upload a bash package yet ... you have to get all this stuff working perfectly before you upload your package
actually, . /etc/profile probably belongs in .bash_profile
you can put other stuff in .bashrc too ... aliases, prompts, ascii art
anyway, bash history does work, if bash is started as bash and not as sh ... try opening an rxvt window, and typing bash ... see if the prompt changes ... it does keep it's files in /root ... anything you put in /root/.bashrc should execute ... try putting an line like echo 'bashrc executing' in .bashrc
bash-3.00
Posted: Thu 26 May 2005, 23:30
by gelias
Ok GuestToo.
It works....when rxvt starts, I can read:
bashrc executing
bash-3.00#
thanks
Posted: Thu 02 Jun 2005, 20:09
by Guest
BarryK wrote:Lobster, it is probably a good idea if we take another look at what the developer of gtkdialog is doing... we did try his latest sometime ago, and it was slightly broken.
...a problem with environment variables I think.
I did download the latest and Ian tried compiling it. No success so far. I am trying to compile things in gcc in vector - so far it seems pretty straightforward so may have another look at this.