Registered Member
|
I run a script in bashrc, and arrange it to be run once a day on the first time I open a terminal window.
This works well in gnome, but after I switch to KDE, the script seems to be run at the time I login! The script uses network and will download quite some data, running it on login will make the login process very slow... Could anyone tell me how to prevent bashrc to be parsed on login, or, is there any other RC file I can run my script? Thanks! |
Administrator
|
I would recommend splitting the script out to a secondary file, then setting the following as your shell for a profile in Konsole:
/bin/sh -e
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
My script is already in another file. Unfortunately your suggestion does not work. After I change konsole profile, it simply does not open properly. I have to change that back in .kde/.../...
I tried to follow your hint and read bash's man page, I tried to use the --rcfile switch, that successfully called my script, but makes it fail, because in my script, I use: cp=$(dirname -- "$0")/ids.jar to set the classpath of a java application, after using --rcfile switch, the $(dirname -- "$0") does not work anymore, it does not point to the path of my script, but point to /bin, because $0 is now bash itself! I am still thinking for a solution, if you know any alternatives, please let me know. Thank you very much! |
Administrator
|
Oops. Try setting the Konsole shell as the script itself.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
I am sorry but that did not work either. However maybe I did something wrong. I tried to set the "Command" of the Konsole profile to:
or
both of the above did not work. If I try open a konsole in an already opened one, it report the following error on command line:
I found this in the forum: kdm-does-not-execu ... 34156.html which was reported as a problem, but in fact I would like to instruct kdm NOT to execute .bashrc, or, alternatively, how can I know within .bashrc that its caller is KDM or not so that I can do things accordingly. Thanks! |
Registered Member
|
The problem is now solved. I found a simple method by google, to detect if bashrc is called by kdm or not, if not, then run my script:
|
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, mickae, Sogou [Bot]