r/i3wm•
shemot

How To Get Working Scratchpads On i3-gaps?

Solved

To clarify for any who may not know, scratchpads are programs that are generally open via keybind in a floating window, and when the keybind is pressed again, the program completely hides from all workspaces but does not kill/shut off.

For example, I want to be able to start up cmus music player with Mod+z as a floating window, choose a song/playlist, then press Mod+z again to completely hide cmus from all workspaces, but continue having music play.

I've tried a few online tutorials and alas, to no avail. These include:
https://faq.i3wm.org/question/138/multiple-scratchpad.1.html

https://build.i3wm.org/docs/userguide.html

https://blog.madadipouya.com/2017/11/27/how-to-add-terminator-as-i3-wm-scratchpad/

The best I've gotten from the info I've learned from all three is simply making cmus start with a keybind, but not in a floating window and doesn't close when I hit the keybind again. However I already knew how to do that. I'm just not competent enough with the i3 config file. Would anyone be willing to help?

i3 version: 4.16.1-113-gddde89fe (2019-02-25, branch "gaps-next")
Idk it probably isn't too important but just incase I'm on bunsenlabs linux based on debian, testing repos enabled.
Thanks in advance.

Posted Mar 4, 2019, 6:20 AM UTC

65
zerocci3-gaps•

Start cmus with i3 via an exec in the config, and

for_window [class="cmus"]               move scratchpad
bindsym $mod+c                          [class="cmus"] scratchpad show

or whatever class cmus declares itself as. Other criteria are available: https://i3wm.org/docs/userguide.html#command_criteria

6
strijelaci3•

Well I don't know how to solve your problem but thank you very much for short tutorial 😀

2
shemotOPi3•

No problem!

Thanks to the other two who gave me the info on how to make it work.

2
shemotOPi3•

Thanks to both of you!

I figured out I wasn't starting the cmus right in the config, trying to start it as it's own instance instead of through terminator, most prominently.

Here's my working config for the cmus scratchpad:
exec --no-startup-id terminator --name=cmus -e cmus

for_window [instance="cmus"] floating_enable

for_window [instance="cmus"] move scratchpad; [instance="cmus"] scratchpad show; move scratchpad

bindsym $mod+z [instance="cmus"] scratchpad show

1
KiteAnton•

Luke Smith has a video on this, https://youtu.be/Ja-DgvGPDu8 The scratchpad parts starts at ~4:10

-2â€