View previous topic :: View next topic |
Author |
Message |
Arkham Tux's lil' helper
Joined: 30 Aug 2004 Posts: 111 Location: Quilpue, Chile
|
Posted: Thu Jul 06, 2006 3:49 pm Post subject: execute WHATEVER after login? [SOLVED] |
|
|
Hi there...
sorry for the noobish question, but I haven't found anything remotely related to what I'm looking..
I want to login to my gentoo box (graphical or text), and right after that I need to run some scripts (mount some shares, clean some directories, whatever)
is there a file that handles that? something like .xinitrc but for session start, not X start
Thanks!
?
Last edited by Arkham on Thu Jul 06, 2006 5:49 pm; edited 1 time in total |
|
Back to top |
|
|
heikole Tux's lil' helper
Joined: 04 Oct 2004 Posts: 148 Location: Berlin, Germany
|
Posted: Thu Jul 06, 2006 4:02 pm Post subject: |
|
|
~/.profile or ~/.bash_profile (with bash as your shell) come to mind for doing this. _________________ 42 |
|
Back to top |
|
|
Arkham Tux's lil' helper
Joined: 30 Aug 2004 Posts: 111 Location: Quilpue, Chile
|
Posted: Thu Jul 06, 2006 4:38 pm Post subject: |
|
|
Danke schön.. aber... Ich nicht.... I mean..
what should I do with them?
I created .login (and .login_user) in my home directory and put in there the name of the script I run.., but nothing happened when I login
let's say I have an executable script called whatever, and everyday I turn on my computer and after login in, I must open a terminal and write:
Code: |
titus@titus:~$./whatever
|
How can I automatize that process, so it would run everytime I login
... everytime I'm sure I'm on my way to be a Linux-Guru, I realized I'm an eternal noob
? |
|
Back to top |
|
|
heikole Tux's lil' helper
Joined: 04 Oct 2004 Posts: 148 Location: Berlin, Germany
|
Posted: Thu Jul 06, 2006 4:53 pm Post subject: |
|
|
When you put a line for your script named whatever into your ~/.bash_profile, whatever is executed at logon automatically. Is this not the behaviour you want to have?
Das Leben kann so einfach sein _________________ 42 |
|
Back to top |
|
|
Arkham Tux's lil' helper
Joined: 30 Aug 2004 Posts: 111 Location: Quilpue, Chile
|
Posted: Thu Jul 06, 2006 5:47 pm Post subject: |
|
|
Excelent!! that's exactly what I was looking for...
thank you so much...
Just a few question related to this
is there some kind of .bash_logout something that executes when you logoff?
and what hapens if I log in under X/KDE/Gnome, then switch to vty1 (Alt+Ctrl+F1) and login again?
.... and yes... sometimes is THAT simple, but sometimes... well.. you know :p
? |
|
Back to top |
|
|
at240 l33t
Joined: 12 Aug 2005 Posts: 603 Location: UK
|
Posted: Thu Jul 06, 2006 5:53 pm Post subject: |
|
|
Arkham wrote: |
Just a few question related to this
is there some kind of .bash_logout something that executes when you logoff?
|
lol --- the file you want is indeed .bash_logout |
|
Back to top |
|
|
heikole Tux's lil' helper
Joined: 04 Oct 2004 Posts: 148 Location: Berlin, Germany
|
Posted: Thu Jul 06, 2006 6:01 pm Post subject: |
|
|
You should already have a file ~/.bash_logout which clears your screen when you logout. This is some sort of default.
These scripts are executed at *every* login/logout. If you want whatever to be executed at the first logon/last logout only, your script will need to know its state. I hope you'll have fun with this little task _________________ 42 |
|
Back to top |
|
|
Arkham Tux's lil' helper
Joined: 30 Aug 2004 Posts: 111 Location: Quilpue, Chile
|
Posted: Thu Jul 06, 2006 6:04 pm Post subject: |
|
|
you're kidding me!?!?
Code: |
after positive check of the file mentioned.....
|
OMFG, that's by far the noobish thing I've ever done, I was tempted to delete the whole thread just to hide my ignorance and über-noobishnes
.... it has just replaced me discovering that "cd .." moves out of the directory.... I spend a whole year changing directorys like this
/home/titus/work/test01/source --> cd /home/titus/work/test01
Thanks!!
? |
|
Back to top |
|
|
|