LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Run program before KDE startup (https://www.linuxquestions.org/questions/linux-software-2/run-program-before-kde-startup-374102/)

carl.waldbieser 10-17-2005 08:56 PM

Run program before KDE startup
 
I am looking for a way to run some startup scripts when a user logs into KDE. Normally, I would put the scripts in ~/.kde/Autostart, but this script needs to be run *before* KDE goes through its initialization process. I would also like the scripts to run as the user that starts the KDE session.

I tried placing the script in ~/.xsession and ~/.xprofile, but that didn't seem to work. Anybody have any idea if such a startup config for KDE even exists?

Thanks.

kilgoretrout 10-17-2005 10:27 PM

Try editing /usr/bin/startkde by putting your startup script at the beginning. Startkde is a script that, not surprisingly, starts kde; it runs with the privilege of the user starting kde. Should work in theory.

sirphyxius 10-18-2005 12:51 AM

Loading Applications at Startup
 
Check this page out http://suseroot.com/suse-linux-tweaks/load-startup.php . It tells you how to load an app at startup by editing the .xinitrc.template file in your home folder.

Good luck!

AC97Conquerer 10-18-2005 10:37 AM

Oh this is easy! You put your stuff that you want to load up into ~/.xinitrc. I'm starting the KDE from here because I uninstalled xdm/gdm/kdm.

Code:

$: cat ~/.xinitrc
/home/psycho/Programming/Library/bin/bootup &  # This is the stuff I start before KDE starts
exec startkde

#Don't mind the stuff below here, though it may give you some good ideas :]
#exec gnome-session
#exec aewm -3 xterm


# Run profile to set $PATH and other environmental vars correctly
#. $HOME/.bash_profile

# Set background
#xsetroot -solid '#056'

# Set mouse acceleration
#xset m 7 2

# Run initial programs
#xterm &

# Start icewm
#exec icewm-session || exec xterm -fg red


kehtahui 06-30-2006 01:27 AM

Hi all,

Anyway to startup a script but without login in? Thanks.

x86processor 06-30-2006 02:01 AM

Quote:

Anyway to startup a script but without login in?
Invoke your script from any of the bootup scripts in /etc/init.d.

kehtahui 06-30-2006 04:21 AM

Quote:

Originally Posted by x86processor
Invoke your script from any of the bootup scripts in /etc/init.d.

Hi, i did try to put into to /etc/init.d and change the System service to run on level 3 / 5 but the script is not execute after reboot.

Basically what i want my script do is if boot up (without user login) it will pop-up an xterm on remote worstation (e.g. Solaris / Windows).

Need your advise, thanks :scratch:

x86processor 06-30-2006 05:04 AM

Quote:

i want my script do is if boot up (without user login) it will pop-up an xterm on remote worstation
Ohh! Give a shell to a user without logging in? I think this is where we draw the line for security and login procedures.

noranthon 06-30-2006 08:15 PM

.xinitrc does not work here
 
I thought I had finally found the answer. I want bittorrent to start when I logon. Most of the time, it's only seeding and I can forget to start it.

This is the .xinitrc in my home folder:
Quote:

#!/bin/bash
#
/usr/bin/bittorrent
I did not have the path initially because it is not needed in the menu shortcut. With or without the path, it is ineffective.

I also tried adding a symlink to /~/.kde/Autostart but it does not autostart. I'd prefer to make provision at the user level and just leaving the bittorrent window open when shutting down seems crude and dirty.

.xinitrc is not mentioned in the .xsession-errors file but the symlink is:
Quote:

File "/home/terry/.kde/Autostart/bittorrent", line 3809, in ?
d = DownloadInfoFrame(config,TorrentQueue.ThreadWrappedQueue(torrentqueue))
File "/home/terry/.kde/Autostart/bittorrent", line 2727, in __init__
self.mainwindow = Window(gtk.WINDOW_TOPLEVEL)
File "/usr/lib/python2.4/site-packages/BitTorrent/GUI.py", line 287, in __init__
IconMixin.__init__(self)
File "/usr/lib/python2.4/site-packages/BitTorrent/GUI.py", line 280, in __init__
icon16 = gtk.gdk.pixbuf_new_from_file_at_size(iconname, 16, 16)
gobject.GError: Failed to open file '/home/terry/.kde/Autostart/images/bittorrent.ico': No such file or directory
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.4/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/home/terry/.kde/Autostart/bittorrent", line 3799, in btgui_exit_gtk
mainloop.run()
File "/home/terry/.kde/Autostart/bittorrent", line 3767, in run
self.mainwindow.traythread.start()
AttributeError: 'NoneType' object has no attribute 'traythread'
which is so much gobbledegook to me. Why kde expects to find the icon file in autostart is a mystery.

Perhaps this is a question about bittorrent?

Gnome, evidently, has a gui command for adding startup files. There is a dearth of information about this. I've tried Mandriva and kde sources. I'll keep on looking but linuxquestions in my experience is the best place to get answers. :Pengy:


All times are GMT -5. The time now is 06:12 AM.