LinuxQuestions.org
Review your favorite Linux distribution.
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-13-2006, 09:06 AM   #1
dreamtheater
Member
 
Registered: Feb 2004
Posts: 44

Rep: Reputation: 15
How to autostart some script after launching an X Session?


.) How can I execute a script after starting an X session?
.) I want the script only to be executed when IceWM starts but not when KDE starts.
.) I'd like to start a konsole which executes an ssh command like

Quote:
konsole -e ssh user@host
 
Old 10-13-2006, 09:37 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
How can I execute a script after starting an X session?
Look at the /etc/X11/gdm/PostSession/Default script?


I want the script only to be executed when IceWM starts but not when KDE starts.
DE choice is in /etc/X11/xdm/Xsession, take it from there.


I'd like to start a konsole which executes an ssh command
If you want a personal script then just run it from your ~/.xinitrc.

Last edited by unSpawn; 10-13-2006 at 09:39 AM.
 
Old 10-13-2006, 09:51 AM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
  1. Create a directory in your home directory called .icewm (it may exist already):
    Code:
    mkdir $HOME/.icewm
  2. Create a file called "startup" in that directory with a small shell script to do your command:
    Code:
    #!/bin/bash
    konsole -e ssh user@host
  3. make the file executable:
    Code:
    chmod 755 $HOME/.icewm/startup

Next time you log in the startup script should be run. This will only run under icewm.

If you use the Xsession approach, you could test the environment variable DESKTOP_SESSION to determine which type of login it is, but this is not necessary if you're using icewm's own startup script.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Shell script adding autostart gnome script Coolrunr Programming 3 01-01-2009 02:23 PM
AutoStart a Script extremebfn Slackware 2 09-11-2004 09:25 PM
launching a script from rc.d invar Linux - Software 5 08-16-2004 03:42 PM
mozilla 1.7 launching script mrpringle Linux - Software 3 07-09-2004 04:46 PM
Launching Firebird through a script Travis S Linux - Software 5 02-03-2004 09:40 PM

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

All times are GMT -5. The time now is 11:10 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