This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Autostart problems

Tags: None
(comma "," separated)
User avatar
bill-lancaster
Registered Member
Posts
55
Karma
0
OS

Autostart problems

Fri Mar 16, 2012 9:21 am
Adding a script to the Autostart module doesn't seem to work.
If I close and reopen the module, my script isn't shown.

Also, if the script did run it would need to wait for my WLAN to connect.

Any help would be appreciated
User avatar
toad
Global Moderator
Posts
1258
Karma
7
OS

Re: Autostart problems

Fri Mar 16, 2012 9:51 am
Is the script executable? For the WLAN problem you could use sleep to wait a certain period until it is connected.

BTW, this has nothing to do with suspend or hibernate, does it?


Debian testing
User avatar
bill-lancaster
Registered Member
Posts
55
Karma
0
OS

Re: Autostart problems

Fri Mar 16, 2012 9:57 am
No, the script is what I enter manualy each day in Terminal.
I checked in .kde/Autostart and there seems to be an appropriate file containing:-

[Desktop Entry]
Icon=unknown
Name=get_iplayer%20--type=radio
Type=Link
URL[$e]=get_iplayer%20--type=radio

Hope this helps
User avatar
toad
Global Moderator
Posts
1258
Karma
7
OS

Re: Autostart problems

Fri Mar 16, 2012 10:40 am
Hm, not sure about this.

For the script to work from autostart it has to be in your PATH and be executable. My ~/.kde4/Autostart is empty so I don't know what those entries look like. Google should be helpful on that front.


Debian testing
ozjd
Registered Member
Posts
38
Karma
0
OS

Re: Autostart problems

Sat Mar 17, 2012 5:50 am
I had a similar problem and found only full paths worked. Shortcuts like '~' didn't. Same applied to options like adding a path to a config file to a command.
lamarque
Registered Member
Posts
152
Karma
2
OS

Re: Autostart problems

Sat Mar 17, 2012 3:30 pm
bill-lancaster wrote:No, the script is what I enter manualy each day in Terminal.
I checked in .kde/Autostart and there seems to be an appropriate file containing:-

[Desktop Entry]
Icon=unknown
Name=get_iplayer%20--type=radio
Type=Link
URL[$e]=get_iplayer%20--type=radio

Hope this helps


You should use Exec= instead of URL=. Your .desktop should look like this:

[Desktop Entry]
Name=get_iplayer
Type=Application
Exec=$HOME/bin/get_iplayer --type=radio
X-KDE-StartupNotify=false
X-KDE-autostart-phase=2

Since you want it to start your script when there is a connection you can use Plasma NM's notification system instace of autostart. Just go to "Manage Connections" -> "Other" -> "Configure Notifications". Select "Network Connection Succeeded", check "Run command", select your script and click in "Apply". You can uncheck all other events (for example "Show a message in a popup" is the default event) if you do not need them.

That works for user connections (the default in Plasma NM). For system connections you will have to copy your script to /etc/NetworkManager/dispatcher.d/ and edit it to be run only on connection starts. dispatcher.d also works for user connections, but as you can see there is no GUI to configure it.


Software engineer at Petrobrás http://www.petrobras.com.br/en/about-us/
KDE's Network Management maintainer


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]