automatically running files at startup

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

automatically running files at startup

#1 Post by Lobster »

Due to strange tweaking my mouse was not booting
at startup

in /etc/rc.d
there is a file rc.local

adding
rm /etc/mousedevice

allows me to rerun the mouse config at startup automatically

I would also like to "enters" (to accept defaults) so will look into that next

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

Menu item

#2 Post by Lobster »

:idea: :)
In fact . . .
When I press ctrl + alt + backspace
it tells me I can sort out my mouse by deleting a file
(the command - see previous post - is rm)

So thinking about this, it became clear that an easy to use
(and alterable) command line menu would be useful

It would be useful in several circumstances - failure at booting (possibly because of a corrupt pup001) and if booting up with a new mouse or keyboard but a previous pup001 setting . . .

If simple enough it would also enable the rest of us, to add options to a menu
according to preferences

I enclose my initial (incomplete) efforts on this in the hope that it might inspire or develop ideas for those with greater skills (still working on the Rute guide)

We already have wiki pages on tcl
and all the bash commands
but it is important to have a useful area to develop these skills
Maybe someone is into creating a simple menu tutorial for the wiki?

the below is saved as a text file (for example)
menu.sh
after changing permissions to make it runnable
it can be called from a rxvt / terminal / shell / cli window (ahem? what is it called)
with the command ./menu.sh (assuming you are in the same directory)

Code: Select all

#!/bin/sh
# Lobster June 2005
 
echo MENU OPTIONS
echo 1 Return    to Graphic Puppy - xstart or xwin 
echo 2 fvwm 
echo 3 JWM
echo 4 IceWm 
echo 5 Fluxbox
echo 6 New mouse
echo 7
echo 8 halt machine
echo 9
read Y

if [ "$Y" = "1" ] ; then 
echo "you chose 1"
#xstart
fi
if [ "$Y" = "2" ] ; then
 echo "you chose 2"
# xstart fvwm
fi
if [ "$Y" = "3" ] ; then
 echo "you chose 3"
fi
if [ "$Y" = "4" ] ; then
 echo "you chose 4"
fi
if [ "$Y" = "5" ] ; then
 echo "you chose 5"
fi
if [ "$Y" = "6" ] ; then
 echo "you chose 6"
fi
if [ "$Y" = "7" ] ; then
 echo "you chose 7"
fi
if [ "$Y" = "8" ] ; then
 echo "you chose 8"
fi
if [ "$Y" = "9" ] ; then
 echo "you chose 9"
fi

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

Re: Menu item

#3 Post by Flash »

Lobster wrote::idea: :)
In fact . . .
When I press ctrl + alt + backspace
it tells me I can sort out my mouse by deleting a file
(the command - see previous post - is rm)

So thinking about this, it became clear that an easy to use
(and alterable) command line menu would be useful

It would be useful in several circumstances - failure at booting (possibly because of a corrupt pup001) and if booting up with a new mouse or keyboard but a previous pup001 setting . . .

If simple enough it would also enable the rest of us, to add options to a menu
according to preferences

I enclose my initial (incomplete) efforts on this in the hope that it might inspire or develop ideas for those with greater skills (still working on the Rute guide)

We already have wiki pages on tcl
and all the bash commands
but it is important to have a useful area to develop these skills
Maybe someone is into creating a simple menu tutorial for the wiki?

the below is saved as a text file (for example)
menu.sh
after changing permissions to make it runnable
it can be called from a rxvt / terminal / shell / cli window (ahem? what is it called)
with the command ./menu.sh (assuming you are in the same directory)

Code: Select all

#!/bin/sh
# Lobster June 2005
 
echo MENU OPTIONS
echo 1 Return    to Graphic Puppy - xstart or xwin 
echo 2 fvwm 
echo 3 JWM
echo 4 IceWm 
echo 5 Fluxbox
echo 6 New mouse
echo 7
echo 8 halt machine
echo 9
read Y
...
<>
...
fi
Lobster, one of my gripes about Linux is the cryptic acronyms. :? It seems to me that they are no longer necessary. Memory is much cheaper than it used to be, and the time I waste finding out what they mean is more valuable anyway - at least to me. :)
For newcomers to Linux, just learning the command line is tough enough; perhaps acronyms like "JWM" could be expanded into "Joes Window Manager," and "Fluxbox" could have a few words explaining what it is for. :?:

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

too true

#4 Post by Lobster »

There is a lot to learn Flash - so I do agree - the menu is just a rough shell - does not even do anything yet . . . things should be descriptive. I have never come across a general DOS to Bash linking script so if you type in delete [name of file] this works for those familiar with DOS but I am sure there is one somewhere . . .

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#5 Post by GuestToo »

you can put alias del='rm' or alias del='rm -i' in /etc/profile

similar aliases:

alias clr='clear'
alias cls='clear'
alias copy='cp -i'
alias del='rm -i'
alias delete='rm -i'
alias dir='ls -alg'
alias home='cd ~'
alias ls='ls -F'
alias md='mkdir'
alias move='mv -i'

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

setup / config / preferences / control panel[

#6 Post by Lobster »

Nice.

Another that comes to mind is

alias exit='xstart'

I wonder if we have an ex-DOSer
able to create a complete listng?

Is there a way of including this in
the standard shell?

One of the things that first attracted me to Puppy was the wizards
that explained in some detail what is being done.

For the future I see no reason why
a setup / config / preferences / control panel
type wizard might not be instigated to allow
things such as DOS command compatibility for those
who require / prefer this.

In the widgets that can be called from the shell
Xdialog (which I have been looking at recently
- try help in the start menu to find out more about it
- the colour scheme is a little garish though)
has some interesting features, for example one component
is the basis for pupget . . .

Perhaps one of those widgets would allow a
three column "config editor"?

You would have the location of the file
what the file does
and an edit box

Is this a good idea or have I been at the wrong
seaweed again?
Last edited by Lobster on Sun 05 Jun 2005, 04:57, edited 1 time in total.

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#7 Post by GuestToo »

the reason i tell people to type startx is because startx is a standard command that many Linux distros use to start X windows ... i don't think xwin is

exit already will close an rxvt window and is used in scripts to end the program

some people alias type='cat' or type='more'
type is already a linux command

some people alias help='man'
help is a built in bash word

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#8 Post by rarsa »

Although it may seem like a good idea to have aliases, I think that in the long run is detrimental for new users.

Imagine this very common scenario:

A new user sets up puppy at home, after a few months he 'thinks' that he knows the commands and offers to help a friend that want's to try linux with a different distribution. Guess what? None of the commands he knows are there because are puppy specific aliases. He/she googles to find out why the commands aren't there and finds nothing.

OK, you get the idea.

Second: A user that has used the DOS command line has been around long enough to be considered a computer newbie. He/she will understand that some commands are different.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#9 Post by Flash »

My complaint wasn't so much learning new commands, but the cryptic names used in Linux which in many cases give no clue to what the command, or program, does. Some sort of sticky "cheat sheet" for newcomers to Linux perhaps?

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#10 Post by rarsa »

Cryptic you say? My guess is that Unix tools were created as a contest to see who could guess the command function by it's name. The fastest people guessed, the lower the points.

Actually I don't know why I left that part out of my post I meant to add the following:

An idea would be to create some scripts or aliases that would instruct the user about the correct command. e.g.

Code: Select all

# del
del is not a linux command, were you intended to delete a file? try 
rm
if you want to see the list of options type
rm --help
#
And something similar for copy and format and the rest.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

Scripts

#11 Post by sunburnt »

I wrote a little script for DOS called "Q" that made typing commands
easer, rewrote it for Linux but never completed it, started using Xwin.

sintax:

q z "source" "target" = zip files
q u "source" "target" = unzip files & directories
q zd "source" "target" = zip directory & contense

You get the idea, much could be done with this script.

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

Aunty Maud

#12 Post by Lobster »

Some great points Guys and Puppys, :)

I once knew a "Vax man" (like Superman but not susceptible to kryptonite) who only used DOS . . . why? He could not, would not use a mouse . . . (eventually he did)

So when someone tells you it is easy to jump buildings with a single bound or write a little batch script to backup the known universe, just remember they may have special powers or years of training and experience.

Let me put it like this . . . do you want to use an Operating System or tinker with it? (be honest now - must of us are little tinkerers)

However I have heard of a computer user (codenamed "Aunty Maud") who uses a special mantra that overcomes every GNU Gurus special powers:

Here it is: "Why doesn't it just work?"

Good question
back to Puppy . . .
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#13 Post by BarryK »

Lobster,
what about tkWorld?
...isn't that supposed to make life easier for those who don't like or are unfamiliar with the Linux commandline?

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

#14 Post by Lobster »

Do you mean this to choose keyboard, region and timezone?

http://wiki.tcl.tk/2957


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

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

#15 Post by Lobster »

BarryK wrote:Lobster,
what about tkWorld?
...isn't that supposed to make life easier for those who don't like or are unfamiliar with the Linux commandline?
mmm. . .
think you are referring to a specific program that covers the basic command line commands - that I dreamt exists or did see but seems to have gone missing . .

Can anyone find it?

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

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#16 Post by Nathan F »

I do think that the cryptic nature of many of the commands is a major stumbling block to getting most people interested in Linux. However, Bash has become the standard for most of the Unix world. The only real way to get around this in the long run would be for someone to create a new or modified shell with commands that do what they say, and then get the rest of us to adopt using it. DON"T HOLD YOUR BREATH ON THAT ONE. Of course, even if we had a shell that would delete a file by typing "delete" this would not really be an improvement for someone who's native language is not English. I also really cringe at the thought of trying to make bash behave at all like DOS. The Linux command line is vastly superior in it's capabilities even if it doesn't seem very user friendly at first.

It is quite possible to run many Linux distributions without even using the command line, including Puppy for the most part. This trend will continue. It has to in order to get the majority of people to even consider using a different operating system.

Post Reply