The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
1

"Sleep" or delay for autostarted apps?

asked Mar 14 '14

oldos2er gravatar image

Is there a way to delay an application's startup time in ~/.i3/config? Currently in ~/.i3/config I have the line

exec --no-startup-id i3-msg 'workspace 6; exec qbittorrent; workspace 1'

but I would like to delay qbittorrent's start for 10 or 15 seconds after i3 starts. If I could add "sleep 15" somewhere in the exec line that would be great, if anyone knows.

2 answers

Sort by » oldest newest most voted
3

answered Mar 15 '14

joepd gravatar image

The workspace assignment can better be fixed with a for_window-matcher. See elsewhere in the FAQ. This solves multiple issues with your command already. As for the sleep thing, you could try (untested):

exec --no-startup-id "sh -c 'sleep 10; exec qbittorent'"

Explanation: Here it says: exec --no-startup-id program, where the program is sh. The exec in sh means that the PID of sh will be replaced by the PID of qtorrent. If you would look at pstree -ap | less, you will notice that qtbittorrent is a direct descendant of i3, without another shell process in between.

1

answered Mar 15 '14

oldos2er gravatar image

Thank you. This line finally worked for me:

exec "sh -c 'sleep 15; exec qbittorrent'"

I have qbittorrent set to start minimized.

Comments

Great! Then, accept the answer ;)

joepd gravatar imagejoepd (Mar 15 '14)edit

Question Tools

Stats

Asked: Mar 14 '14

Seen: 875 times

Last updated: Mar 15 '14