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 2014-03-14 00:25:28 +0000

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.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
3

answered 2014-03-15 19:54:56 +0000

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.

edit flag offensive delete link more
1

answered 2014-03-15 20:56:50 +0000

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.

edit flag offensive delete link more

Comments

Great! Then, accept the answer ;)

joepd gravatar imagejoepd ( 2014-03-15 21:23:05 +0000 )edit

Question Tools

Stats

Asked: 2014-03-14 00:25:28 +0000

Seen: 875 times

Last updated: Mar 15 '14