LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-17-2005, 08:56 PM   #1
carl.waldbieser
Member
 
Registered: Jun 2005
Location: Pennsylvania
Distribution: Kubuntu
Posts: 197

Rep: Reputation: 32
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.
 
Old 10-17-2005, 10:27 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,986

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
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.
 
Old 10-18-2005, 12:51 AM   #3
sirphyxius
LQ Newbie
 
Registered: Sep 2003
Location: Houston, TX
Distribution: SuSE, RedHat
Posts: 1

Rep: Reputation: 0
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!
 
Old 10-18-2005, 10:37 AM   #4
AC97Conquerer
Member
 
Registered: Nov 2004
Location: US
Distribution: Debian Sid
Posts: 50

Rep: Reputation: 15
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
 
Old 06-30-2006, 01:27 AM   #5
kehtahui
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Rep: Reputation: 0
Question

Hi all,

Anyway to startup a script but without login in? Thanks.
 
Old 06-30-2006, 02:01 AM   #6
x86processor
Member
 
Registered: Jun 2006
Location: Chennai, India
Distribution: Embdebian, Debian, Fedora Core, Redhat, Slackware, Ubuntu.
Posts: 112

Rep: Reputation: 15
Quote:
Anyway to startup a script but without login in?
Invoke your script from any of the bootup scripts in /etc/init.d.
 
Old 06-30-2006, 04:21 AM   #7
kehtahui
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Rep: Reputation: 0
Lightbulb

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
 
Old 06-30-2006, 05:04 AM   #8
x86processor
Member
 
Registered: Jun 2006
Location: Chennai, India
Distribution: Embdebian, Debian, Fedora Core, Redhat, Slackware, Ubuntu.
Posts: 112

Rep: Reputation: 15
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.
 
Old 06-30-2006, 08:15 PM   #9
noranthon
Member
 
Registered: Apr 2006
Location: Australia
Distribution: PCLinuxOS with Xfce
Posts: 301

Rep: Reputation: 30
.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.

Last edited by noranthon; 06-30-2006 at 08:20 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Run program on startup as user startail Linux - Software 2 10-08-2004 05:06 AM
run program at startup.. me again.. :) rohan208 Linux - General 2 05-26-2004 08:03 PM
making kde run a command at startup wfettich Linux - General 3 05-10-2004 03:13 PM
Auto Startup Program for KDE technobarbie Linux - Software 1 04-14-2004 07:26 PM
Crashed program re-appears on evry startup in KDE sfbence Linux - Newbie 1 02-29-2004 12:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration