You are not logged in.

#1 2006-09-11 16:37:28

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Fun begin.

fortune is famous program for having a random adage. I thought I could be fun having an adage to every boot just over the login prompt.

So I added just before the end of file comment of /etc/rc.sysinit this lines:

# Create an inspiring /etc/issue file.
echo -e 'x1bx63n' > /etc/issue
echo 'Arch Linux 0.7.2 (Gimmick)    (n) (l)' >> /etc/issue
echo -e 'n' >> /etc/issue
fortune -ac -n 1000 >> /etc/issue
echo -e 'n' >> /etc/issue

It is simple, the only strange looking line is the first that adds to /etc/issue a escape sequence to clear the screen.

Maybe someone can find it enjoyable as me...

Offline

#2 2006-09-11 16:48:57

jaboua
Member
Registered: 2005-11-05
Posts: 634

Re: Fun begin.

I have fortune in my .bashrc, prints a fortune in every started terminal smile

Offline

#3 2006-09-11 16:49:21

chrismortimore
Member
From: Edinburgh, UK
Registered: 2006-07-15
Posts: 655

Re: Fun begin.

Wouldn't it be better to have something like this:

# Create an inspiring /etc/issue file.
echo -e 'x1bx63n' > /etc/issue
echo 'Arch Linux 0.7.2 (Gimmick)    (n) (l)' >> /etc/issue
echo -e 'n' >> /etc/issue
echo "fortune -ac -n 1000" >> /etc/issue
echo -e 'n' >> /etc/issue 

That way, each time you log out and such like, you get a different fortune message.


Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 2x160GB Maxtor DiamondMax 10, 2x320GB WD Caviar RE, Nvidia 6600GT 256MB
Laptop: Intel Pentium M, 512MB PC2700, 60GB IBM TravelStar, Nvidia 5200Go 64MB

Offline

#4 2006-09-11 17:11:33

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: Fun begin.

I think /etc/issue isn't executed it is just read as plain text. in fact it does not have the execute attribute. this is why I recreate it every time. If it were executable it would be enough making it once.

Offline

#5 2006-09-11 17:18:38

chrismortimore
Member
From: Edinburgh, UK
Registered: 2006-07-15
Posts: 655

Re: Fun begin.

ezzetabi wrote:

I think /etc/issue isn't executed it is just read as plain text. in fact it does not have the execute attribute. this is why I recreate it every time. If it were executable it would be enough making it once.

Fair enough.  Another possibility is to make a cron job that remakes /etc/issue every hour, brings all manner of surprises into life smile


Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 2x160GB Maxtor DiamondMax 10, 2x320GB WD Caviar RE, Nvidia 6600GT 256MB
Laptop: Intel Pentium M, 512MB PC2700, 60GB IBM TravelStar, Nvidia 5200Go 64MB

Offline

#6 2006-09-13 19:57:12

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: Fun begin.

Nice idea! I did as you said now. It is much better since you do not need to actually reboot.
Also, take this text

fortune-mod-bofh-excuses
fortune-mod-bond
fortune-mod-buffy
fortune-mod-calvin
fortune-mod-chalkboard
fortune-mod-codehappy
fortune-mod-discworld
fortune-mod-dune-quotes
fortune-mod-familyguy
fortune-mod-fgump
fortune-mod-friends
fortune-mod-futurama
fortune-mod-hayward
fortune-mod-hitchhiker
fortune-mod-homer
fortune-mod-humorix
fortune-mod-jargon
fortune-mod-joel-on-software
fortune-mod-kernelcookies
fortune-mod-kernelnewbies
fortune-mod-matrix
fortune-mod-oneliners
fortune-mod-osfortune
fortune-mod-osho
fortune-mod-prog-style
fortune-mod-romeojuliet
fortune-mod-scc
fortune-mod-shlomif
fortune-mod-shlomif-fav 
fortune-mod-smac
fortune-mod-spblu
fortune-mod-starwars
fortune-mod-subversion
fortune-mod-tao
fortune-mod-taow
fortune-mod-xfiles
fortune-mod-zx-error

save it as ~/fortune.txt and excute as root
pacman -S `cat ~/fortune.txt | tr 'n' ' '`

it adds even more randomness.

Offline

Board footer

Powered by FluxBB