3

I was using indicator-stickynotes command in Startup applications which worked fine. I modified it to sleep 30;indicator-sticknotes. I read this in different articles and even on this site. But this isn't working for mine.

It was like:

Before

I modified it to:

After

  • 1
    I think you have enough reputation on this site to use the image uploading facility by clicking on the image icon about the area for composing your question or answer. Doing so, will display your images correctly. – DK Bose May 11 '19 at 13:42
  • @DKBose i don't want to annoy the people by making the post length, so... i did that. – Pranav May 11 '19 at 14:19
  • 2
    @PrabeshBhattarai There's nothing like annoying people with length of the post. We hate length of post when they include irrelevant statements like: I am new to Linux, I know nothing about it. Please help. I don't know what to do, etc.. There are many posts which are of more than 1000 words but they contain relevant details. – Kulfy May 11 '19 at 14:23
5

Whenever startup applications are defined, it creates a desktop entry in ~/.config/autostart. So, it's a desktop entry which is responsible for launching an application at startup.

On a typical command line (terminal) you can use one of the following to execute two commands.

sleep 30; indicator-stickynotes
sleep 30 && indicator-stickynotes
sleep 30 & indicator-stickynotes

But desktop entries are very much different from the command line. According to Desktop Entry Specification:

The Exec key

The Exec key must contain a command line. A command line consists of an executable program optionally followed by one or more arguments.

Therefore only one command can be used in Desktop entries. Since you are using two commands, it'll eventually result in errors. Either desktop entry will fail to launch the application or the second command will be considered as an argument to the first command.

You can use sh/bash as a command for this, like:

sh -c "sleep 30; indicator-stickynotes"

As pointed out by ElementW in one of their comment, sleep 30; exec indicator-stickynotes would save a little memory and a PID, since sh is otherwise only waiting on indicator-stickynotes, its child process, to terminate, and serves no other purpose.

| improve this answer | |
  • 1
    sleep 30; exec indicator-stickynotes would save a little memory and a PID, since sh is otherwise only waiting on indicator-stickynotes, its child process, to terminate, and serves no other purpose. – ElementW May 11 '19 at 16:48
  • @Kulfy In sh -c, obviously, since 1. I mention sh would be waiting and 2. exec is a shell built-in and .desktop files launch processes, not shell command lines. Also, exec, not env, which is essentially a no-op when called with no args within a shell. – ElementW May 11 '19 at 18:31
  • @ElementW Your command: sh -c "sleep 18; exec indicator-stickynotes" also work. I just tried it on mine. – Pranav May 11 '19 at 23:45
  • @ElementW I was little bit sleepy while writing the comment. I mistyped exec as env :-P. By the way thank you for pointing out that. That was a fair point. I've added what you said in my answer :) – Kulfy May 12 '19 at 4:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.