2

I want to run some program at the certain condition.

So I have created .desktop file and put it int /etc/xdg/autostart.

Here desktop file is:

[Desktop Entry]
Type=Application
Name=System Tray
Exec=/opt/testApp
OnlyShowIn=GNOME;Unity;
NoDisplay=true
AutostartCondition=GSettings com.test testVal
X-GNOME-AutoRestart=true

And I have made a custom key with gsettings for a condition and compiled the schemas.

I confirm if the schema works, it works.

$> gsettings set com.test testVal true
$> gsettings get com.test testVal

I typed the command above, and got "true".

However the Application I registered as Autostart doesn't run.

Do I have to restart or logoff for a test?

Is there a way to test autostart without reboot or logoff?

closed as off-topic by don_crissti, roaima, A.B, icarus, Jeff Schaller Dec 30 '18 at 1:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question has been posted on multiple sites. Cross-posting is strongly discouraged; see the help center and community FAQ for more information." – don_crissti, roaima, A.B, icarus, Jeff Schaller

  • What's the content of /opt/testApp? – Braiam Dec 30 '14 at 6:24
  • It's a GUI application using Qt. – tnrgus Dec 30 '14 at 6:47
  • I use KDE, so I'm sure I'm missing some fine points here, but: If it's a gui program, it needs the desktop environment to be already running. So why not just write an autostart script for it that your desktop will run when it starts. That script can test for any conditions you like and decide what to do. For example, see cyberciti.biz/tips/… . I don't get the gsettings part, but that may just be because I don't use that desktop. – Joe Jan 8 '15 at 1:22

Browse other questions tagged or ask your own question.