To the best of my recollection, Slack doesn't use runlevel 5 for "automatically start an X-based DM (D
anager, or more commonly "login manager"). When I was using Slack, runlevel 3 was the default, and I think runlevel 4 was the "x runlevel"-- if you look at /etc/inittab, the very start (of my backed-up one, at least says):
# These are the default runlevels in Slackware:
# 0 = halt
# 1 = single user mode
# 2 = unused (but configured the same as runlevel 3)
# 3 = multiuser mode (default Slackware runlevel)
# 4 = X11 with KDM/GDM/XDM (session managers)
# 5 = unused (but configured the same as runlevel 3)
# 6 = reboot
Putting such a script in .bash_profile wouldn't help you, as afaik .bash_profile doesn't do that anyway (meaning, serve the function of running this script).
What mikshaw meant was that if you use such a DM as KDM, GDM or XDM, you should add this script to the "Sessions" folder, choose it from the Sessions menu when logging in, and make it the default session for the user when asked.
For GDM (which is the display manager I use under all distros I've ever used), you would want to:
1) Open a text editor as root.
2) Browse to /etc/X11/dm/Sessions and open one of the *.desktop files in the editor.
3) Edit the file to reflect a new name, description, and change the "Application=" field to point to the script.
4) Save the file as whatever
.desktop and exit the text editor.
Don't forget to make the script executable.
When you reboot, the new Session type should appear in the GDM sessions list, you can choose it, and you will be asked if you want to make it the default session after filling in your normal login details. This will allow you to retain the other sessions you may have installed (if you choose nothing from the login Sessions menu, the default will load, if you want to run a KDE session, you would then choose KDE from the Sessions menu.
Afaik, this should also work for KDM and XDM, as they both read the session list from /etc/X11/dm/Sessions as well.
GDM also allows you to set up a "custom" session, which will load the session found in ~/.xinitrc (which is on my system a symlink to ~./xsession). The traditional manner of creating a custom session is in fact to use ~/.xsession, but on my system, this is already used by ROX, so I had to create an additional session to run the script that I use to load Openbox3 (which is my default session, but runs from a script in order to load several programs automatically at startup).
Hope this helps explain things.