You are not logged in.
Pages: 1
Where can I find login scripts? Like commands executed when login (ie like getting fortune to display on login)
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
Where can I find login scripts? Like commands executed when login (ie like getting fortune to display on login)
/home/yourUser/.bashrc
is run every time you login a console or xterm
simply add as last line "fortune" and it will give you a fortune every login :-)
or if you want something more nice:
install "cowsay" pkg (pacman -Sy cowsay) and then add this line ... looks really nice :-)
fortune -s | cowsay -f tux
The impossible missions are the only ones which succeed.
Offline
also: how can I change the prompt?
[name@arch /]$ the colors and stuff?
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
the output would look like this:
______________________________________
/ Murphy's Law of Research:
| |
| Enough research will tend to support |
your theory. /
--------------------------------------
.--.
|o_o |
|:_/ |
//
(| | )
/'_ _/`
___)=(___/
The impossible missions are the only ones which succeed.
Offline
also: how can I change the prompt?
[name@arch /]$ the colors and stuff?
also in this file:
PS1='[u@h W]$ '
is the prompt
The impossible missions are the only ones which succeed.
Offline
http://bbs.archlinux.org/viewtopic.php? … hlight=ps1
for examples
The impossible missions are the only ones which succeed.
Offline
the color codes are the same as for /etc/issue or any console-color thing ... have a look at
http://daperi.home.solnet.ch/linux/arch/index.html
in the middle of the page the 2 tables for all codes available for coloring
the syntacs is easy:
no color ... 33[01;31m this text should be in color 31 and style 01 33[0m and now again reset to no color, style 0
note that 33 means the same as the "escape"-character in issue i mentioned on my site
The impossible missions are the only ones which succeed.
Offline
Wow! Thanks a lot! I love how you guys always help, and fast replies too!
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
you're welcome ...
by the way: how did you set your prompt? may i ask for your new PS1 ? :-)
here another nice example i use on my machine:
PS1='33[34;01mu33[34;0m@33[31;0mh:l33[34;01m[W]33[32;01m#:33[00;01m'
u = user
h = hostname
l = consolenumber
W = path (last)
# = command-number in this console (very usefull, if you want to quote the output and speak about it)
(EDITED: changed the code-format to 33[${color};${style}m)
The impossible missions are the only ones which succeed.
Offline
user:
PS1='{33[00;34mu33[0m@h W}$ '
root:
PS1='[33[0;31mu33[0m@h W]$ '
I'll add more later!
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
... with style "5" you can make the prompt blinking :-) ... can be fun for root having something like
PS1='[33[5;31mu33[0m@h W]$ '
(but this is really playing around ... nothing to do with "ergonomics at work" )
The impossible missions are the only ones which succeed.
Offline
... with style "5" you can make the prompt blinking :-) ... can be fun for root having something like
PS1='[33[5;31mu33[0m@h W]$ '
(but this is really playing around ... nothing to do with "ergonomics at work" )
Hmm.. the 5 only gives it a gray bg... Any ideas?
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
dp wrote:... with style "5" you can make the prompt blinking :-) ... can be fun for root having something like
PS1='[33[5;31mu33[0m@h W]$ '
(but this is really playing around ... nothing to do with "ergonomics at work" )
Hmm.. the 5 only gives it a gray bg... Any ideas?
hmm ... maybe 33[31;05m ? (sorry, just edited your line directly) ... it's always a good idea to specify first the color and then the style and to give the leading 0 for the style code
.. the other thing with blinking is that it works only on some consoles (in the VC but not with all framebuffers and also not with xterm but works fine in konsole)
The impossible missions are the only ones which succeed.
Offline
if you are talking about the console colors themselves and not just the prompt take a look at setterm
type setterm at the prompt for list of options
there is a man page also on it
slyski
Joey: If a cow passes away from natural causes can I eat it.
Pheobe: Not if I get there first.
Offline
is there a way to randomize which cow is talking?
Offline
Ok... So I was bored...
Add this to your .bashrc to get the random cow file and fortune output.
function randcowfile() {
# where do the cow files live?
#
COWFILES='/usr/share/cows'
file_list=(`ls -l $COWFILES | awk '{ print $9 }'`)
num_files=`expr ${#file_list[@]} + 1`
randex=`expr $RANDOM / ( 32768 / $num_files )`
cowfile=`basename ${file_list[$randex]} .cow`
echo $cowfile
}
fortune -s | cowsay -f `randcowfile`
Follow the link below, sign up, and accept one promotional offer. If I can get five suckers (err... friends) to do this, I'll get a free iPod. Then you too can try to get a free iPod. Thanks! http://www.freeiPods.com/?r=11363142
Offline
thanks! works like a charm.
Offline
Pages: 1