Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

Run program at user login

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
7 posts • Page 1 of 1
Author
Message
Aitikin
Apprentice
Apprentice
Posts: 227
Joined: Sat May 14, 2005 7:07 pm

Run program at user login

  • Quote

Post by Aitikin » Mon Jun 19, 2006 7:31 am

I'm looking for a way to run a program at every user's login. Actually it's a simple combination of two programs, cowsay and fortune. It's not an extremely high priority for me, but it'd be nice to get it working. I'd also like to know if there's a way to get the output into a signature file like is mentioned here but I can't get that to work.

Actually all I can get to work from that guide is cowsay `fortune`. Any help would be appreciated.
Top
Aries-Belgium
l33t
l33t
User avatar
Posts: 730
Joined: Fri Jul 08, 2005 12:38 pm
Location: Willebroek, Belgium

  • Quote

Post by Aries-Belgium » Mon Jun 19, 2006 7:39 am

Put the commands in ~/.profile

Code: Select all

fortune > ~/sig.txt
Good luck
Ep2.nl | Developers Community
Top
Aitikin
Apprentice
Apprentice
Posts: 227
Joined: Sat May 14, 2005 7:07 pm

  • Quote

Post by Aitikin » Mon Jun 19, 2006 7:51 am

Ok, I did that, didn't get me anything though. What information would be key for you to help me? Like my rank'll tell ya, I'm still a n00b.
Top
spufi
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 119
Joined: Thu Apr 25, 2002 10:07 am
Location: Mechelen - Belgium

  • Quote

Post by spufi » Mon Jun 19, 2006 8:37 am

Aitikin wrote:Ok, I did that, didn't get me anything though. What information would be key for you to help me? Like my rank'll tell ya, I'm still a n00b.
Which part didn't work? Generating the ~/sig.txt file upon login, or that you don't see the signature when using a new mail? Usually I tend to set things like this in the ~/.bash_profile file (maybe a quick and dirty way ...), but it works.

Code: Select all

fortune | cowsay  > ~/sig.txt
What this line will do: execute fortune and pipe it (taking the output of a program and pass it on to another program after the |-sign without displaying it), ie. cowsay and moving the output of this program to the file 'sig.txt' which resides in your home-directory (~).

So:

Code: Select all

bknid@pc50016:~$ fortune | cowsay  > ~/sig.txt  
bknid@pc50016:~$ cat sig.txt
 ______________________________________
/ Q: What do agnostic, insomniac       \
| dyslexics do at night? A: Stay awake |
\ and wonder if there's a dog.         /
 --------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
bknid@pc50016:~$
Keep in mind btw that you're gonna use (simple) 'ASCII-art' (cowsay) in your signature, which implies that - for it to be displayed entirely correct - you need to format your mails in plain text OR make sure courier-type fonts are being used. And that the recipients won't override font-formatting when receiving/displaying mails.

Here's how your signature will look like if you don't use plain text (which you should anyway: html mails are evil ;-) ) or specificly set courier-type fonts:

______________________________________
/ Q: What do agnostic, insomniac \
| dyslexics do at night? A: Stay awake |
\ and wonder if there's a dog. /
--------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||

Garbled and dead-ugly! Apart from cowsay or figlet being nifty programs, I would advise against using these programs to make up a signature, for the reason as shown above. (although this is of course entirely up to you).
Top
Aitikin
Apprentice
Apprentice
Posts: 227
Joined: Sat May 14, 2005 7:07 pm

  • Quote

Post by Aitikin » Mon Jun 19, 2006 5:38 pm

Actually the cowsay was more for the console login, the sig I wanted to be just a random fortune, so I take it that just taking the pipe to cowsay out will fix it?
Top
spufi
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 119
Joined: Thu Apr 25, 2002 10:07 am
Location: Mechelen - Belgium

  • Quote

Post by spufi » Mon Jun 19, 2006 7:13 pm

Aitikin wrote:Actually the cowsay was more for the console login, the sig I wanted to be just a random fortune, so I take it that just taking the pipe to cowsay out will fix it?
Yep, in that case Aries-Belgium's suggestion will suffice.
Top
Aitikin
Apprentice
Apprentice
Posts: 227
Joined: Sat May 14, 2005 7:07 pm

  • Quote

Post by Aitikin » Mon Jun 19, 2006 7:14 pm

Thanks. Works just right now.
Top
Post Reply

7 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic