LXDE Autostart

What is the usual location of an autostart file for lxde?

I read somewhere that it can be ~/.config/autostart but that doesn't work for me.
 
$HOME/.config/autostart is a directory with startup files in it, not a single file.
Here is an example from one of my systems that sets up 2 monitors. The "OnlyShowIn" variable means this specific is only seen when you are configuring LXDE. There is probably documentation somewhere on the format of these files.

more lxrandr-autostart.desktop
[Desktop Entry]
Type=Application
Name=LXRandR autostart
Comment=Start xrandr with settings done in LXRandR
Exec=sh -c 'xrandr --output HDMI-A-0 --mode 1920x1080 --rate 60.00 --output eDP
--mode 1920x1200 --rate 60.00 --left-of HDMI-A-0'
OnlyShowIn=LXDE
 
$HOME/.config/autostart is a directory with startup files in it, not a single file.
Here is an example from one of my systems that sets up 2 monitors. The "OnlyShowIn" variable means this specific is only seen when you are configuring LXDE. There is probably documentation somewhere on the format of these files.

more lxrandr-autostart.desktop
[Desktop Entry]
Type=Application
Name=LXRandR autostart
Comment=Start xrandr with settings done in LXRandR
Exec=sh -c 'xrandr --output HDMI-A-0 --mode 1920x1080 --rate 60.00 --output eDP
--mode 1920x1200 --rate 60.00 --left-of HDMI-A-0'
OnlyShowIn=LXDE
So exactly how would I specify that I wanted to start chrome when lxde starts up?
 
It's been a while since I've actually used LXDE, but somewhere I think under settings should be an "autostart" item.
It basically presents a list of "things" that can be enabled to autostart, you select one and enable it. I don't recall the exact format of the UI, but it was roughly a dialog box with 2 lists, one of "available" one a list of "enabled".
The 2 lists may be merged, think "here's a list of things that can be autostarted, ones that are checked will autostart".
For Chrome, you may need to create your own autostart file, the sample I posted change Name, Comment and Exec lines.

You may also be able to "save session"; so start LXDE, start chrome, then save session. Next time you login in it should start Chrome.

Some of this may also be covered in the LXDE documentation.
 
The LXDE autostart file is located at the users ~/.config/lxsession/LXDE/autostart
Does this file get created automatically when you install LXDE?

I thought it did, because I have used it in the past, but I don't have one now.

I know I can create it, but I thought it got created automatically.

I have lxpanel and lxterminal but no lxsession. I just wondered where it came from. ie does it get created automatically or manually.
 
I'm not using LXDE, but reading sample on comment #2, it looks to be a generic *.desktop file.
Not all ports / pkgs has one, but www/chromium should have /usr/local/share/applications/chromium-browser.desktop
. Try copying it into the mentioned directory.
 
I'm not using LXDE, but reading sample on comment #2, it looks to be a generic *.desktop file.
Not all ports / pkgs has one, but www/chromium should have /usr/local/share/applications/chromium-browser.desktop
. Try copying it into the mentioned directory.
Yes it is a generic desktop file, but for something I needed to create by hand. A lot of application do have them in /usr/local/share, but not all.
 
Using provided *.desktop file would be the easiest way for DEs, but I think DEs usually have GUI panel to enter sufficient info to create one per-user basis.
 
Using provided *.desktop file would be the easiest way for DEs, but I think DEs usually have GUI panel to enter sufficient info to create one per-user basis.
If you dig into the startup code of some DEs (I think "awesome" was the easiest to figure out for me) they look in a few standard places for desktop files (like a PATH) but not all applications put their files on that path. So you may need to manually edit stuff to get the "automatic" part.
Standards are great when everyone strictly follows them :)
 
they look in a few standard places for desktop files (like a PATH)
I believe /usr/local/share/applications is the place to store *.desktop files.
The second best would be /usr/local/share/<executablename>.

Putting *.desktop into /usr/local/bin/ would be a nearly worst idea, as there would be thousands of files on desktop use-cases.

But some ports (maybe mainly ported from Windows) could want equivalent info into the binary itself. The design was quite useful on quite early "Windoze on DOS" era (especially upto 3.x) as disks were far more smaller than now. But now it's a large pain to seek desktop info from executables.
 
By the way, ports supports the DESKTOPDIR variable, which is set to ${PREFIX}/share/applications by default.
Maybe not all ports (especially ones existing from before the variable is introduced) uses it. And some would NOT have *.desktop at all even if it's actually a desktop app. Sorry, forgot which ones were.
 
Does this file get created automatically when you install LXDE?

I thought it did, because I have used it in the past, but I don't have one now.

I know I can create it, but I thought it got created automatically.

I have lxpanel and lxterminal but no lxsession. I just wondered where it came from. ie does it get created automatically or manually.
No it does not. Only when you start something lx
 
I don't understand what you are saying. (language problem).
Note, i once deleted .config autostart but it was recreated ...
On xfce desktop you can select the services to start.
 
Does this file get created automatically when you install LXDE?

I thought it did, because I have used it in the past, but I don't have one now.

I know I can create it, but I thought it got created automatically.

I have lxpanel and lxterminal but no lxsession. I just wondered where it came from. ie does it get created automatically or manually.
It is created automatically. Are you using perhaps a display manager (sddm, lighdm, ly, slim)?
 
Like i said it is created on the start of an lx application not on the install
Should be.
On install, ports / pkgs cannot know to which user configurations are delivered.
So usually installs defaults of them in shared place (typically /usr/local/share/<portsname>/) and copy them into the user who runs it "at the first run by the user".
 
Back
Top