{"id":2789,"date":"2011-01-09T18:51:07","date_gmt":"2011-01-09T17:51:07","guid":{"rendered":"http:\/\/blog.jteam.nl\/?p=2789"},"modified":"2011-01-09T18:51:07","modified_gmt":"2011-01-09T17:51:07","slug":"make-intellij-idea-behave-properly-in-linux-docks","status":"publish","type":"post","link":"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/","title":{"rendered":"Make Intellij IDEA behave properly in linux docks"},"content":{"rendered":"<p>One of my pet peeves when working on Linux has always been that java applications do not work well with popular docks like <a href=\"http:\/\/do.davebsd.com\/wiki\/Docky\">Docky<\/a> and <a href=\"http:\/\/www.glx-dock.org\/\">Cairo dock<\/a>. When you add a Java application as a launcher to the dock and use it to launch the application it will still create another icon in the dock, which in a way defeats the purpose of a dock. Reading the comments in following <a href=\"https:\/\/bugs.launchpad.net\/docky\/+bug\/484610\">bugreport<\/a> made it apparent to me, that this is not something that can be easily fixed by the dock&#8217;s authors, since the problem lies within the jdk. A <a href=\"http:\/\/wiki.go-docky.com\/index.php?title=How_to_Customize_Window_Matching\">workaround<\/a> exists but it does not apply to all Java applications.<\/p>\n<p>One of the applications the workaround does not work for, unfortunately is Intellij IDEA. The one application I use most on a day to day basis.<\/p>\n<p>When you request the WM_CLASS for Intellij it will identify itself as java-lang-Thread<\/p>\n<pre>xprop | grep WM_CLASS | awk '{print $4}'\n\"java-lang-Thread\"<\/pre>\n<p>Which is not something that can be used to identify all windows belonging to Intellij. So I decided to see if I could work around this problem, and succeeded. Here&#8217;s what you do to make Intellij behave properly<\/p>\n<p>UPDATE 23-01-2010 : whoah seems my original approach had some issues with classloading. (Who needs to create new classes anyway \ud83d\ude09 ) So here are the new and improved instructions.<\/p>\n<p>1. Download\u00a0 <a href=\"http:\/\/jelmer.s3.amazonaws.com\/agent.jar\">agent.jar<\/a> and copy it to Intellij&#8217;s bin folder.<\/p>\n<p>I wont describe in detail what this jar does. But it&#8217;s something i created that changes the default value sun.awt.X11.XToolkit assigns to WM_CLASS. The sources are included in the jar<\/p>\n<p>2. Open idea.sh\u00a0 And change the line\u00a0 that looks like<\/p>\n<pre>exec $IDEA_JDK\/bin\/java $JVM_ARGS $IDEA_MAIN_CLASS_NAME $*<\/pre>\n<p>to<\/p>\n<pre>exec $IDEA_JDK\/bin\/java -javaagent:agent.jar=Intellij_IDEA $JVM_ARGS $IDEA_MAIN_CLASS_NAME $*<\/pre>\n<p>3. Find the .desktop file that is used to start intellij by executing the following command from your home folder<\/p>\n<pre>find . -name '*.desktop' -exec grep -H idea.sh {} \\;<\/pre>\n<p>4. Edit the file you found in step 3 and add the following line<\/p>\n<pre>StartupWMClass=Intellij_IDEA<\/pre>\n<p>Done!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of my pet peeves when working on Linux has always been that java applications do not work well with popular docks like Docky and Cairo dock. When you add a Java application as a launcher to the dock and use it to launch the application it will still create another icon in the dock, [&hellip;]<\/p>\n","protected":false},"author":58,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[10],"tags":[186,48],"class_list":["post-2789","post","type-post","status-publish","format-standard","hentry","category-development","tag-intellij","tag-linux"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Make Intellij IDEA behave properly in linux docks - Trifork Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Make Intellij IDEA behave properly in linux docks - Trifork Blog\" \/>\n<meta property=\"og:description\" content=\"One of my pet peeves when working on Linux has always been that java applications do not work well with popular docks like Docky and Cairo dock. When you add a Java application as a launcher to the dock and use it to launch the application it will still create another icon in the dock, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/\" \/>\n<meta property=\"og:site_name\" content=\"Trifork Blog\" \/>\n<meta property=\"article:published_time\" content=\"2011-01-09T17:51:07+00:00\" \/>\n<meta name=\"author\" content=\"Jelmer Kuperus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jelmer Kuperus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/\",\"url\":\"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/\",\"name\":\"Make Intellij IDEA behave properly in linux docks - Trifork Blog\",\"isPartOf\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#website\"},\"datePublished\":\"2011-01-09T17:51:07+00:00\",\"author\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/c0ee9f25744015bf661fee1b797341f2\"},\"breadcrumb\":{\"@id\":\"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/trifork.nl\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Make Intellij IDEA behave properly in linux docks\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/trifork.nl\/blog\/#website\",\"url\":\"https:\/\/trifork.nl\/blog\/\",\"name\":\"Trifork Blog\",\"description\":\"Keep updated on the technical solutions Trifork is working on!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/trifork.nl\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/c0ee9f25744015bf661fee1b797341f2\",\"name\":\"Jelmer Kuperus\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fff87cf8073c776ffcbe26326f713998?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fff87cf8073c776ffcbe26326f713998?s=96&d=mm&r=g\",\"caption\":\"Jelmer Kuperus\"},\"sameAs\":[\"http:\/\/www.dutchworks.nl\"],\"url\":\"https:\/\/trifork.nl\/blog\/author\/jelmer\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Make Intellij IDEA behave properly in linux docks - Trifork Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/","og_locale":"en_US","og_type":"article","og_title":"Make Intellij IDEA behave properly in linux docks - Trifork Blog","og_description":"One of my pet peeves when working on Linux has always been that java applications do not work well with popular docks like Docky and Cairo dock. When you add a Java application as a launcher to the dock and use it to launch the application it will still create another icon in the dock, [&hellip;]","og_url":"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/","og_site_name":"Trifork Blog","article_published_time":"2011-01-09T17:51:07+00:00","author":"Jelmer Kuperus","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jelmer Kuperus","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/","url":"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/","name":"Make Intellij IDEA behave properly in linux docks - Trifork Blog","isPartOf":{"@id":"https:\/\/trifork.nl\/blog\/#website"},"datePublished":"2011-01-09T17:51:07+00:00","author":{"@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/c0ee9f25744015bf661fee1b797341f2"},"breadcrumb":{"@id":"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/trifork.nl\/blog\/make-intellij-idea-behave-properly-in-linux-docks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/trifork.nl\/blog\/"},{"@type":"ListItem","position":2,"name":"Make Intellij IDEA behave properly in linux docks"}]},{"@type":"WebSite","@id":"https:\/\/trifork.nl\/blog\/#website","url":"https:\/\/trifork.nl\/blog\/","name":"Trifork Blog","description":"Keep updated on the technical solutions Trifork is working on!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/trifork.nl\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/c0ee9f25744015bf661fee1b797341f2","name":"Jelmer Kuperus","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fff87cf8073c776ffcbe26326f713998?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fff87cf8073c776ffcbe26326f713998?s=96&d=mm&r=g","caption":"Jelmer Kuperus"},"sameAs":["http:\/\/www.dutchworks.nl"],"url":"https:\/\/trifork.nl\/blog\/author\/jelmer\/"}]}},"_links":{"self":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/2789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/comments?post=2789"}],"version-history":[{"count":0,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/2789\/revisions"}],"wp:attachment":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/media?parent=2789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/categories?post=2789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/tags?post=2789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}