How to set the default tag for jEdit windows in Awesome WM

awesomewindow-management

The following rule works as expected:

{ rule = { class = "Firefox" },
  properties = { tag = tags[2][2] } },

That is, Firefox instances are started on the second tag of the second screen. However, I have not been able to do the same for jEdit with this rule on the next line:

{ rule = { class = "jedit" },
  properties = { tag = tags[2][3] } },

jEdit instances always pop up on the first tag of the first screen. The window class looks correct:

$ xprop | grep "^WM_CLASS\|^WM_NAME" 
WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "jedit"
WM_NAME(STRING) = "jEdit - Untitled-1"

Except for the capitalization it's very similar to the result for Firefox:

$ xprop | grep "^WM_CLASS\|^WM_NAME" 
WM_CLASS(STRING) = "Navigator", "Firefox"
WM_NAME(STRING) = "How to place jEdit window in Awesome WM? - Unix & Linux Stack Exchange - Mozilla Firefox"

Mocking the WM name doesn't work either – after running the following the window still appears in the wrong place:

sudo pacman --sync wmname
wmname LG3D
jedit &

Java version:

$ java -version
java version "1.7.0_45"
OpenJDK Runtime Environment (IcedTea 2.4.3) (ArchLinux build 7.u45_2.4.3-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)

What's happening here?

Best Answer

Works on Ubuntu with 100% packaged components:

-- Set jedit to always map on tags number 2 of screen 1.
{ rule = { class = "org-gjt-sp-jedit-jEdit" },
  properties = { tag = tags[1][2] } },

This also works for me:

-- with instance
{ rule = { class = "org-gjt-sp-jedit-jEdit", instance = "sun-awt-X11-XFramePeer",  },
  properties = { tag = tags[1][2] } },

This is awesome 3.4.11 and jedit 4.4.2+dfsg-1 with java:

$ java -version
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.2)
OpenJDK Server VM (build 20.0-b12, mixed mode)

xprop output:

WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "org-gjt-sp-jedit-jEdit"
WM_NAME(STRING) = "jEdit - Untitled-1"
Related Question