You are not logged in.

#1 2010-06-21 19:30:39

Compintuit
Member
Registered: 2010-03-19
Posts: 19

Autostart applications in ~/.config/autostart without DE

Hello all, I've got a setup with compiz and awn for my desktop. I'd like to also start various other programs, and it doesn't seem right to put them in .xinitrc, not when I could be talking a dozen of them. Can someone either tell me how to start them with compiz, or just execute them all? I know the command xdg-open will open a file, but when I need to open a directory full of files, how can I make that happen? Thanks.

Offline

#2 2010-06-21 22:05:08

Peanut
Member
From: Norway
Registered: 2009-05-24
Posts: 99

Re: Autostart applications in ~/.config/autostart without DE

I'd like to also start various other programs, and it doesn't seem right to put them in .xinitrc, not when I could be talking a dozen of them. Can someone either tell me how to start them with compiz, or just execute them all?

What sort of application launchers do you plan to put in this directory? FreeDesktop.org style .desktop-files, or just symlinks/scripts?

I know the command xdg-open will open a file, but when I need to open a directory full of files, how can I make that happen?

If xdg-open does the job for a single file, a simple for loop should take care of a directory:

for file in /path/to/dir/*
do xdg-open "$file" &
done

Last edited by Peanut (2010-06-21 22:07:08)

Offline

#3 2010-06-21 23:28:09

Compintuit
Member
Registered: 2010-03-19
Posts: 19

Re: Autostart applications in ~/.config/autostart without DE

I want to open FreeDesktop.org .desktop style files. I just learned that xdg-open opens them in firefox, though, not launching them even when they're trusted. What do I need to launch them in? I think I know how to change what xdg-open will open them in, I just need to know that. Thanks.

Offline

#4 2010-06-21 23:43:09

Peanut
Member
From: Norway
Registered: 2009-05-24
Posts: 99

Re: Autostart applications in ~/.config/autostart without DE

Compintuit wrote:

I just learned that xdg-open opens them in firefox, though, not launching them even when they're trusted.

xdg-open opens them in whatever is configured as the default handler for that kind of file; it's the command line equivalent of double-clicking a file in a graphical file manager.

Putting this code in your ~/.xinitrc should work:

for file in /path/to/dir/*.desktop
do $(sed -e 's/^Exec=//p' -e d "$file") &
done

Basically, that snippet will look for lines that begin with Exec= in every .desktop-file in /path/to/dir, and then strip those lines of the text Exec= and run the rest of the line as a command in the background.

Last edited by Peanut (2010-06-22 01:34:44)

Offline

Board footer

Powered by FluxBB