The i3 FAQ has migrated to All content here is read-only.
Ask Your Question

Can't get a window to start in the scratchpad - and i3 behaves very oddly

asked 2015-02-06 06:31:37 +0000

Shankar gravatar image

updated 2015-02-06 06:34:07 +0000

Following the advice in other questions here, I put this in my config:

exec_always urxvtc  -fn xft:Inconsolata:size=11 -fg white -bg black -name scratchurxvt -e /usr/bin/fizsh 
for_window [instance="scratchurxvt"] move scratchpad

urxvtc is the client program for starting a urxvt terminal when urxvtd (the daemon) is running. I start urxvtd with an exec line above these lines in the config.

Later on I have this

bindsym $mod+p scratchpad show

But once I start i3 the scratchpad does not respond. The scratchpad works ok if I manually move a window to it (using another keybinding). If I remove the for_window directive, the terminal window pops up correctly on startup with the right title. When the for_window directive is on, the terminal window does not appear - implying that it should have been moved to the scratchpad - but nothing happens when I press $mod+p. The same problem occurs if I use xterm instead of urxvtc.

The behaviour becomes even weirder if I use urxvt instead of urxvtc:

exec_always urxvt  -fn xft:Inconsolata:size=11 -fg white -bg black -name scratchurxvt -e /usr/bin/fizsh

If I do this I cannot get any program to start. Pressing $mod + 2 does not open a new workspace either.

I find this very puzzling. How do I get this to work?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-02-09 08:55:36 +0000

Shankar gravatar image

updated 2015-02-14 13:39:17 +0000

The problem seems to be that the scratchpad is not "ready" when i3 starts. Windows moved into it through the for_window directive or even through i3-msg in the initial few seconds just vanish.

I finally got it to work by shifting a lot of my exec commands into a shell script, then ensuring that the script sleeps for 5 seconds before using i3-msg to shift the window into the scratchpad (I've also switched to lilyterm but that seems to be incidental). The script is called using exec_always from the main config file, like so:

exec_always /mnt/docfile/root/my-documents/Software/

The script itself has the following:

i3-msg exec "lilyterm --title scratchlilyterm -e offlineimap"
i3-msg exec --no-startup-id "run_once nm-applet"
# < various utility scripts are also run>
i3-msg exec iceweasel &
i3-msg exec claws-mail &
sleep 5
i3-msg '[ title="scratchlilyterm" ] move scratchpad'

If I get the chance I'll file a bug report in this regard.

edit flag offensive delete link more

Question Tools


Asked: 2015-02-06 06:31:37 +0000

Seen: 1,782 times

Last updated: Feb 14