execute program only once during login
I want to execute a program only once when login.
If I put the program execution in .bashrc, then it will get executed for every shell, i.e. more than once. I put my desired program inside ~/.bash_profile but the program does not work as expected. The ~/.bash_profile file are as follows: # /etc/skel/.bash_profile: # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/skel/.bash_profile,v 1.10 2002/11/18 19:39:22 azarah Exp $ #This file is sourced by bash when you log in interactively. [ -f ~/.bashrc ] && . ~/.bashrc /usr/bin/amixer sset 'VIA DXS',0, 31 My desired program is to set the volume to 100%: /usr/bin/amixer sset 'VIA DXS',0, 31 However, the volume is still very low after login so I still need to execute the program at the shell after login. My linux is Linux version 2.6.8-gentoo-r4. |
You only want it executed during your first login of each boot?
|
Looked at rc.local yet?
Cheers, Tink |
Accidental duplicate, sorry.
|
put it in a boot script, not in a shell config file.
|
Gentoo Linux does not provide such a file rc.local. Instead it has an equivalent script called /etc/conf.d/local.start where you can put all your initialization stuff.
However I still need to do /usr/bin/amixer sset 'VIA DXS',0, 31 after I login in. cat /etc/conf.d/local.start # /etc/conf.d/local.start: # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/local.start,v 1.4 2002/11/18 19:39:22 azarah Exp $ # This is a good place to load any misc. # programs on startup ( 1>&2 ) # this file is similar to /usr/bin/amixer sset 'VIA DXS',0, 31 #end of file Quote:
|
Which file for gentoo linux?
I tried /etc/conf.d/local.start but does not work. Please see my previous post. Quote:
|
All times are GMT -5. The time now is 12:14 AM. |