How do I autostart a program at login?

Please post all general support questions for LXDE here.
Locked
kortsen
Posts: 8
Joined: Mon Feb 08, 2010 4:46 pm

How do I autostart a program at login?

Post by kortsen »

I just installed an LXDE system with the Debian 504 LXDE-XFCE install ISO. I would like to launch fusesmb each time I log in. I have installed and tested fusesmb and it works 100%. Now I just want to automate it.
aus9
Posts: 35
Joined: Tue Jun 02, 2009 8:42 am
Location: Australia

Re: How do I autostart a program at login?

Post by aus9 »

hi

I don't know that app.....change pathway to suit

lets pretend is in /usr/share/applications......choose an app....right hand click and copy to clipboard

go into your home folder
change to show hidden files
go to
/home/gordy/.config/autostart
paste your app there
logout and login to test.

2) if your app does not have a .desktop FORMAT let us know or change it eg

[Desktop Entry]
Version=1.0
Name=mtPaint graphic editor
GenericName=Painting program
Comment=painting program to create pixel art and manipulate digital photos
Type=Application
Exec=mtpaint..................................................................................................................................this may have to be full pathway...../usr/local/bin/fileexecutablename
Icon=mtpaint...................................................................................................................................this may have to be full pathway
Categories=Graphics;RasterGraphics;
kortsen
Posts: 8
Joined: Mon Feb 08, 2010 4:46 pm

Re: How do I autostart a program at login?

Post by kortsen »

Fusesmb is a command to fuse the smb network to the file system. More details are at http://en.wikipedia.org/wiki/Filesystem_in_Userspace.The command I use is

Code: Select all

fusesmb ~/mnt
and I can browse the windozers on the lan by opening the mnt folder in My Documents and drag-n-drop files with my favourite file manager.

There is no .desktop file for it and there is also no autostart subfolder in my .config folder. So, how do i craft a .desktop file for a terminal command, and can I just create an autostart folder to put it in? Or is there a better option for terminal commands?
kortsen
Posts: 8
Joined: Mon Feb 08, 2010 4:46 pm

Re: How do I autostart a program at login?

Post by kortsen »

I overlooked mentioning that I have changed distros since my original post. I am using WattOS (Ubuntu Jaunty + LXDE)
Marty Jack
Posts: 381
Joined: Mon Mar 23, 2009 5:14 am

Re: How do I autostart a program at login?

Post by Marty Jack »

The easiest possible way to start something at login is add the command to /etc/xdg/lxsession/LXDE/autostart and the only thing to be careful of is if you prefix it with @ then lxsession will start it again every time it exits, so you do not want to do that for something like xset which is just initializing something.
kortsen
Posts: 8
Joined: Mon Feb 08, 2010 4:46 pm

Re: How do I autostart a program at login?

Post by kortsen »

Marty Jack wrote:The easiest possible way to start something at login is add the command to /etc/xdg/lxsession/LXDE/autostart
I tried it and the result was worse than bad. I added

Code: Select all

@fusesmb ~/mnt
to the autostart file and the system wouldn't boot. hald choked and puked on a segfault. I got in with recovery mode and removed the line and all was well again.
Marty Jack
Posts: 381
Joined: Mon Mar 23, 2009 5:14 am

Re: How do I autostart a program at login?

Post by Marty Jack »

Try without the @ and with the ~ replaced by the path of your home directory. If that doesn't work, contact your distro for help. If HAL is crashing this is out of our control.
kortsen
Posts: 8
Joined: Mon Feb 08, 2010 4:46 pm

Re: How do I autostart a program at login?

Post by kortsen »

Thank you Marty Jack. I declared the full path and it works fine.

Code: Select all

fusesmb /home/lars/mnt
Marty Jack
Posts: 381
Joined: Mon Mar 23, 2009 5:14 am

Re: How do I autostart a program at login?

Post by Marty Jack »

I should cover the officially standardized Freedesktop way to specify autostart using a .desktop file, which you would use if you wanted it to be per user on a multi user system, but you could use any time.

In .config/autostart (which you may create if you don't have it yet) you place .desktop files. Whatever files are there when you log in are used. You can find most .desktop files in /usr/share/applications, which you could copy or symlink into .config/autostart. These are the ones that form your menu.

You can create your own desktop file if what you want to run doesn't have one. There are quite a few examples in the forum of what they look like or you can use one in /usr/share/applications as a starting point or you can read the standard.
prem123
Posts: 1
Joined: Sun Feb 28, 2010 8:39 pm

Re: How do I autostart a program at login?

Post by prem123 »

I am using Linux (Fedora Core 6) on a pretty high end hardware (at least when I bought it) - Intel Core 2 Duo E6600 Conroe 2.4GHz (4M shared L2 Cache) with 2 GB DDR2 RAM, nVidia dual-head graphics card for over a year now. And yet a simple change made it at least 20-40% faster.
Locked