title: Set WM_CLASS (with wnck, xprop, or something else)
body: <p>I'm trying to group multiple Chrome standalone windows under the same launcher in Ubuntu 14.04. It doesn't seem to be possible simply to specify multiple <code>WM_CLASS</code> variables in the .desktop file (see comments on <a href="https://askubuntu.com/a/294350/66309">this answer</a>).</p>
  
  <p>The first solution I hit on is to use xprop to change the WM_CLASS of the extra windows to be the same as a chosen master window, after a short delay. This works if I don't specify which window to change at the command line, let it give me a crosshair, and click on the wayward window, with a command like this:</p>
  
  <pre><code>xprop -f WM_CLASS 8s -set WM_CLASS crx_kphgejagakmceapfinpoopapfdnkkepf
  </code></pre>
  
  <p>(taken without much understanding from <a href="https://askubuntu.com/a/750134/66309">this</a> answer to the same question)</p>
  
  <p>It gets the new <code>WM_CLASS</code>, and Ubuntu immediately regroups it under the chosen launcher rather than Chrome.</p>
  
  <p>However, despite the window to all appearances having the very simple name <code>Todoist</code> (this is what appears on the title bar, and <code>xprop | grep -i name</code> gives</p>
  
  <pre><code>WM_NAME(UTF8_STRING) = "Todoist"
  _NET_WM_NAME(UTF8_STRING) = "Todoist"
  WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
  </code></pre>
  
  <p>So, I decide xprop can't be trusted.</p>
  
  <p>Instead, I found I can use the python package wnck to access this window, after a fashion:</p>
  
  <pre><code>import wnck
  todoist = [w for w in wnck.screen.get_defaults().get_windows()
             if 'todoist' in w.get_name().lower()][0]
  </code></pre>
  
  <p>So, how can I use this object <code>todoist</code> to change the underlying <code>WM_CLASS</code>?</p>
  
  <p>I realize this is totally an xy-problem question, and so am open to completely different approaches.</p>