Skip to content

Instantly share code, notes, and snippets.

@cristianovitorino
Last active February 29, 2020 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cristianovitorino/b9b4888b7d5640f0a599451a675df9c1 to your computer and use it in GitHub Desktop.
Save cristianovitorino/b9b4888b7d5640f0a599451a675df9c1 to your computer and use it in GitHub Desktop.
Marks + Scratchpad = Awesome

Author: lygaret

By creating bindings that set a mark on a window, you can manage individual windows in the scratchpad, and have bindings that hide/show a particular window.

bindsym $mod+Shift+Mod4+0 mark "alpha", move scratchpad
bindsym $mod+Mod4+0 [con_mark="alpha"] scratchpad show

With those two bindings, I can move a window into the scratchpad, but do so with the ability to explicitly call it back. I have the full number row set up that way, and also a bunch of assignments to do this to certain apps.

With that, I can have what I'm considering "non-contextual" windows: profanity (a chat client), spotify, etc.; and pull them up on whatever workspace I'm working on, without the weird cycling that scratchpad does normally. For example, this is the full set of bindings for my spotify (which is launched by i3):

bindsym $mod+Mod4+m [con_mark="music"] scratchpad show
for_window [class="Spotify"] mark "music", move scratchpad
exec spotify

I just figured this out, and thought I'd share. Pretty sure it's not novel at all, but it's been really useful for me.


Modification: Cristiano Vitorino

My personal implementation

bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show

for_window [class="Application"] mark "a", move scratchpad
bindsym $mod+Control+a [con_mark="a"] scratchpad show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment