Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
execute WHATEVER after login? [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Arkham
Tux's lil' helper
Tux's lil' helper


Joined: 30 Aug 2004
Posts: 111
Location: Quilpue, Chile

PostPosted: Thu Jul 06, 2006 3:49 pm    Post subject: execute WHATEVER after login? [SOLVED] Reply with quote

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 :D

Thanks!

?


Last edited by Arkham on Thu Jul 06, 2006 5:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
heikole
Tux's lil' helper
Tux's lil' helper


Joined: 04 Oct 2004
Posts: 148
Location: Berlin, Germany

PostPosted: Thu Jul 06, 2006 4:02 pm    Post subject: Reply with quote

~/.profile or ~/.bash_profile (with bash as your shell) come to mind for doing this.
_________________
42
Back to top
View user's profile Send private message
Arkham
Tux's lil' helper
Tux's lil' helper


Joined: 30 Aug 2004
Posts: 111
Location: Quilpue, Chile

PostPosted: Thu Jul 06, 2006 4:38 pm    Post subject: Reply with quote

Danke schön.. aber... Ich nicht.... I mean..
what should I do with them? :D

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
View user's profile Send private message
heikole
Tux's lil' helper
Tux's lil' helper


Joined: 04 Oct 2004
Posts: 148
Location: Berlin, Germany

PostPosted: Thu Jul 06, 2006 4:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
Arkham
Tux's lil' helper
Tux's lil' helper


Joined: 30 Aug 2004
Posts: 111
Location: Quilpue, Chile

PostPosted: Thu Jul 06, 2006 5:47 pm    Post subject: Reply with quote

Excelent!! that's exactly what I was looking for... :D
thank you so much...

Just a few question related to this :D

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
View user's profile Send private message
at240
l33t
l33t


Joined: 12 Aug 2005
Posts: 603
Location: UK

PostPosted: Thu Jul 06, 2006 5:53 pm    Post subject: Reply with quote

Arkham wrote:

Just a few question related to this :D

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
View user's profile Send private message
heikole
Tux's lil' helper
Tux's lil' helper


Joined: 04 Oct 2004
Posts: 148
Location: Berlin, Germany

PostPosted: Thu Jul 06, 2006 6:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Arkham
Tux's lil' helper
Tux's lil' helper


Joined: 30 Aug 2004
Posts: 111
Location: Quilpue, Chile

PostPosted: Thu Jul 06, 2006 6:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum